提交 1430500b 编写于 作者: P Peter Maydell

Merge remote-tracking branch 'remotes/qmp-unstable/tags/for-upstream' into staging

QMP patches

# gpg: Signature made Thu 23 Oct 2014 16:05:52 BST using RSA key ID E24ED5A7
# gpg: Good signature from "Luiz Capitulino <lcapitulino@gmail.com>"

* remotes/qmp-unstable/tags/for-upstream:
  monitor: delete device_del_bus_completion
  monitor: add del completion for peripheral device
  qdev: add qdev_build_hotpluggable_device_list helper
  MAINTAINERS: add entry for qobject files
  dump: Turn some functions to void to make code cleaner
  dump: Propagate errors into qmp_dump_guest_memory()
  virtio-balloon: Tweak recent fix for integer overflow
Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
......@@ -829,6 +829,12 @@ S: Supported
F: qapi-schema.json
T: git git://repo.or.cz/qemu/qmp-unstable.git queue/qmp
QObject
M: Luiz Capitulino <lcapitulino@redhat.com>
S: Maintained
F: qobject/
T: git git://repo.or.cz/qemu/qmp-unstable.git queue/qmp
QOM
M: Anthony Liguori <aliguori@amazon.com>
M: Andreas Färber <afaerber@suse.de>
......
此差异已折叠。
......@@ -866,6 +866,19 @@ void qdev_alias_all_properties(DeviceState *target, Object *source)
} while (class != object_class_by_name(TYPE_DEVICE));
}
int qdev_build_hotpluggable_device_list(Object *obj, void *opaque)
{
GSList **list = opaque;
DeviceState *dev = DEVICE(obj);
if (dev->realized && object_property_get_bool(obj, "hotpluggable", NULL)) {
*list = g_slist_append(*list, dev);
}
object_child_foreach(obj, qdev_build_hotpluggable_device_list, opaque);
return 0;
}
static bool device_get_realized(Object *obj, Error **errp)
{
DeviceState *dev = DEVICE(obj);
......
......@@ -170,7 +170,7 @@ static void balloon_stats_set_poll_interval(Object *obj, struct Visitor *v,
return;
}
if (value > UINT_MAX) {
if (value > UINT32_MAX) {
error_setg(errp, "timer value is too big");
return;
}
......
......@@ -360,6 +360,8 @@ extern int qdev_hotplug;
char *qdev_get_dev_path(DeviceState *dev);
int qdev_build_hotpluggable_device_list(Object *obj, void *opaque);
void qbus_set_hotplug_handler(BusState *bus, DeviceState *handler,
Error **errp);
......
......@@ -4322,23 +4322,29 @@ void object_add_completion(ReadLineState *rs, int nb_args, const char *str)
g_slist_free(list);
}
static void device_del_bus_completion(ReadLineState *rs, BusState *bus,
const char *str, size_t len)
static void peripheral_device_del_completion(ReadLineState *rs,
const char *str, size_t len)
{
BusChild *kid;
Object *peripheral;
GSList *list = NULL, *item;
QTAILQ_FOREACH(kid, &bus->children, sibling) {
DeviceState *dev = kid->child;
BusState *dev_child;
peripheral = object_resolve_path("/machine/peripheral/", NULL);
if (peripheral == NULL) {
return;
}
object_child_foreach(peripheral, qdev_build_hotpluggable_device_list,
&list);
for (item = list; item; item = g_slist_next(item)) {
DeviceState *dev = item->data;
if (dev->id && !strncmp(str, dev->id, len)) {
readline_add_completion(rs, dev->id);
}
QLIST_FOREACH(dev_child, &dev->child_bus, sibling) {
device_del_bus_completion(rs, dev_child, str, len);
}
}
g_slist_free(list);
}
void chardev_remove_completion(ReadLineState *rs, int nb_args, const char *str)
......@@ -4413,7 +4419,7 @@ void device_del_completion(ReadLineState *rs, int nb_args, const char *str)
len = strlen(str);
readline_set_completion_index(rs, len);
device_del_bus_completion(rs, sysbus_get_default(), str, len);
peripheral_device_del_completion(rs, str, len);
}
void object_del_completion(ReadLineState *rs, int nb_args, const char *str)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册