[PATCH 2/5] include/migration: mark vmstate_register() as a legacy function

Alex Bennée posted 5 patches 2 years, 7 months ago
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, Richard Henderson <richard.henderson@linaro.org>, Juan Quintela <quintela@redhat.com>, Peter Xu <peterx@redhat.com>, Leonardo Bras <leobras@redhat.com>
[PATCH 2/5] include/migration: mark vmstate_register() as a legacy function
Posted by Alex Bennée 2 years, 7 months ago
Mention that QOM-ified devices already have support for registering
the description.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 include/migration/vmstate.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index 084f5e784a..35579b2c1f 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -1209,7 +1209,14 @@ int vmstate_register_with_alias_id(VMStateIf *obj, uint32_t instance_id,
                                    int required_for_version,
                                    Error **errp);
 
-/* Returns: 0 on success, -1 on failure */
+/**
+ * vmstate_register() - legacy function to register state serialisation description
+ *
+ * New code shouldn't be using this function as QOM-ified devices have
+ * dc->vmsd to store the serialisation description.
+ *
+ * Returns: 0 on success, -1 on failure
+ */
 static inline int vmstate_register(VMStateIf *obj, int instance_id,
                                    const VMStateDescription *vmsd,
                                    void *opaque)
-- 
2.39.2


Re: [PATCH 2/5] include/migration: mark vmstate_register() as a legacy function
Posted by Juan Quintela 2 years, 7 months ago
Alex Bennée <alex.bennee@linaro.org> wrote:
> Mention that QOM-ified devices already have support for registering
> the description.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

Reviewed-by: Juan Quintela <quintela@redhat.com>

I really remove that function in a future series (well, I substitute it
with vmstate_register_id() and vmstate_register_any(), but the comment
applies to the new versions also).

Later, Juan.
Re: [PATCH 2/5] include/migration: mark vmstate_register() as a legacy function
Posted by Peter Xu 2 years, 7 months ago
On Mon, Jun 19, 2023 at 06:14:34PM +0100, Alex Bennée wrote:
> Mention that QOM-ified devices already have support for registering
> the description.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

Acked-by: Peter Xu <peterx@redhat.com>

-- 
Peter Xu


Re: [PATCH 2/5] include/migration: mark vmstate_register() as a legacy function
Posted by Richard Henderson 2 years, 7 months ago
On 6/19/23 19:14, Alex Bennée wrote:
> Mention that QOM-ified devices already have support for registering
> the description.
> 
> Signed-off-by: Alex Bennée<alex.bennee@linaro.org>
> ---
>   include/migration/vmstate.h | 9 ++++++++-
>   1 file changed, 8 insertions(+), 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~

Re: [PATCH 2/5] include/migration: mark vmstate_register() as a legacy function
Posted by Philippe Mathieu-Daudé 2 years, 7 months ago
On 19/6/23 19:14, Alex Bennée wrote:
> Mention that QOM-ified devices already have support for registering
> the description.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>   include/migration/vmstate.h | 9 ++++++++-
>   1 file changed, 8 insertions(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>