mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
qemu: Split shmem preparation as it's supposed to be
Since the introduction of shmem, there was a split of preparation code from the formatting code from qemuBuildCommandLine() into qemuProcessPrepareDomain(). Let's fix shmem in this regard, so that we can slowly get to a cleaner codebase. Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
19581afd77
commit
848378c64c
@ -8879,28 +8879,6 @@ qemuBuildShmemDevStr(virDomainDefPtr def,
|
||||
return virBufferContentAndReset(&buf);
|
||||
}
|
||||
|
||||
static char *
|
||||
qemuBuildShmemBackendChrStr(virLogManagerPtr logManager,
|
||||
virCommandPtr cmd,
|
||||
virQEMUDriverConfigPtr cfg,
|
||||
virDomainDefPtr def,
|
||||
virDomainShmemDefPtr shmem,
|
||||
virQEMUCapsPtr qemuCaps,
|
||||
bool chardevStdioLogd)
|
||||
{
|
||||
char *devstr = NULL;
|
||||
|
||||
if (qemuDomainPrepareShmemChardev(shmem) < 0)
|
||||
return NULL;
|
||||
|
||||
devstr = qemuBuildChrChardevStr(logManager, cmd, cfg, def,
|
||||
&shmem->server.chr,
|
||||
shmem->info.alias, qemuCaps, true,
|
||||
chardevStdioLogd);
|
||||
|
||||
return devstr;
|
||||
}
|
||||
|
||||
|
||||
virJSONValuePtr
|
||||
qemuBuildShmemBackendMemProps(virDomainShmemDefPtr shmem)
|
||||
@ -9010,9 +8988,11 @@ qemuBuildShmemCommandLine(virLogManagerPtr logManager,
|
||||
VIR_FREE(devstr);
|
||||
|
||||
if (shmem->server.enabled) {
|
||||
if (!(devstr = qemuBuildShmemBackendChrStr(logManager, cmd, cfg, def,
|
||||
shmem, qemuCaps,
|
||||
chardevStdioLogd)))
|
||||
devstr = qemuBuildChrChardevStr(logManager, cmd, cfg, def,
|
||||
&shmem->server.chr,
|
||||
shmem->info.alias, qemuCaps, true,
|
||||
chardevStdioLogd);
|
||||
if (!devstr)
|
||||
return -1;
|
||||
|
||||
virCommandAddArgList(cmd, "-chardev", devstr, NULL);
|
||||
|
@ -5325,6 +5325,11 @@ qemuProcessPrepareDomain(virConnectPtr conn,
|
||||
if (qemuProcessUpdateGuestCPU(vm->def, priv->qemuCaps, caps, flags) < 0)
|
||||
goto cleanup;
|
||||
|
||||
for (i = 0; i < vm->def->nshmems; i++) {
|
||||
if (qemuDomainPrepareShmemChardev(vm->def->shmems[i]) < 0)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
cleanup:
|
||||
virObjectUnref(caps);
|
||||
|
Loading…
x
Reference in New Issue
Block a user