qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Juan Quintela <quintela@redhat.com>, qemu-devel@nongnu.org
Cc: "Eric Blake" <eblake@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Corey Minyard" <minyard@acm.org>,
	"Li Zhijian" <lizhijian@fujitsu.com>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Hanna Reitz" <hreitz@redhat.com>, "John Snow" <jsnow@redhat.com>,
	"David Gibson" <david@gibson.dropbear.id.au>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Halil Pasic" <pasic@linux.ibm.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Corey Minyard" <cminyard@mvista.com>,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	"Kevin Wolf" <kwolf@redhat.com>,
	qemu-s390x@nongnu.org, "Cédric Le Goater" <clg@kaod.org>,
	qemu-arm@nongnu.org, libvir-list@redhat.com,
	"Stefan Weil" <sw@weilnetz.de>,
	"Nicholas Piggin" <npiggin@gmail.com>,
	"Daniel Henrique Barboza" <danielhb413@gmail.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Peter Xu" <peterx@redhat.com>,
	"Leonardo Bras" <leobras@redhat.com>,
	"Jason Wang" <jasowang@redhat.com>, "Fam Zheng" <fam@euphon.net>,
	"Christian Borntraeger" <borntraeger@linux.ibm.com>,
	"David Hildenbrand" <david@redhat.com>,
	"Fabiano Rosas" <farosas@suse.de>,
	"Ilya Leoshkevich" <iii@linux.ibm.com>,
	"Harsh Prateek Bora" <harshpb@linux.ibm.com>,
	"Samuel Thibault" <samuel.thibault@ens-lyon.org>,
	"Eric Farman" <farman@linux.ibm.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Stefan Berger" <stefanb@linux.vnet.ibm.com>,
	qemu-ppc@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>,
	qemu-block@nongnu.org
Subject: Re: [PULL 20/39] hw/s390x/s390-stattrib: Simplify handling of the "migration-enabled" property
Date: Thu, 26 Oct 2023 17:37:31 +0200	[thread overview]
Message-ID: <b17732f1-cc45-4c46-bbfc-56268630e7f6@redhat.com> (raw)
In-Reply-To: <20231024131305.87468-21-quintela@redhat.com>

