A string prefix for the file descriptor name. Domain startup
uses the numeric value of fd without a prefix, but hotplug
will need to use a prefix because file descriptor names
passed via add-fd cannot start with a number.
https://bugzilla.redhat.com/show_bug.cgi?id=1291851
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/qemu/qemu_command.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 3269c08806..89cd931de6 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -9915,7 +9915,8 @@ qemuBuildSeccompSandboxCommandLine(virCommandPtr cmd,
static char *
qemuBuildVsockDevStr(virDomainDefPtr def,
virDomainVsockDefPtr vsock,
- virQEMUCapsPtr qemuCaps)
+ virQEMUCapsPtr qemuCaps,
+ const char *fdprefix)
{
qemuDomainVsockPrivatePtr priv = (qemuDomainVsockPrivatePtr)vsock->privateData;
virBuffer buf = VIR_BUFFER_INITIALIZER;
@@ -9925,7 +9926,7 @@ qemuBuildVsockDevStr(virDomainDefPtr def,
virBufferAsprintf(&buf, "%s", device);
virBufferAsprintf(&buf, ",id=%s", vsock->info.alias);
virBufferAsprintf(&buf, ",guest-cid=%u", vsock->guest_cid);
- virBufferAsprintf(&buf, ",vhostfd=%u", priv->vhostfd);
+ virBufferAsprintf(&buf, ",vhostfd=%s%u", fdprefix, priv->vhostfd);
if (qemuBuildDeviceAddressStr(&buf, def, &vsock->info, qemuCaps) < 0)
goto cleanup;
@@ -9950,7 +9951,7 @@ qemuBuildVsockCommandLine(virCommandPtr cmd,
char *devstr = NULL;
int ret = -1;
- if (!(devstr = qemuBuildVsockDevStr(def, vsock, qemuCaps)))
+ if (!(devstr = qemuBuildVsockDevStr(def, vsock, qemuCaps, "")))
goto cleanup;
virCommandPassFD(cmd, priv->vhostfd, VIR_COMMAND_PASS_FD_CLOSE_PARENT);
--
2.16.1