aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorLaurent Vivier <lvivier@redhat.com>2017-05-24 14:10:48 +0200
committerDavid Gibson <david@gibson.dropbear.id.au>2017-06-06 08:53:24 +1000
commit1b6e74824659ef10bd2a2924a98df388b78e175e (patch)
tree586d5444c2e168b2b5dcd54cde22242b8519db0c /hw
parent199e19ee538eb61fd08b1c1ee5aa838ebdcc968e (diff)
downloadqemu-1b6e74824659ef10bd2a2924a98df388b78e175e.zip
qemu-1b6e74824659ef10bd2a2924a98df388b78e175e.tar.gz
qemu-1b6e74824659ef10bd2a2924a98df388b78e175e.tar.bz2
migration: remove register_savevm()
We can replace the four remaining calls of register_savevm() by calls to register_savevm_live(). So we can remove the function and as we don't allocate anymore the ops pointer with g_new0() we don't have to free it then. Signed-off-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw')
-rw-r--r--hw/net/vmxnet3.c8
-rw-r--r--hw/s390x/s390-skeys.c9
-rw-r--r--hw/s390x/s390-virtio-ccw.c8
3 files changed, 19 insertions, 6 deletions
diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
index 8b1fab2..4df3110 100644
--- a/hw/net/vmxnet3.c
+++ b/hw/net/vmxnet3.c
@@ -2262,6 +2262,11 @@ static const MemoryRegionOps b1_ops = {
},
};
+static SaveVMHandlers savevm_vmxnet3_msix = {
+ .save_state = vmxnet3_msix_save,
+ .load_state = vmxnet3_msix_load,
+};
+
static uint64_t vmxnet3_device_serial_num(VMXNET3State *s)
{
uint64_t dsn_payload;
@@ -2331,8 +2336,7 @@ static void vmxnet3_pci_realize(PCIDevice *pci_dev, Error **errp)
vmxnet3_device_serial_num(s));
}
- register_savevm(dev, "vmxnet3-msix", -1, 1,
- vmxnet3_msix_save, vmxnet3_msix_load, s);
+ register_savevm_live(dev, "vmxnet3-msix", -1, 1, &savevm_vmxnet3_msix, s);
}
static void vmxnet3_instance_init(Object *obj)
diff --git a/hw/s390x/s390-skeys.c b/hw/s390x/s390-skeys.c
index 619152c..35e7f63 100644
--- a/hw/s390x/s390-skeys.c
+++ b/hw/s390x/s390-skeys.c
@@ -362,6 +362,11 @@ static inline bool s390_skeys_get_migration_enabled(Object *obj, Error **errp)
return ss->migration_enabled;
}
+static SaveVMHandlers savevm_s390_storage_keys = {
+ .save_state = s390_storage_keys_save,
+ .load_state = s390_storage_keys_load,
+};
+
static inline void s390_skeys_set_migration_enabled(Object *obj, bool value,
Error **errp)
{
@@ -375,8 +380,8 @@ static inline void s390_skeys_set_migration_enabled(Object *obj, bool value,
ss->migration_enabled = value;
if (ss->migration_enabled) {
- register_savevm(NULL, TYPE_S390_SKEYS, 0, 1, s390_storage_keys_save,
- s390_storage_keys_load, ss);
+ register_savevm_live(NULL, TYPE_S390_SKEYS, 0, 1,
+ &savevm_s390_storage_keys, ss);
} else {
unregister_savevm(DEVICE(ss), TYPE_S390_SKEYS, ss);
}
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index c9021f2..a806345 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -104,6 +104,11 @@ void s390_memory_init(ram_addr_t mem_size)
s390_skeys_init();
}
+static SaveVMHandlers savevm_gtod = {
+ .save_state = gtod_save,
+ .load_state = gtod_load,
+};
+
static void ccw_init(MachineState *machine)
{
int ret;
@@ -151,8 +156,7 @@ static void ccw_init(MachineState *machine)
s390_create_virtio_net(BUS(css_bus), "virtio-net-ccw");
/* Register savevm handler for guest TOD clock */
- register_savevm(NULL, "todclock", 0, 1,
- gtod_save, gtod_load, kvm_state);
+ register_savevm_live(NULL, "todclock", 0, 1, &savevm_gtod, kvm_state);
}
static void s390_cpu_plug(HotplugHandler *hotplug_dev,