mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 13:05:27 +00:00
qemu: Abstract shmem socket path preparation
Put it into qemuDomainPrepareShmemChardev() so it can be used later. Also don't fill in the path unless the server option is enabled. Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
6b5622e4b5
commit
0f61d7b5f2
@ -8560,10 +8560,7 @@ qemuBuildShmemBackendStr(virLogManagerPtr logManager,
|
||||
{
|
||||
char *devstr = NULL;
|
||||
|
||||
if (!shmem->server.chr.data.nix.path &&
|
||||
virAsprintf(&shmem->server.chr.data.nix.path,
|
||||
"/var/lib/libvirt/shmem-%s-sock",
|
||||
shmem->name) < 0)
|
||||
if (qemuDomainPrepareShmemChardev(shmem) < 0)
|
||||
return NULL;
|
||||
|
||||
devstr = qemuBuildChrChardevStr(logManager, cmd, cfg, def,
|
||||
|
@ -6056,6 +6056,19 @@ qemuDomainPrepareChannel(virDomainChrDefPtr channel,
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
qemuDomainPrepareShmemChardev(virDomainShmemDefPtr shmem)
|
||||
{
|
||||
if (!shmem->server.enabled ||
|
||||
shmem->server.chr.data.nix.path)
|
||||
return 0;
|
||||
|
||||
return virAsprintf(&shmem->server.chr.data.nix.path,
|
||||
"/var/lib/libvirt/shmem-%s-sock",
|
||||
shmem->name);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* qemuDomainVcpuHotplugIsInOrder:
|
||||
* @def: domain definition
|
||||
|
@ -722,6 +722,9 @@ int qemuDomainPrepareChannel(virDomainChrDefPtr chr,
|
||||
const char *domainChannelTargetDir)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
||||
|
||||
int qemuDomainPrepareShmemChardev(virDomainShmemDefPtr shmem)
|
||||
ATTRIBUTE_NONNULL(1);
|
||||
|
||||
bool qemuDomainVcpuHotplugIsInOrder(virDomainDefPtr def)
|
||||
ATTRIBUTE_NONNULL(1);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user