mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 03:25:20 +00:00
qemu: hostdev: Introduce qemuHostdevUpdateActiveDomainDevices()
This calls the PCI-, USB- and SCSI-specific functions just like qemuHostdev{Prepare,ReAttach}DomainDevices() already do, and was the missing piece for the qemuHostdev API to nicely mirror the virHostdev API. Update qemuProcessReconnect() to use the new function.
This commit is contained in:
parent
8da5cbfc78
commit
66f319aec0
@ -83,6 +83,24 @@ qemuHostdevUpdateActiveSCSIDevices(virQEMUDriverPtr driver,
|
||||
QEMU_DRIVER_NAME, def->name);
|
||||
}
|
||||
|
||||
int
|
||||
qemuHostdevUpdateActiveDomainDevices(virQEMUDriverPtr driver,
|
||||
virDomainDefPtr def)
|
||||
{
|
||||
if (!def->nhostdevs)
|
||||
return 0;
|
||||
|
||||
if (qemuHostdevUpdateActivePCIDevices(driver, def) < 0)
|
||||
return -1;
|
||||
|
||||
if (qemuHostdevUpdateActiveUSBDevices(driver, def) < 0)
|
||||
return -1;
|
||||
|
||||
if (qemuHostdevUpdateActiveSCSIDevices(driver, def) < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool
|
||||
qemuHostdevHostSupportsPassthroughVFIO(void)
|
||||
|
@ -36,6 +36,8 @@ int qemuHostdevUpdateActiveUSBDevices(virQEMUDriverPtr driver,
|
||||
virDomainDefPtr def);
|
||||
int qemuHostdevUpdateActiveSCSIDevices(virQEMUDriverPtr driver,
|
||||
virDomainDefPtr def);
|
||||
int qemuHostdevUpdateActiveDomainDevices(virQEMUDriverPtr driver,
|
||||
virDomainDefPtr def);
|
||||
|
||||
int qemuHostdevPreparePCIDevices(virQEMUDriverPtr driver,
|
||||
const char *name,
|
||||
|
@ -3769,13 +3769,7 @@ qemuProcessReconnect(void *opaque)
|
||||
priv->agentError = true;
|
||||
}
|
||||
|
||||
if (qemuHostdevUpdateActivePCIDevices(driver, obj->def) < 0)
|
||||
goto error;
|
||||
|
||||
if (qemuHostdevUpdateActiveUSBDevices(driver, obj->def) < 0)
|
||||
goto error;
|
||||
|
||||
if (qemuHostdevUpdateActiveSCSIDevices(driver, obj->def) < 0)
|
||||
if (qemuHostdevUpdateActiveDomainDevices(driver, obj->def) < 0)
|
||||
goto error;
|
||||
|
||||
if (qemuConnectCgroup(driver, obj) < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user