The one instance of a virPCIDevice in
qemuDomainDeviceCalculatePCIConnectFlags() needs to be converted to
use g_autoptr as a prerequisite for a bugfix. It's in this patch by
itself (rather than in a patch converting all virPCIDevice usages to
g_autoptr) to simplify any backport of said bugfix.
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
case VIR_DOMAIN_DEVICE_HOSTDEV: {
virDomainHostdevDefPtr hostdev = dev->data.hostdev;
bool isExpress = false;
- virPCIDevicePtr pciDev;
+ g_autoptr(virPCIDevice) pciDev = NULL;
virPCIDeviceAddressPtr hostAddr = &hostdev->source.subsys.u.pci.addr;
if (!virHostdevIsMdevDevice(hostdev) &&
off_t configLen
= virFileLength(virPCIDeviceGetConfigPath(pciDev), -1);
- virPCIDeviceFree(pciDev);
-
if (configLen == 256)
return pciFlags;
* a definitive answer.
*/
isExpress = virPCIDeviceIsPCIExpress(pciDev);
- virPCIDeviceFree(pciDev);
if (isExpress)
return pcieFlags;