[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 05/26] usb-net: convert init to realize
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PULL 05/26] usb-net: convert init to realize |
Date: |
Tue, 23 Sep 2014 14:13:16 +0200 |
From: Gonglei <address@hidden>
meanwhile, qerror_report_err() is a transitional interface to
help with converting existing HMP commands to QMP. It should
not be used elsewhere.
Signed-off-by: Gonglei <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb/dev-network.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c
index 518d536..23e3c45 100644
--- a/hw/usb/dev-network.c
+++ b/hw/usb/dev-network.c
@@ -27,7 +27,7 @@
#include "hw/usb.h"
#include "hw/usb/desc.h"
#include "net/net.h"
-#include "qapi/qmp/qerror.h"
+#include "qemu/error-report.h"
#include "qemu/queue.h"
#include "qemu/config-file.h"
#include "sysemu/sysemu.h"
@@ -1341,7 +1341,7 @@ static NetClientInfo net_usbnet_info = {
.cleanup = usbnet_cleanup,
};
-static int usb_net_initfn(USBDevice *dev)
+static void usb_net_realize(USBDevice *dev, Error **errrp)
{
USBNetState *s = DO_UPCAST(USBNetState, dev, dev);
@@ -1373,7 +1373,6 @@ static int usb_net_initfn(USBDevice *dev)
usb_desc_set_string(dev, STRING_ETHADDR, s->usbstring_mac);
add_boot_device_path(s->conf.bootindex, &dev->qdev, "/address@hidden");
- return 0;
}
static USBDevice *usb_net_init(USBBus *bus, const char *cmdline)
@@ -1392,7 +1391,7 @@ static USBDevice *usb_net_init(USBBus *bus, const char
*cmdline)
idx = net_client_init(opts, 0, &local_err);
if (local_err) {
- qerror_report_err(local_err);
+ error_report("%s", error_get_pretty(local_err));
error_free(local_err);
return NULL;
}
@@ -1421,7 +1420,7 @@ static void usb_net_class_initfn(ObjectClass *klass, void
*data)
DeviceClass *dc = DEVICE_CLASS(klass);
USBDeviceClass *uc = USB_DEVICE_CLASS(klass);
- uc->init = usb_net_initfn;
+ uc->realize = usb_net_realize;
uc->product_desc = "QEMU USB Network Interface";
uc->usb_desc = &desc_net;
uc->handle_reset = usb_net_handle_reset;
--
1.8.3.1
- [Qemu-devel] [PULL 17/26] dev-wacom: convert init to realize, (continued)
- [Qemu-devel] [PULL 17/26] dev-wacom: convert init to realize, Gerd Hoffmann, 2014/09/23
- [Qemu-devel] [PULL 08/26] usb-hub: convert init to realize, Gerd Hoffmann, 2014/09/23
- [Qemu-devel] [PULL 03/26] ohci: Convert fprint/DPRINTF/print to traces, Gerd Hoffmann, 2014/09/23
- [Qemu-devel] [PULL 01/26] usb-storage: Fix how legacy init handles option ID clash, Gerd Hoffmann, 2014/09/23
- [Qemu-devel] [PULL 26/26] usb: tag standalone ehci as hotpluggable, Gerd Hoffmann, 2014/09/23
- [Qemu-devel] [PULL 11/26] dev-uas: convert init to realize, Gerd Hoffmann, 2014/09/23
- [Qemu-devel] [PULL 02/26] usb-storage: fix possible memory leak and missing error message, Gerd Hoffmann, 2014/09/23
- [Qemu-devel] [PULL 06/26] libusb: convert init to realize, Gerd Hoffmann, 2014/09/23
- [Qemu-devel] [PULL 09/26] dev-storage: convert init to realize, Gerd Hoffmann, 2014/09/23
- [Qemu-devel] [PULL 10/26] dev-storage: usring error_report instead of fprintf/printf, Gerd Hoffmann, 2014/09/23
- [Qemu-devel] [PULL 05/26] usb-net: convert init to realize,
Gerd Hoffmann <=
- [Qemu-devel] [PULL 24/26] usb: tag xhci as hotpluggable, Gerd Hoffmann, 2014/09/23
- [Qemu-devel] [PULL 25/26] usb: tag standalone uhci as hotpluggable, Gerd Hoffmann, 2014/09/23
- Re: [Qemu-devel] [PULL 00/26] usb patch queue, Peter Maydell, 2014/09/23