mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35:17 +00:00
tests: Use glib memory functions in virpcimock.c
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
603b97cb32
commit
e228d6b92a
@ -427,9 +427,7 @@ pci_device_create_iommu(const struct pciDevice *dev,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VIR_ALLOC_QUIET(iommuGroup) < 0)
|
iommuGroup = g_new0(struct pciIommuGroup, 1);
|
||||||
ABORT_OOM();
|
|
||||||
|
|
||||||
iommuGroup->iommu = dev->iommuGroup;
|
iommuGroup->iommu = dev->iommuGroup;
|
||||||
iommuGroup->nDevicesBoundToVFIO = 0; /* No device bound to VFIO by default */
|
iommuGroup->nDevicesBoundToVFIO = 0; /* No device bound to VFIO by default */
|
||||||
|
|
||||||
@ -469,8 +467,7 @@ pci_device_new_from_stub(const struct pciDevice *data)
|
|||||||
c = strchr(c, ':');
|
c = strchr(c, ':');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VIR_ALLOC_QUIET(dev) < 0)
|
dev = g_new0(struct pciDevice, 1);
|
||||||
ABORT_OOM();
|
|
||||||
|
|
||||||
configSrc = g_strdup_printf("%s/virpcitestdata/%s.config", abs_srcdir, id);
|
configSrc = g_strdup_printf("%s/virpcitestdata/%s.config", abs_srcdir, id);
|
||||||
|
|
||||||
@ -694,8 +691,7 @@ pci_driver_new(const char *name, ...)
|
|||||||
int vendor, device;
|
int vendor, device;
|
||||||
g_autofree char *driverpath = NULL;
|
g_autofree char *driverpath = NULL;
|
||||||
|
|
||||||
if (VIR_ALLOC_QUIET(driver) < 0)
|
driver = g_new0(struct pciDriver, 1);
|
||||||
ABORT_OOM();
|
|
||||||
driver->name = g_strdup(name);
|
driver->name = g_strdup(name);
|
||||||
if (!(driverpath = pci_driver_get_path(driver, NULL, true)))
|
if (!(driverpath = pci_driver_get_path(driver, NULL, true)))
|
||||||
ABORT_OOM();
|
ABORT_OOM();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user