mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 03:25:20 +00:00
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: 6cb0ec48bd
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
06f5c092b8
commit
167ac6354c
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user