On 24/10/2023 15.12, Juan Quintela wrote:
> From: Thomas Huth <thuth@redhat.com>
> 
> There's no need for dedicated handlers here if they don't do anything
> special.
> 
> Acked-by: David Hildenbrand <david@redhat.com>
> Reviewed-by: Eric Farman <farman@linux.ibm.com>
> Acked-by: Juan Quintela <quintela@redhat.com>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> Message-ID: <20231020150554.664422-3-thuth@redhat.com>
> ---
>   hw/s390x/s390-stattrib.c | 26 ++++++--------------------
>   1 file changed, 6 insertions(+), 20 deletions(-)
> 
> diff --git a/hw/s390x/s390-stattrib.c b/hw/s390x/s390-stattrib.c
> index 220e845d12..52f9fc036e 100644
> --- a/hw/s390x/s390-stattrib.c
> +++ b/hw/s390x/s390-stattrib.c
> @@ -13,6 +13,7 @@
>   #include "qemu/units.h"
>   #include "migration/qemu-file.h"
>   #include "migration/register.h"
> +#include "hw/qdev-properties.h"
>   #include "hw/s390x/storage-attributes.h"
>   #include "qemu/error-report.h"
>   #include "exec/ram_addr.h"
> @@ -340,6 +341,10 @@ static void s390_stattrib_realize(DeviceState *dev, Error **errp)
>       }
>   }
>   
> +static Property s390_stattrib_props[] = {
> +    DEFINE_PROP_BOOL("migration-enabled", S390StAttribState, migration_enabled, true),

This needs a  DEFINE_PROP_END_OF_LIST() here, too ... sorry for that!
/me is looking for his brown paper-bags...

  Thomas

> +};
> +
>   static void s390_stattrib_class_init(ObjectClass *oc, void *data)
>   {
>       DeviceClass *dc = DEVICE_CLASS(oc);
> @@ -347,22 +352,7 @@ static void s390_stattrib_class_init(ObjectClass *oc, void *data)
>       dc->hotpluggable = false;
>       set_bit(DEVICE_CATEGORY_MISC, dc->categories);
>       dc->realize = s390_stattrib_realize;
> -}
> -
> -static inline bool s390_stattrib_get_migration_enabled(Object *obj,
> -                                                       Error **errp)
> -{
> -    S390StAttribState *s = S390_STATTRIB(obj);
> -
> -    return s->migration_enabled;
> -}
> -
> -static inline void s390_stattrib_set_migration_enabled(Object *obj, bool value,
> -                                            Error **errp)
> -{
> -    S390StAttribState *s = S390_STATTRIB(obj);
> -
> -    s->migration_enabled = value;
> +    device_class_set_props(dc, s390_stattrib_props);
>   }
>   
>   static SaveVMHandlers savevm_s390_stattrib_handlers = {
> @@ -383,10 +373,6 @@ static void s390_stattrib_instance_init(Object *obj)
>       register_savevm_live(TYPE_S390_STATTRIB, 0, 0,
>                            &savevm_s390_stattrib_handlers, sas);
>   
> -    object_property_add_bool(obj, "migration-enabled",
> -                             s390_stattrib_get_migration_enabled,
> -                             s390_stattrib_set_migration_enabled);
> -    object_property_set_bool(obj, "migration-enabled", true, NULL);
>       sas->migration_cur_gfn = 0;
>   }
>   



  reply	other threads:[~2023-10-26 15:37 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-24 13:12 [PULL 00/39] Migration 20231024 patches Juan Quintela
2023-10-24 13:12 ` [PULL 01/39] migration/doc: Add contents Juan Quintela
2023-10-24 13:12 ` [PULL 02/39] migration/doc: Add documentation for backwards compatiblity Juan Quintela
2023-10-24 13:12 ` [PULL 03/39] migration/doc: How to migrate when hosts have different features Juan Quintela
2023-10-24 13:12 ` [PULL 04/39] migration/doc: We broke backwards compatibility Juan Quintela
2023-10-24 13:12 ` [PULL 05/39] migration: Receiving a zero page non zero is an error Juan Quintela
2023-10-24 13:12 ` [PULL 06/39] migration: Rename ram_handle_compressed() to ram_handle_zero() Juan Quintela
2023-10-24 13:12 ` [PULL 07/39] migration: Give one error if trying to set MULTIFD and XBZRLE Juan Quintela
2023-10-24 13:12 ` [PULL 08/39] migration: Give one error if trying to set COMPRESSION " Juan Quintela
2023-10-24 13:12 ` [PULL 09/39] migration: Remove save_page_use_compression() Juan Quintela
2023-10-24 13:12 ` [PULL 10/39] migration: Make compress_data_with_multithreads return bool Juan Quintela
2023-10-24 13:12 ` [PULL 11/39] migration: Simplify compress_page_with_multithread() Juan Quintela
2023-10-24 13:12 ` [PULL 12/39] migration: Move busy++ to migrate_with_multithread Juan Quintela
2023-10-24 13:12 ` [PULL 13/39] migration: Create compress_update_rates() Juan Quintela
2023-10-24 13:12 ` [PULL 14/39] migration: Export send_queued_data() Juan Quintela
2023-10-24 13:12 ` [PULL 15/39] migration: Move ram_flush_compressed_data() to ram-compress.c Juan Quintela
2023-10-24 13:12 ` [PULL 16/39] migration: Merge flush_compressed_data() and compress_flush_data() Juan Quintela
2023-10-24 13:12 ` [PULL 17/39] migration: Rename ram_compressed_pages() to compress_ram_pages() Juan Quintela
2023-10-24 13:12 ` [PULL 18/39] hw/ipmi: Don't call vmstate_register() from instance_init() functions Juan Quintela
2023-10-24 13:12 ` [PULL 19/39] hw/s390x/s390-skeys: Don't call register_savevm_live() during instance_init() Juan Quintela
2023-10-26 15:35   ` Thomas Huth
2023-10-24 13:12 ` [PULL 20/39] hw/s390x/s390-stattrib: Simplify handling of the "migration-enabled" property Juan Quintela
2023-10-26 15:37   ` Thomas Huth [this message]
2023-10-24 13:12 ` [PULL 21/39] hw/s390x/s390-stattrib: Don't call register_savevm_live() during instance_init() Juan Quintela
2023-10-24 13:12 ` [PULL 22/39] migration/ram: Fix compilation with -Wshadow=local Juan Quintela
2023-10-24 13:12 ` [PULL 23/39] migration: rename vmstate_save_needed->vmstate_section_needed Juan Quintela
2023-10-24 13:12 ` [PULL 24/39] migration: set file error on subsection loading Juan Quintela
2023-10-24 13:12 ` [PULL 25/39] migration: Create vmstate_register_any() Juan Quintela
2023-10-24 13:12 ` [PULL 26/39] migration: Use vmstate_register_any() Juan Quintela
2023-10-24 13:12 ` [PULL 27/39] migration: Use vmstate_register_any() for isa-ide Juan Quintela
2023-10-24 13:12 ` [PULL 28/39] migration: Use VMSTATE_INSTANCE_ID_ANY for slirp Juan Quintela
2023-10-24 13:12 ` [PULL 29/39] migration: Hack to maintain backwards compatibility for ppc Juan Quintela
2023-10-24 13:12 ` [PULL 30/39] migration: Check in savevm_state_handler_insert for dups Juan Quintela
2023-10-24 13:12 ` [PULL 31/39] migration: Improve example and documentation of vmstate_register() Juan Quintela
2023-10-24 13:12 ` [PULL 32/39] migration: Use vmstate_register_any() for audio Juan Quintela
2023-10-24 13:12 ` [PULL 33/39] migration: Use vmstate_register_any() for eeprom93xx Juan Quintela
2023-10-24 13:13 ` [PULL 34/39] migration: Use vmstate_register_any() for vmware_vga Juan Quintela
2023-10-24 13:13 ` [PULL 35/39] qemu-iotests: Filter warnings about block migration being deprecated Juan Quintela
2023-10-24 13:13 ` [PULL 36/39] migration: migrate 'inc' command option is deprecated Juan Quintela
2023-10-24 13:13 ` [PULL 37/39] migration: migrate 'blk' " Juan Quintela
2023-10-24 13:13 ` [PULL 38/39] migration: Deprecate block migration Juan Quintela
2023-10-24 13:13 ` [PULL 39/39] migration: Deprecate old compression method Juan Quintela
2023-10-26  0:50 ` [PULL 00/39] Migration 20231024 patches Stefan Hajnoczi
2023-10-26 15:25   ` Juan Quintela
2023-10-27  0:41     ` Stefan Hajnoczi

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=b17732f1-cc45-4c46-bbfc-56268630e7f6@redhat.com \
    --to=thuth@redhat.com \
    --cc=armbru@redhat.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=clg@kaod.org \
    --cc=cminyard@mvista.com \
    --cc=danielhb413@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=david@redhat.com \
    --cc=eblake@redhat.com \
    --cc=fam@euphon.net \
    --cc=farman@linux.ibm.com \
    --cc=farosas@suse.de \
    --cc=harshpb@linux.ibm.com \
    --cc=hreitz@redhat.com \
    --cc=iii@linux.ibm.com \
    --cc=jasowang@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=leobras@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=lizhijian@fujitsu.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=minyard@acm.org \
    --cc=mst@redhat.com \
    --cc=npiggin@gmail.com \
    --cc=pasic@linux.ibm.com \
    --cc=peter.maydell@linaro.org \
    --cc=peterx@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=richard.henderson@linaro.org \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=stefanb@linux.vnet.ibm.com \
    --cc=stefanha@redhat.com \
    --cc=sw@weilnetz.de \
    /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).