[libvirt] [PATCH] qemu: fix missing ifname in qemu argument

Ryota Ozaki ozaki.ryota at gmail.com
Tue Jul 28 15:10:02 UTC 2009


Hi,

This patch adds missing ifname, which is a tap name for network/bridge
configuration, in qemu argument of -net. Without this patch, a specified
tap name, e.g., <target dev='tap01'/>, in a domain XML will be ignored.

Thanks,
  ozaki-r

>From feeca4f2cecf5c6836f7aec6e004585f3b855bed Mon Sep 17 00:00:00 2001
From: Ryota Ozaki <ozaki.ryota at gmail.com>
Date: Tue, 28 Jul 2009 23:46:12 +0900
Subject: [PATCH] qemu: fix missing ifname in qemu argument

---
 src/qemu_conf.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/qemu_conf.c b/src/qemu_conf.c
index 4fe4e39..48bf928 100644
--- a/src/qemu_conf.c
+++ b/src/qemu_conf.c
@@ -1187,11 +1187,13 @@ qemuBuildHostNetStr(virConnectPtr conn,
     switch (net->type) {
     case VIR_DOMAIN_NET_TYPE_NETWORK:
     case VIR_DOMAIN_NET_TYPE_BRIDGE:
-        if (virAsprintf(str, "%stap%cfd=%s,vlan=%d%s%s",
+        if (virAsprintf(str, "%stap%cfd=%s,vlan=%d%s%s%s%s",
                         prefix ? prefix : "",
                         type_sep, tapfd, vlan,
                         (net->hostnet_name ? ",name=" : ""),
-                        (net->hostnet_name ? net->hostnet_name : "")) < 0) {
+                        (net->hostnet_name ? net->hostnet_name : ""),
+                        (net->ifname ? ",ifname=" : ""),
+                        (net->ifname ? net->ifname : "")) < 0) {
             virReportOOMError(conn);
             return -1;
         }
-- 
1.6.0.6




More information about the libvir-list mailing list