[PATCH 9/9] network: Convert managed property of hostdev-pci ports correctly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <abologna@xxxxxxxxxx>
---
 src/network/bridge_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 */
-- 
2.35.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux