From 15a9f829a0baafa3b917c33d6fd26f8ff7de5963 Mon Sep 17 00:00:00 2001 From: Matt Coleman Date: Mon, 1 Feb 2021 19:48:44 -0500 Subject: [PATCH] hyperv: implement networkGetAutostart, networkIsActive, and networkIsPersistent Co-authored-by: Dawid Zamirski Signed-off-by: Matt Coleman Reviewed-by: Michal Privoznik --- src/hyperv/hyperv_network_driver.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/hyperv/hyperv_network_driver.c b/src/hyperv/hyperv_network_driver.c index f85dea31fe..d6407ac591 100644 --- a/src/hyperv/hyperv_network_driver.c +++ b/src/hyperv/hyperv_network_driver.c @@ -180,6 +180,31 @@ hypervNetworkLookupByName(virConnectPtr conn, const char *name) } +static int +hypervNetworkGetAutostart(virNetworkPtr network G_GNUC_UNUSED, int *autostart) +{ + /* Hyper-V networks are always active */ + *autostart = 1; + return 0; +} + + +static int +hypervNetworkIsActive(virNetworkPtr network G_GNUC_UNUSED) +{ + /* Hyper-V networks are always active */ + return 1; +} + + +static int +hypervNetworkIsPersistent(virNetworkPtr network G_GNUC_UNUSED) +{ + /* Hyper-V networks are always persistent */ + return 1; +} + + virNetworkDriver hypervNetworkDriver = { .connectNumOfNetworks = hypervConnectNumOfNetworks, /* 7.1.0 */ .connectNumOfDefinedNetworks = hypervConnectNumOfDefinedNetworks, /* 7.1.0 */ @@ -187,4 +212,7 @@ virNetworkDriver hypervNetworkDriver = { .connectListAllNetworks = hypervConnectListAllNetworks, /* 7.1.0 */ .networkLookupByUUID = hypervNetworkLookupByUUID, /* 7.1.0 */ .networkLookupByName = hypervNetworkLookupByName, /* 7.1.0 */ + .networkGetAutostart = hypervNetworkGetAutostart, /* 7.1.0 */ + .networkIsActive = hypervNetworkIsActive, /* 7.1.0 */ + .networkIsPersistent = hypervNetworkIsPersistent, /* 7.1.0 */ };