]> xenbits.xensource.com Git - 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)
committerGuido Günther <agx@sigxcpu.org>
Thu, 13 Aug 2015 19:31:54 +0000 (21:31 +0200)
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.

src/qemu/qemu_command.c

index 5a92ad4b2edbfd23662519b6d7c2ca2e620cd707..c5a4fdf09a2b22e59d5795f565649dc0966d51ac 100644 (file)
@@ -295,6 +295,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");