aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2017-03-02 17:39:12 +0000
committerPeter Maydell <peter.maydell@linaro.org>2017-03-02 17:39:12 +0000
commit251501a3714096f807778f6d3f03711dcdb9ce29 (patch)
treefd80eb80a4ea2eb24f07411aa8eb8b294aec4213 /hw
parentc9fc677a35e6e00cdf00c7d085cbd74e0b90b2e6 (diff)
parent665414ad06aa1bc92e615db9641e58fb13d07de1 (diff)
downloadqemu-251501a3714096f807778f6d3f03711dcdb9ce29.zip
qemu-251501a3714096f807778f6d3f03711dcdb9ce29.tar.gz
qemu-251501a3714096f807778f6d3f03711dcdb9ce29.tar.bz2
Merge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20170228a' into staging
Migration pull Note: The 'postcopy: Update userfaultfd.h header' is part of Paolo's header update and will disappear if applied after it. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> # gpg: Signature made Tue 28 Feb 2017 12:38:34 GMT # gpg: using RSA key 0x0516331EBC5BFDE7 # gpg: Good signature from "Dr. David Alan Gilbert (RH2) <dgilbert@redhat.com>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 45F5 C71B 4A0C B7FB 977A 9FA9 0516 331E BC5B FDE7 * remotes/dgilbert/tags/pull-migration-20170228a: (27 commits) postcopy: Add extra check for COPY function postcopy: Add doc about hugepages and postcopy postcopy: Check for userfault+hugepage feature postcopy: Update userfaultfd.h header postcopy: Allow hugepages postcopy: Send whole huge pages postcopy: Mask fault addresses to huge page boundary postcopy: Load huge pages in one go postcopy: Use temporary for placing zero huge pages postcopy: Plumb pagesize down into place helpers postcopy: Record largest page size postcopy: enhance ram_block_discard_range for hugepages exec: ram_block_discard_range postcopy: Chunk discards for hugepages postcopy: Transmit and compare individual page sizes postcopy: Transmit ram size summary word migration: fix use-after-free of to_dst_file migration: Update docs to discourage version bumps migration: fix id leak regression migrate: Introduce a 'dc->vmsd' check to avoid segfault for --only-migratable ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/core/qdev.c7
-rw-r--r--hw/usb/bus.c19
2 files changed, 7 insertions, 19 deletions
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 923e626..1e7fb33 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -37,6 +37,7 @@
#include "hw/boards.h"
#include "hw/sysbus.h"
#include "qapi-event.h"
+#include "migration/migration.h"
int qdev_hotplug = 0;
static bool qdev_hot_added = false;
@@ -903,6 +904,7 @@ static void device_set_realized(Object *obj, bool value, Error **errp)
Error *local_err = NULL;
bool unattached_parent = false;
static int unattached_count;
+ int ret;
if (dev->hotplugged && !dc->hotpluggable) {
error_setg(errp, QERR_DEVICE_NO_HOTPLUG, object_get_typename(obj));
@@ -910,6 +912,11 @@ static void device_set_realized(Object *obj, bool value, Error **errp)
}
if (value && !dev->realized) {
+ ret = check_migratable(obj, &local_err);
+ if (ret < 0) {
+ goto fail;
+ }
+
if (!obj->parent) {
gchar *name = g_strdup_printf("device[%d]", unattached_count++);
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index efe4b8e..24f1608 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -8,7 +8,6 @@
#include "monitor/monitor.h"
#include "trace.h"
#include "qemu/cutils.h"
-#include "migration/migration.h"
static void usb_bus_dev_print(Monitor *mon, DeviceState *qdev, int indent);
@@ -688,8 +687,6 @@ USBDevice *usbdevice_create(const char *cmdline)
const char *params;
int len;
USBDevice *dev;
- ObjectClass *klass;
- DeviceClass *dc;
params = strchr(cmdline,':');
if (params) {
@@ -724,22 +721,6 @@ USBDevice *usbdevice_create(const char *cmdline)
return NULL;
}
- klass = object_class_by_name(f->name);
- if (klass == NULL) {
- error_report("Device '%s' not found", f->name);
- return NULL;
- }
-
- dc = DEVICE_CLASS(klass);
-
- if (only_migratable) {
- if (dc->vmsd->unmigratable) {
- error_report("Device %s is not migratable, but --only-migratable "
- "was specified", f->name);
- return NULL;
- }
- }
-
if (f->usbdevice_init) {
dev = f->usbdevice_init(bus, params);
} else {