[libvirt PATCH 2/2] qemu: error out if vsock does not have a pre-opened file descriptor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This improves the error message when used with domxml-to-native
from:
error: internal error: invalid use of command API

https://bugzilla.redhat.com/show_bug.cgi?id=1777212

Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx>
---
 src/qemu/qemu_command.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 156af4caee..f71f867942 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -10291,6 +10291,12 @@ qemuBuildVsockCommandLine(virCommand *cmd,
     qemuDomainVsockPrivate *priv = (qemuDomainVsockPrivate *)vsock->privateData;
     g_autofree char *devstr = NULL;
 
+    if (priv->vhostfd == -1) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                       _("only pre-opened file descriptors are supported for vsock devices"));
+        return -1;
+    }
+
     if (!(devstr = qemuBuildVsockDevStr(def, vsock, qemuCaps, "")))
         return -1;
 
-- 
2.31.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux