qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 08/16] convert net_client_init() to OptsVisitor


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 08/16] convert net_client_init() to OptsVisitor
Date: Tue, 05 Jun 2012 22:46:21 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1

Il 22/05/2012 12:45, Laszlo Ersek ha scritto:
> (1) since both Netdev::id and NetLegacy::name are mandatory now, getting the
> name for the init functions is cleaner;

But they shouldn't be mandatory, should they?  ("-net nic -net user"
should work, and also "-net nic,netdev=foo -netdev user,id=foo").

Nevertheless it should be as simple as doing

-        name = u.netdev->id;
+        name = u.netdev->has_id ? u.netdev->id : NULL;

-        name = u.net->name;
+        name = u.net->has_name ? u.net->name : NULL;

Paolo



reply via email to

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