2daa92
From 9475a3ba1e808aa3fe1a975e98bcd1ac7a660d01 Mon Sep 17 00:00:00 2001
2daa92
From: Cole Robinson <crobinso@redhat.com>
2daa92
Date: Wed, 31 Jul 2013 21:37:40 -0400
2daa92
Subject: [PATCH] qemu: Only setup vhost if virtType == "kvm"
2daa92
2daa92
vhost only works in KVM mode at the moment, and is infact compiled
2daa92
out if the emulator is built for non-native architecture. While it
2daa92
may work at some point in the future for plain qemu, for now it's
2daa92
just noise on the command line (and which contributes to arm cli
2daa92
breakage).
2daa92
---
2daa92
 src/qemu/qemu_command.c | 6 ++++--
2daa92
 1 file changed, 4 insertions(+), 2 deletions(-)
2daa92
2daa92
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
2daa92
index d968333..6710bf0 100644
2daa92
--- a/src/qemu/qemu_command.c
2daa92
+++ b/src/qemu/qemu_command.c
2daa92
@@ -441,8 +441,10 @@ qemuOpenVhostNet(virDomainDefPtr def,
2daa92
 {
2daa92
     size_t i;
2daa92
 
2daa92
-    /* If the config says explicitly to not use vhost, return now */
2daa92
-    if (net->driver.virtio.name == VIR_DOMAIN_NET_BACKEND_TYPE_QEMU) {
2daa92
+    /* If running a plain QEMU guest, or
2daa92
+     * if the config says explicitly to not use vhost, return now*/
2daa92
+    if (def->virtType != VIR_DOMAIN_VIRT_KVM ||
2daa92
+        net->driver.virtio.name == VIR_DOMAIN_NET_BACKEND_TYPE_QEMU) {
2daa92
         *vhostfdSize = 0;
2daa92
         return 0;
2daa92
     }