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

Ryota Ozaki ozaki.ryota at gmail.com
Tue Jul 28 15:54:32 UTC 2009


On Wed, Jul 29, 2009 at 12:21 AM, Mark McLoughlin<markmc at redhat.com> wrote:
> On Wed, 2009-07-29 at 00:10 +0900, Ryota Ozaki wrote:
>> 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) {
>
> I think latest qemu.git fails if you pass ifname= with fd=
>
> Older versions will just ignore it
>
> <target dev='tap01'/> just means that libvirt will create the tap
> interface as tap01

Oh, I really didn't know the change.

>
> What exactly is the problem you're seeing?

I've retried without ifname and confirmed there is nothing problem.
I seem making a quick judgment the change as a regression.

Apologies for the fuss and please drop my patch.

Thanks,
  ozaki-r

>
> Thanks,
> Mark.
>
>




More information about the libvir-list mailing list