hyperv: implement networkGetAutostart, networkIsActive, and networkIsPersistent

Co-authored-by: Dawid Zamirski <dzamirski@datto.com>
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Matt Coleman 2021-02-01 19:48:44 -05:00 committed by Michal Privoznik
parent b0615df6bf
commit 15a9f829a0

View 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 */
};