diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index e00a5321f9c655b9d3888c2e990707282afc7663..c08d4b9d2db20c194beac2785890c829e5d27204 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -3569,7 +3569,7 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node, */ if ((managed = virXMLPropString(node, "managed"))!= NULL) { if (STREQ(managed, "yes")) - def->managed = 1; + def->managed = true; } /* @type is passed in from the caller rather than read from the diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 08b8e48d17690001e5a04f5b4cce09b9aae22d4e..8a4361967d888b1a9f97eb7d70e5c1832d3fbc79 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -435,7 +435,7 @@ struct _virDomainHostdevDef { virDomainDeviceDef parent; /* higher level Def containing this */ int mode; /* enum virDomainHostdevMode */ int startupPolicy; /* enum virDomainStartupPolicy */ - unsigned int managed : 1; + bool managed; unsigned int missing : 1; union { virDomainHostdevSubsys subsys; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 41a2dfdd863043b46a3266381a66a342366a1698..3ba989d2bdb87b62acba8d051a28a58c92339e50 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -8558,7 +8558,7 @@ qemuParseCommandLinePCI(const char *val) } def->mode = VIR_DOMAIN_HOSTDEV_MODE_SUBSYS; - def->managed = 1; + def->managed = true; def->source.subsys.type = VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI; def->source.subsys.u.pci.bus = bus; def->source.subsys.u.pci.slot = slot; @@ -8619,7 +8619,7 @@ qemuParseCommandLineUSB(const char *val) } def->mode = VIR_DOMAIN_HOSTDEV_MODE_SUBSYS; - def->managed = 0; + def->managed = false; def->source.subsys.type = VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB; if (*end == '.') { def->source.subsys.u.usb.bus = first; diff --git a/src/util/virpci.c b/src/util/virpci.c index 85cd6948d721ea2f48cad5d50b26d7b43f5c8b48..fafede0c1b83becfdbec67fa5ea6b30edf7248e5 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -65,7 +65,7 @@ struct _virPCIDevice { unsigned pci_pm_cap_pos; unsigned has_flr : 1; unsigned has_pm_reset : 1; - unsigned managed : 1; + bool managed; /* used by reattach function */ unsigned unbind_from_stub : 1; @@ -1453,9 +1453,9 @@ virPCIDeviceGetName(virPCIDevicePtr dev) return dev->name; } -void virPCIDeviceSetManaged(virPCIDevicePtr dev, unsigned managed) +void virPCIDeviceSetManaged(virPCIDevicePtr dev, bool managed) { - dev->managed = !!managed; + dev->managed = managed; } unsigned virPCIDeviceGetManaged(virPCIDevicePtr dev) diff --git a/src/util/virpci.h b/src/util/virpci.h index cf2aecd4bf7f240d5c498f27d4d74fcd0829dd89..9ea721a433f9e06da5b950288e3356fb1df6fe6d 100644 --- a/src/util/virpci.h +++ b/src/util/virpci.h @@ -61,7 +61,7 @@ int virPCIDeviceReset(virPCIDevicePtr dev, virPCIDeviceListPtr inactiveDevs); void virPCIDeviceSetManaged(virPCIDevice *dev, - unsigned managed); + bool managed); unsigned virPCIDeviceGetManaged(virPCIDevice *dev); void virPCIDeviceSetUsedBy(virPCIDevice *dev, const char *used_by); diff --git a/src/xenxs/xen_sxpr.c b/src/xenxs/xen_sxpr.c index cc4225b49fffe76eb8a75a363b7cc9d8aea30c3a..7ed148276ab35669d5d014f6f60b9f670813b9ea 100644 --- a/src/xenxs/xen_sxpr.c +++ b/src/xenxs/xen_sxpr.c @@ -1087,7 +1087,7 @@ xenParseSxprPCI(virDomainDefPtr def, goto error; dev->mode = VIR_DOMAIN_HOSTDEV_MODE_SUBSYS; - dev->managed = 0; + dev->managed = false; dev->source.subsys.type = VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI; dev->source.subsys.u.pci.domain = domainID; dev->source.subsys.u.pci.bus = busID; diff --git a/src/xenxs/xen_xm.c b/src/xenxs/xen_xm.c index 34103b9bb0fe9d6ba7928f4bf30fc4e4aafce252..14e26c313037c0030f15828e246f7e6ef19cc267 100644 --- a/src/xenxs/xen_xm.c +++ b/src/xenxs/xen_xm.c @@ -875,7 +875,7 @@ xenParseXM(virConfPtr conf, int xendConfigVersion, if (!(hostdev = virDomainHostdevDefAlloc())) goto cleanup; - hostdev->managed = 0; + hostdev->managed = false; hostdev->source.subsys.type = VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI; hostdev->source.subsys.u.pci.domain = domainID; hostdev->source.subsys.u.pci.bus = busID;