qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] net: Avoid gcc'ism in net_host_device_add


From: Jan Kiszka
Subject: [Qemu-devel] [PATCH] net: Avoid gcc'ism in net_host_device_add
Date: Tue, 28 Apr 2009 21:25:58 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

Krumme, Chris wrote:
> Sorry for the last comment, but I was out of town. 
> 
>> -----Original Message-----
>> From: 
>> address@hidden 
>> [mailto:address@hidden
>> rg] On Behalf Of Jan Kiszka
>> Sent: Sunday, April 19, 2009 5:04 AM
>> To: address@hidden
>> Cc: Mark McLoughlin
>> Subject: [Qemu-devel] [PATCH v2 04/11] monitor: Improve host_net_add
>>
>> Fix the documentation of the host_net_add monitor command and 
>> allow the
>> user to pass no options at all. Moreover, inform the user on the
>> monitor terminal if a request failed.
>>
>> Signed-off-by: Jan Kiszka <address@hidden>
>> ---
>>
>>  monitor.c |    4 ++--
>>  net.c     |    4 +++-
>>  2 files changed, 5 insertions(+), 3 deletions(-)
>>
>> diff --git a/monitor.c b/monitor.c
>> index 652d1f0..ca2a56d 100644
>> --- a/monitor.c
>> +++ b/monitor.c
>> @@ -1730,8 +1730,8 @@ static const mon_cmd_t mon_cmds[] = {
>>                                          "add drive to PCI 
>> storage controller" },
>>      { "pci_add", "sss", pci_device_hot_add, 
>> "pci_addr=auto|[[<domain>:]<bus>:]<slot> nic|storage 
>> [[vlan=n][,macaddr=addr][,model=type]] 
>> [file=file][,if=type][,bus=nr]...", "hot-add PCI device" },
>>      { "pci_del", "s", pci_device_hot_remove, 
>> "pci_addr=[[<domain>:]<bus>:]<slot>", "hot remove PCI device" },
>> -    { "host_net_add", "ss", net_host_device_add,
>> -      "[tap,user,socket,vde] options", "add host VLAN client" },
>> +    { "host_net_add", "ss?", net_host_device_add,
>> +      "tap|user|socket|vde [options]", "add host VLAN client" },
>>      { "host_net_remove", "is", net_host_device_remove,
>>        "vlan_id name", "remove host VLAN client" },
>>  #endif
>> diff --git a/net.c b/net.c
>> index ca4d87f..22faa40 100644
>> --- a/net.c
>> +++ b/net.c
>> @@ -1860,7 +1860,9 @@ void net_host_device_add(Monitor *mon, 
>> const char *device, const char *opts)
>>          monitor_printf(mon, "invalid host network device 
>> %s\n", device);
>>          return;
>>      }
>> -    net_client_init(device, opts);
>> +    if (net_client_init(device, opts ? : "") < 0) {
> 
> Is this a gcc extension?  Do we want to introduce this construct to the
> code base.

Valid remark, fix below.

Thanks,
Jan

-------->

Signed-off-by: Jan Kiszka <address@hidden>
---

 net.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net.c b/net.c
index dcd27fe..ddcdf5b 100644
--- a/net.c
+++ b/net.c
@@ -2085,7 +2085,7 @@ void net_host_device_add(Monitor *mon, const char 
*device, const char *opts)
         monitor_printf(mon, "invalid host network device %s\n", device);
         return;
     }
-    if (net_client_init(device, opts ? : "") < 0) {
+    if (net_client_init(device, opts ? opts : "") < 0) {
         monitor_printf(mon, "adding host network device %s failed\n", device);
     }
 }

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]