]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Check if qemu-bridge-helper exists and is executable
authorGuido Günther <agx@sigxcpu.org>
Thu, 13 Aug 2015 12:19:50 +0000 (14:19 +0200)
committerCole Robinson <crobinso@redhat.com>
Tue, 22 Sep 2015 00:18:00 +0000 (20:18 -0400)
Otherwise the error is just

    error: Failed to create domain from test1.xml
    error: failed to retrieve file descriptor for interface: Transport endpoint is not connected

since we don't get a sensible error after the fork.

(cherry picked from commit 151ba022939dad1e562c4156cb62e7a3ade6a7f5)

src/qemu/qemu_command.c

index 2d222da5fd825c479e9d637444472960d73acffa..d12eb54d13a3edf2ebe9e30765c9eaf10dc1c567 100644 (file)
@@ -296,6 +296,12 @@ static int qemuCreateInBridgePortWithHelper(virQEMUDriverConfigPtr cfg,
         return -1;
     }
 
+    if (!virFileIsExecutable(cfg->bridgeHelperName)) {
+        virReportSystemError(errno, _("'%s' is not a suitable bridge helper"),
+                             cfg->bridgeHelperName);
+        return -1;
+    }
+
     cmd = virCommandNew(cfg->bridgeHelperName);
     if (flags & VIR_NETDEV_TAP_CREATE_VNET_HDR)
         virCommandAddArgFormat(cmd, "--use-vnet");