From: Andrea Bolognani Date: Thu, 24 Mar 2022 18:32:13 +0000 (+0100) Subject: network: Convert managed property of hostdev-pci ports correctly X-Git-Tag: v8.3.0-rc1~163 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=167ac6354ce9bd306c682f4507f5c92c9709521f;p=thirdparty%2Flibvirt.git network: Convert managed property of hostdev-pci ports correctly virNetworkForwardDef.managed is a bool but virNetworkPortDef.hostdevpci.managed is a virTristateBool, which means that the current code performs the following incorrect conversion: false -> BOOL_ABSENT true -> BOOL_YES Using the virTristateBoolFromBool() helper solves the issue. Fixes: 6cb0ec48bd95c95489a987e05a88e8bcf1f9109c Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 67c5a111b3..e7049ba384 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -3991,7 +3991,7 @@ networkAllocatePort(virNetworkObj *obj, } port->plug.hostdevpci.addr = dev->device.pci; port->plug.hostdevpci.driver = netdef->forward.driverName; - port->plug.hostdevpci.managed = netdef->forward.managed; + port->plug.hostdevpci.managed = virTristateBoolFromBool(netdef->forward.managed); if (port->virtPortProfile) { /* make sure type is supported for hostdev connections */