]> xenbits.xensource.com Git - libvirt.git/commitdiff
bhyve: fix hostbridge device command generation
authorRoman Bogorodskiy <bogorodskiy@gmail.com>
Sat, 15 Mar 2014 15:17:14 +0000 (19:17 +0400)
committerRoman Bogorodskiy <bogorodskiy@gmail.com>
Mon, 17 Mar 2014 17:02:31 +0000 (21:02 +0400)
Addition of the hostbridge device was mistakenly placed to
bhyveBuildNetArgStr(). This could result in hostbridge device not being
added to the commandline if there are no network devices specified, but
hostbridge device should be added unconditionally.

Fix by placing it to virBhyveProcessBuildBhyveCmd().

src/bhyve/bhyve_command.c

index 2cdfa6db8dedd29c72742286c801d7f19ea3fb46..3437646d609c84006d5e3288ea8a59019f88b660 100644 (file)
@@ -173,7 +173,6 @@ bhyveBuildNetArgStr(const virDomainDef *def, virCommandPtr cmd)
         return -1;
     }
 
-    virCommandAddArgList(cmd, "-s", "0:0,hostbridge", NULL);
     virCommandAddArg(cmd, "-s");
     virCommandAddArgFormat(cmd, "1:0,virtio-net,%s", realifname);
 
@@ -268,6 +267,7 @@ virBhyveProcessBuildBhyveCmd(bhyveConnPtr driver ATTRIBUTE_UNUSED,
     virCommandAddArg(cmd, "-H"); /* vmexit from guest on hlt */
     virCommandAddArg(cmd, "-P"); /* vmexit from guest on pause */
 
+    virCommandAddArgList(cmd, "-s", "0:0,hostbridge", NULL);
     /* Devices */
     if (bhyveBuildNetArgStr(vm->def, cmd) < 0)
         goto error;