提交 0f61d7b5 编写于 作者: M Martin Kletzander

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: NMartin Kletzander <mkletzan@redhat.com>
上级 6b5622e4
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册