]> xenbits.xensource.com Git - libvirt.git/commitdiff
hyperv: implement networkGetAutostart, networkIsActive, and networkIsPersistent
authorMatt Coleman <mcoleman@datto.com>
Tue, 2 Feb 2021 00:48:44 +0000 (19:48 -0500)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 2 Feb 2021 08:36:35 +0000 (09:36 +0100)
Co-authored-by: Dawid Zamirski <dzamirski@datto.com>
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/hyperv/hyperv_network_driver.c

index f85dea31fef9515823f1edc59dc8d6f748711074..d6407ac591bdc0dba7730505b8036665970447bb 100644 (file)
@@ -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 */
 };