mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
qemu: process: Add a hotplug version of qemuProcessPrepareHostBackendChardev
When hotplugging a chardev we need the same form of setup for the character device. Export a version which takes a 'virDomainDeviceDef'. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
f22e372de2
commit
d86bfa631e
@ -6936,6 +6936,33 @@ qemuProcessPrepareHostBackendChardev(virDomainObj *vm)
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
qemuProcessPrepareHostBackendChardevHotplug(virDomainObj *vm,
|
||||
virDomainDeviceDef *dev)
|
||||
{
|
||||
qemuDomainObjPrivate *priv = vm->privateData;
|
||||
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(priv->driver);
|
||||
struct qemuProcessPrepareHostBackendChardevData data = {
|
||||
.priv = priv,
|
||||
.logManager = NULL,
|
||||
.cfg = cfg,
|
||||
.def = vm->def,
|
||||
};
|
||||
g_autoptr(virLogManager) logManager = NULL;
|
||||
|
||||
if (cfg->stdioLogD) {
|
||||
if (!(logManager = data.logManager = virLogManagerNew(priv->driver->privileged)))
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (qemuDomainDeviceBackendChardevForeachOne(dev,
|
||||
qemuProcessPrepareHostBackendChardevOne,
|
||||
&data) < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* qemuProcessPrepareHost:
|
||||
* @driver: qemu driver
|
||||
|
@ -120,6 +120,12 @@ int qemuProcessOpenVhostVsock(virDomainVsockDef *vsock);
|
||||
|
||||
int qemuProcessPrepareHostHostdev(virDomainHostdevDef *hostdev);
|
||||
|
||||
|
||||
int qemuProcessPrepareHostBackendChardevHotplug(virDomainObj *vm,
|
||||
virDomainDeviceDef *dev)
|
||||
G_GNUC_NO_INLINE;
|
||||
|
||||
|
||||
int qemuProcessPrepareHost(virQEMUDriver *driver,
|
||||
virDomainObj *vm,
|
||||
unsigned int flags);
|
||||
|
Loading…
x
Reference in New Issue
Block a user