diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2012-06-06 20:57:56 +0800 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-06-06 20:57:56 +0800 |
commit | 349417004a0f7cf5518a998dca755cd06f6c212b (patch) | |
tree | 70bad616da7eb6d55a1d1781fdd64915a532bbcb /hw | |
parent | e1ae9a7a78be8d894c111059955fe0e25ec4c203 (diff) | |
parent | 4860853d60ecea44b65e9cdefce980de3a641dce (diff) | |
download | hqemu-349417004a0f7cf5518a998dca755cd06f6c212b.zip hqemu-349417004a0f7cf5518a998dca755cd06f6c212b.tar.gz |
Merge remote-tracking branch 'qmp/queue/qmp' into staging
* qmp/queue/qmp: (29 commits)
Add 'query-events' command to QMP to query async events
qapi: convert netdev_del
qapi: convert netdev_add
net: net_client_init(): use error_set()
net: purge the monitor object from all init functions
qemu-config: introduce qemu_find_opts_err()
qemu-config: find_list(): use error_set()
qerror: introduce QERR_INVALID_OPTION_GROUP
qemu-option: qemu_opts_from_qdict(): use error_set()
qemu-option: introduce qemu_opt_set_err()
qemu-option: opt_set(): use error_set()
qemu-option: qemu_opts_validate(): use error_set()
qemu-option: qemu_opt_parse(): use error_set()
qemu-option: parse_option_size(): use error_set()
qemu-option: parse_option_bool(): use error_set()
qemu-option: parse_option_number(): use error_set()
qemu-option: qemu_opts_create(): use error_set()
introduce a new monitor command 'dump-guest-memory' to dump guest's memory
make gdb_id() generally avialable and rename it to cpu_index()
target-i386: Add API to get note's size
...
Diffstat (limited to 'hw')
-rw-r--r-- | hw/pci-hotplug.c | 8 | ||||
-rw-r--r-- | hw/qdev-monitor.c | 7 | ||||
-rw-r--r-- | hw/usb/dev-network.c | 7 | ||||
-rw-r--r-- | hw/usb/dev-storage.c | 2 | ||||
-rw-r--r-- | hw/watchdog.c | 2 |
5 files changed, 18 insertions, 8 deletions
diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c index c55d8b9..61257f4 100644 --- a/hw/pci-hotplug.c +++ b/hw/pci-hotplug.c @@ -39,6 +39,7 @@ static PCIDevice *qemu_pci_hot_add_nic(Monitor *mon, const char *devaddr, const char *opts_str) { + Error *local_err = NULL; QemuOpts *opts; PCIBus *bus; int ret, devfn; @@ -60,9 +61,12 @@ static PCIDevice *qemu_pci_hot_add_nic(Monitor *mon, qemu_opt_set(opts, "type", "nic"); - ret = net_client_init(mon, opts, 0); - if (ret < 0) + ret = net_client_init(opts, 0, &local_err); + if (error_is_set(&local_err)) { + qerror_report_err(local_err); + error_free(local_err); return NULL; + } if (nd_table[ret].devaddr) { monitor_printf(mon, "Parameter addr not supported\n"); return NULL; diff --git a/hw/qdev-monitor.c b/hw/qdev-monitor.c index eed781d..b01ef06 100644 --- a/hw/qdev-monitor.c +++ b/hw/qdev-monitor.c @@ -554,10 +554,13 @@ void do_info_qdm(Monitor *mon) int do_device_add(Monitor *mon, const QDict *qdict, QObject **ret_data) { + Error *local_err = NULL; QemuOpts *opts; - opts = qemu_opts_from_qdict(qemu_find_opts("device"), qdict); - if (!opts) { + opts = qemu_opts_from_qdict(qemu_find_opts("device"), qdict, &local_err); + if (error_is_set(&local_err)) { + qerror_report_err(local_err); + error_free(local_err); return -1; } if (!monitor_cur_is_qmp() && qdev_device_help(opts)) { diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c index b238a09..5d2f098 100644 --- a/hw/usb/dev-network.c +++ b/hw/usb/dev-network.c @@ -1356,6 +1356,7 @@ static int usb_net_initfn(USBDevice *dev) static USBDevice *usb_net_init(USBBus *bus, const char *cmdline) { + Error *local_err = NULL; USBDevice *dev; QemuOpts *opts; int idx; @@ -1367,8 +1368,10 @@ static USBDevice *usb_net_init(USBBus *bus, const char *cmdline) qemu_opt_set(opts, "type", "nic"); qemu_opt_set(opts, "model", "usb"); - idx = net_client_init(NULL, opts, 0); - if (idx == -1) { + idx = net_client_init(opts, 0, &local_err); + if (error_is_set(&local_err)) { + qerror_report_err(local_err); + error_free(local_err); return NULL; } diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c index ae22fb1..a96c0b9 100644 --- a/hw/usb/dev-storage.c +++ b/hw/usb/dev-storage.c @@ -584,7 +584,7 @@ static USBDevice *usb_msd_init(USBBus *bus, const char *filename) /* parse -usbdevice disk: syntax into drive opts */ snprintf(id, sizeof(id), "usb%d", nr++); - opts = qemu_opts_create(qemu_find_opts("drive"), id, 0); + opts = qemu_opts_create(qemu_find_opts("drive"), id, 0, NULL); p1 = strchr(filename, ':'); if (p1++) { diff --git a/hw/watchdog.c b/hw/watchdog.c index 4c18965..a42124d 100644 --- a/hw/watchdog.c +++ b/hw/watchdog.c @@ -66,7 +66,7 @@ int select_watchdog(const char *p) QLIST_FOREACH(model, &watchdog_list, entry) { if (strcasecmp(model->wdt_name, p) == 0) { /* add the device */ - opts = qemu_opts_create(qemu_find_opts("device"), NULL, 0); + opts = qemu_opts_create(qemu_find_opts("device"), NULL, 0, NULL); qemu_opt_set(opts, "driver", p); return 0; } |