* [Qemu-devel] [PATCH] net: Fix hotplug with pci_add
@ 2010-06-08 15:17 Amit Shah
2010-06-08 15:31 ` [Qemu-devel] " Gerd Hoffmann
0 siblings, 1 reply; 3+ messages in thread
From: Amit Shah @ 2010-06-08 15:17 UTC (permalink / raw)
To: qemu list; +Cc: Amit Shah, Juan Quintela, Gerd Hoffmann, Markus Armbruster
The correct model type wasn't getting added when hotplugging nics with
pci_add.
Testcase: start VM with default nic type. In the qemu_monitor:
(qemu) pci_add auto nic model=virtio
This results in a nic hot-plug of the same nic type as the default.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
net.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/net.c b/net.c
index efa8b3d..ca421ed 100644
--- a/net.c
+++ b/net.c
@@ -1106,6 +1106,7 @@ int net_client_init(Monitor *mon, QemuOpts *opts, int is_netdev)
for (i = 0; net_client_types[i].type != NULL; i++) {
if (!strcmp(net_client_types[i].type, type)) {
VLANState *vlan = NULL;
+ int ret;
if (qemu_opts_validate(opts, &net_client_types[i].desc[0]) == -1) {
return -1;
@@ -1119,13 +1120,14 @@ int net_client_init(Monitor *mon, QemuOpts *opts, int is_netdev)
}
if (net_client_types[i].init) {
- if (net_client_types[i].init(opts, mon, name, vlan) < 0) {
+ ret = net_client_types[i].init(opts, mon, name, vlan);
+ if (ret < 0) {
/* TODO push error reporting into init() methods */
qerror_report(QERR_DEVICE_INIT_FAILED, type);
return -1;
}
}
- return 0;
+ return ret;
}
}
--
1.7.0.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Qemu-devel] Re: [PATCH] net: Fix hotplug with pci_add
2010-06-08 15:17 [Qemu-devel] [PATCH] net: Fix hotplug with pci_add Amit Shah
@ 2010-06-08 15:31 ` Gerd Hoffmann
2010-06-08 16:40 ` Amit Shah
0 siblings, 1 reply; 3+ messages in thread
From: Gerd Hoffmann @ 2010-06-08 15:31 UTC (permalink / raw)
To: Amit Shah; +Cc: Juan Quintela, qemu list, Markus Armbruster
On 06/08/10 17:17, Amit Shah wrote:
> The correct model type wasn't getting added when hotplugging nics with
> pci_add.
>
> Testcase: start VM with default nic type. In the qemu_monitor:
>
> (qemu) pci_add auto nic model=virtio
>
> This results in a nic hot-plug of the same nic type as the default.
Same goes for mac address and vlan btw, most likely for the same reason.
I guess your patch handles this too?
cheers,
Gerd
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Qemu-devel] Re: [PATCH] net: Fix hotplug with pci_add
2010-06-08 15:31 ` [Qemu-devel] " Gerd Hoffmann
@ 2010-06-08 16:40 ` Amit Shah
0 siblings, 0 replies; 3+ messages in thread
From: Amit Shah @ 2010-06-08 16:40 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: Juan Quintela, qemu list, Markus Armbruster
On (Tue) Jun 08 2010 [17:31:04], Gerd Hoffmann wrote:
> On 06/08/10 17:17, Amit Shah wrote:
> >The correct model type wasn't getting added when hotplugging nics with
> >pci_add.
> >
> >Testcase: start VM with default nic type. In the qemu_monitor:
> >
> >(qemu) pci_add auto nic model=virtio
> >
> >This results in a nic hot-plug of the same nic type as the default.
>
> Same goes for mac address and vlan btw, most likely for the same
> reason. I guess your patch handles this too?
Yes, all the properties.
Amit
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-06-08 16:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-08 15:17 [Qemu-devel] [PATCH] net: Fix hotplug with pci_add Amit Shah
2010-06-08 15:31 ` [Qemu-devel] " Gerd Hoffmann
2010-06-08 16:40 ` Amit Shah
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).