mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 23:07:44 +00:00
qemu: use g_autoptr for a virPCIDevice
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>
This commit is contained in:
parent
04fd7865f2
commit
01e421c16a
@ -803,7 +803,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev,
|
|||||||
case VIR_DOMAIN_DEVICE_HOSTDEV: {
|
case VIR_DOMAIN_DEVICE_HOSTDEV: {
|
||||||
virDomainHostdevDefPtr hostdev = dev->data.hostdev;
|
virDomainHostdevDefPtr hostdev = dev->data.hostdev;
|
||||||
bool isExpress = false;
|
bool isExpress = false;
|
||||||
virPCIDevicePtr pciDev;
|
g_autoptr(virPCIDevice) pciDev = NULL;
|
||||||
virPCIDeviceAddressPtr hostAddr = &hostdev->source.subsys.u.pci.addr;
|
virPCIDeviceAddressPtr hostAddr = &hostdev->source.subsys.u.pci.addr;
|
||||||
|
|
||||||
if (!virHostdevIsMdevDevice(hostdev) &&
|
if (!virHostdevIsMdevDevice(hostdev) &&
|
||||||
@ -891,8 +891,6 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev,
|
|||||||
off_t configLen
|
off_t configLen
|
||||||
= virFileLength(virPCIDeviceGetConfigPath(pciDev), -1);
|
= virFileLength(virPCIDeviceGetConfigPath(pciDev), -1);
|
||||||
|
|
||||||
virPCIDeviceFree(pciDev);
|
|
||||||
|
|
||||||
if (configLen == 256)
|
if (configLen == 256)
|
||||||
return pciFlags;
|
return pciFlags;
|
||||||
|
|
||||||
@ -904,7 +902,6 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev,
|
|||||||
* a definitive answer.
|
* a definitive answer.
|
||||||
*/
|
*/
|
||||||
isExpress = virPCIDeviceIsPCIExpress(pciDev);
|
isExpress = virPCIDeviceIsPCIExpress(pciDev);
|
||||||
virPCIDeviceFree(pciDev);
|
|
||||||
|
|
||||||
if (isExpress)
|
if (isExpress)
|
||||||
return pcieFlags;
|
return pcieFlags;
|
||||||
|
Loading…
Reference in New Issue
Block a user