From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
To: qemu-devel@nongnu.org, ivanren@tencent.com, peterx@redhat.com,
richardw.yang@linux.intel.com, yury-kotov@yandex-team.ru,
quintela@redhat.com
Subject: [Qemu-devel] [PULL 04/12] migration: register_savevm_live doesn't need dev
Date: Thu, 12 Sep 2019 14:49:58 +0100 [thread overview]
Message-ID: <20190912135006.14820-5-dgilbert@redhat.com> (raw)
In-Reply-To: <20190912135006.14820-1-dgilbert@redhat.com>
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Commit 78dd48df3 removed the last caller of register_savevm_live for an
instantiable device (rather than a single system wide device);
so trim out the parameter.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20190822115433.12070-1-dgilbert@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
docs/devel/migration.rst | 3 +--
hw/ppc/spapr.c | 2 +-
hw/s390x/s390-skeys.c | 2 +-
hw/s390x/s390-stattrib.c | 2 +-
hw/s390x/tod.c | 2 +-
include/migration/register.h | 3 +--
migration/block-dirty-bitmap.c | 2 +-
migration/block.c | 2 +-
migration/ram.c | 2 +-
migration/savevm.c | 23 +----------------------
net/slirp.c | 2 +-
11 files changed, 11 insertions(+), 34 deletions(-)
diff --git a/docs/devel/migration.rst b/docs/devel/migration.rst
index f7668ae389..e88918f763 100644
--- a/docs/devel/migration.rst
+++ b/docs/devel/migration.rst
@@ -183,8 +183,7 @@ another to load the state back.
.. code:: c
- int register_savevm_live(DeviceState *dev,
- const char *idstr,
+ int register_savevm_live(const char *idstr,
int instance_id,
int version_id,
SaveVMHandlers *ops,
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 222a325056..08a2a5a770 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -3078,7 +3078,7 @@ static void spapr_machine_init(MachineState *machine)
* interface, this is a legacy from the sPAPREnvironment structure
* which predated MachineState but had a similar function */
vmstate_register(NULL, 0, &vmstate_spapr, spapr);
- register_savevm_live(NULL, "spapr/htab", -1, 1,
+ register_savevm_live("spapr/htab", -1, 1,
&savevm_htab_handlers, spapr);
qbus_set_hotplug_handler(sysbus_get_default(), OBJECT(machine),
diff --git a/hw/s390x/s390-skeys.c b/hw/s390x/s390-skeys.c
index d4807f7777..bd37f39120 100644
--- a/hw/s390x/s390-skeys.c
+++ b/hw/s390x/s390-skeys.c
@@ -389,7 +389,7 @@ static inline void s390_skeys_set_migration_enabled(Object *obj, bool value,
ss->migration_enabled = value;
if (ss->migration_enabled) {
- register_savevm_live(NULL, TYPE_S390_SKEYS, 0, 1,
+ register_savevm_live(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-stattrib.c b/hw/s390x/s390-stattrib.c
index eda5ca3bb6..bf5ac014c4 100644
--- a/hw/s390x/s390-stattrib.c
+++ b/hw/s390x/s390-stattrib.c
@@ -381,7 +381,7 @@ static void s390_stattrib_instance_init(Object *obj)
{
S390StAttribState *sas = S390_STATTRIB(obj);
- register_savevm_live(NULL, TYPE_S390_STATTRIB, 0, 0,
+ register_savevm_live(TYPE_S390_STATTRIB, 0, 0,
&savevm_s390_stattrib_handlers, sas);
object_property_add_bool(obj, "migration-enabled",
diff --git a/hw/s390x/tod.c b/hw/s390x/tod.c
index 1bf0875afa..2499d6f656 100644
--- a/hw/s390x/tod.c
+++ b/hw/s390x/tod.c
@@ -101,7 +101,7 @@ static void s390_tod_realize(DeviceState *dev, Error **errp)
S390TODState *td = S390_TOD(dev);
/* Legacy migration interface */
- register_savevm_live(NULL, "todclock", 0, 1, &savevm_tod, td);
+ register_savevm_live("todclock", 0, 1, &savevm_tod, td);
}
static void s390_tod_class_init(ObjectClass *oc, void *data)
diff --git a/include/migration/register.h b/include/migration/register.h
index 3d0b9833c6..a13359a08d 100644
--- a/include/migration/register.h
+++ b/include/migration/register.h
@@ -68,8 +68,7 @@ typedef struct SaveVMHandlers {
int (*resume_prepare)(MigrationState *s, void *opaque);
} SaveVMHandlers;
-int register_savevm_live(DeviceState *dev,
- const char *idstr,
+int register_savevm_live(const char *idstr,
int instance_id,
int version_id,
const SaveVMHandlers *ops,
diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index dd40724b9e..5121f86d73 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -733,7 +733,7 @@ void dirty_bitmap_mig_init(void)
{
QSIMPLEQ_INIT(&dirty_bitmap_mig_state.dbms_list);
- register_savevm_live(NULL, "dirty-bitmap", 0, 1,
+ register_savevm_live("dirty-bitmap", 0, 1,
&savevm_dirty_bitmap_handlers,
&dirty_bitmap_mig_state);
}
diff --git a/migration/block.c b/migration/block.c
index aa747b55fa..0de9d84198 100644
--- a/migration/block.c
+++ b/migration/block.c
@@ -1030,6 +1030,6 @@ void blk_mig_init(void)
QSIMPLEQ_INIT(&block_mig_state.blk_list);
qemu_mutex_init(&block_mig_state.lock);
- register_savevm_live(NULL, "block", 0, 1, &savevm_block_handlers,
+ register_savevm_live("block", 0, 1, &savevm_block_handlers,
&block_mig_state);
}
diff --git a/migration/ram.c b/migration/ram.c
index 0047286b7e..01df326767 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -4675,5 +4675,5 @@ static SaveVMHandlers savevm_ram_handlers = {
void ram_mig_init(void)
{
qemu_mutex_init(&XBZRLE.lock);
- register_savevm_live(NULL, "ram", 0, 4, &savevm_ram_handlers, &ram_state);
+ register_savevm_live("ram", 0, 4, &savevm_ram_handlers, &ram_state);
}
diff --git a/migration/savevm.c b/migration/savevm.c
index 35426d1db8..3454bc937e 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -684,8 +684,7 @@ static void savevm_state_handler_insert(SaveStateEntry *nse)
of the system, so instance_id should be removed/replaced.
Meanwhile pass -1 as instance_id if you do not already have a clearly
distinguishing id for all instances of your device class. */
-int register_savevm_live(DeviceState *dev,
- const char *idstr,
+int register_savevm_live(const char *idstr,
int instance_id,
int version_id,
const SaveVMHandlers *ops,
@@ -704,26 +703,6 @@ int register_savevm_live(DeviceState *dev,
se->is_ram = 1;
}
- if (dev) {
- char *id = qdev_get_dev_path(dev);
- if (id) {
- if (snprintf(se->idstr, sizeof(se->idstr), "%s/", id) >=
- sizeof(se->idstr)) {
- error_report("Path too long for VMState (%s)", id);
- g_free(id);
- g_free(se);
-
- return -1;
- }
- g_free(id);
-
- se->compat = g_new0(CompatEntry, 1);
- pstrcpy(se->compat->idstr, sizeof(se->compat->idstr), idstr);
- se->compat->instance_id = instance_id == -1 ?
- calculate_compat_instance_id(idstr) : instance_id;
- instance_id = -1;
- }
- }
pstrcat(se->idstr, sizeof(se->idstr), idstr);
if (instance_id == -1) {
diff --git a/net/slirp.c b/net/slirp.c
index b34cb29276..f42f496641 100644
--- a/net/slirp.c
+++ b/net/slirp.c
@@ -576,7 +576,7 @@ static int net_slirp_init(NetClientState *peer, const char *model,
* specific version?
*/
g_assert(slirp_state_version() == 4);
- register_savevm_live(NULL, "slirp", 0, slirp_state_version(),
+ register_savevm_live("slirp", 0, slirp_state_version(),
&savevm_slirp_state, s->slirp);
s->poll_notifier.notify = net_slirp_poll_notify;
--
2.21.0
next prev parent reply other threads:[~2019-09-12 14:22 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-12 13:49 [Qemu-devel] [PULL 00/12] migration queue Dr. David Alan Gilbert (git)
2019-09-12 13:49 ` [Qemu-devel] [PULL 01/12] migration: multifd_send_thread always post p->sem_sync when error happen Dr. David Alan Gilbert (git)
2019-09-12 13:49 ` [Qemu-devel] [PULL 02/12] migration: cleanup check on ops in savevm.handlers iterations Dr. David Alan Gilbert (git)
2019-09-12 13:49 ` [Qemu-devel] [PULL 03/12] hw/net/vmxnet3: Fix leftover unregister_savevm Dr. David Alan Gilbert (git)
2019-09-12 13:49 ` Dr. David Alan Gilbert (git) [this message]
2019-09-12 13:49 ` [Qemu-devel] [PULL 05/12] qemu-file: Rework old qemu_fflush comment Dr. David Alan Gilbert (git)
2019-09-12 13:50 ` [Qemu-devel] [PULL 06/12] migration: Add validate-uuid capability Dr. David Alan Gilbert (git)
2019-09-12 13:50 ` [Qemu-devel] [PULL 07/12] tests/libqtest: Allow setting expected exit status Dr. David Alan Gilbert (git)
2019-09-12 13:50 ` [Qemu-devel] [PULL 08/12] tests/migration: Add a test for validate-uuid capability Dr. David Alan Gilbert (git)
2019-09-12 13:50 ` [Qemu-devel] [PULL 09/12] migration: Fix postcopy bw for recovery Dr. David Alan Gilbert (git)
2019-09-12 13:50 ` [Qemu-devel] [PULL 10/12] migration/qemu-file: remove check on writev_buffer in qemu_put_compression_data Dr. David Alan Gilbert (git)
2019-09-12 13:50 ` [Qemu-devel] [PULL 11/12] migration/qemu-file: fix potential buf waste for extra buf_index adjustment Dr. David Alan Gilbert (git)
2019-09-12 13:50 ` [Qemu-devel] [PULL 12/12] migration: fix one typo in comment of function migration_total_bytes() Dr. David Alan Gilbert (git)
2019-09-13 14:44 ` [Qemu-devel] [PULL 00/12] migration queue Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190912135006.14820-5-dgilbert@redhat.com \
--to=dgilbert@redhat.com \
--cc=ivanren@tencent.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=richardw.yang@linux.intel.com \
--cc=yury-kotov@yandex-team.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).