From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 2002:a17:906:33ce:b0:9d0:bf65:29fa with SMTP id w14csp321504eja; Thu, 2 Nov 2023 04:44:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFGl8rH6sBPFw08NThF/ItSk7NQT+zwo3wpw9f5Y+PNcKZWfAUAQFzpPXW5RxjHwYsp1cBk X-Received: by 2002:a05:6214:d62:b0:66d:2eab:85ec with SMTP id 2-20020a0562140d6200b0066d2eab85ecmr19865076qvs.61.1698925441844; Thu, 02 Nov 2023 04:44:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698925441; cv=none; d=google.com; s=arc-20160816; b=pVYbjT06InK+iBlUL2rpX9Hb9CKQc+wiNjheWsuORiKjT6/IQ27cOMxOGHV2RQWloI lGE8bkoSOsIFnsPnECJb0UsoeU/VmrTCqLylbw2+GIQI9HjNS+Nfv8vuvvfqitl/SVxk j/huuBrAnZRZnhGoBOcetIgz/kt7ofzA4tD5MXO6QjTfXglr+cABkmrZe871A8utyiW9 Px5axo8c026M2I5N3s6NqkASFblrBiS1iOX9e4vDnOF0RMt2jHjVeIq3U+5iHTlMKi9T fQ/NTuN9zUrpRQNFa5O0svpd3HiX12+UpGfVeUoFru5zkqcmLLC1CE6CGLEZKKq1wBCC bYUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=y8mF9rVrHvm6M9PfPs14+BkvogTEYU7hSnTwfw7rSK8=; fh=T4EM+6jbLn5eRwObk7JR2S+dK3nM2HMDfFhJxfrmv8w=; b=TPoZtp2XN1P7AwGbDJBYgaE89DpkwQWIvtWFk2wG/pBlW/NvvsIqG7PXop8BXAu9oJ 91qdIvpOAXuvwNz/PDMBAf/Wd6Mg+X2UIztZzfi1Nm2kQvTpU4cxdy/fa54ByjlQ+E4o KYZUrrv5TBIwUx1jnDBPEykY5D5lDW3pa1hZckZGUHz9NZh+dc0IPHXRbGpuj28zH1I2 SH5llYm4jeGqnrW52PkDxltefH48UvSknbv6Qs2qjLpeS7+NoGycAso3f9fd6U4A5uxp LvGkeCWDt/6wWykxFtkwz/8fQfAHRBZTXTTuBoQKLjw2vd1q/8l2NfoG+R3HNsDMyicO busw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZAc9g9E5; spf=pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j7-20020ac85f87000000b00419859dfdc6si4438660qta.788.2023.11.02.04.44.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 Nov 2023 04:44:01 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZAc9g9E5; spf=pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qyW4v-0002Co-Cl; Thu, 02 Nov 2023 07:41:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qyW4t-0002B2-Ln for qemu-devel@nongnu.org; Thu, 02 Nov 2023 07:41:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qyW4r-0004AH-MH for qemu-devel@nongnu.org; Thu, 02 Nov 2023 07:41:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698925293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y8mF9rVrHvm6M9PfPs14+BkvogTEYU7hSnTwfw7rSK8=; b=ZAc9g9E5xcoobssLgGTFAJkvEVLiBDi80twkSXpFi3gil1HuyqPBl/+i4Edanyj7/FgCfG rKWLMH6I2Qj6cyawLSGk39EX/0vQeMTKFpZSooPj+Jjp4gSqfOKd6cMXBQIgbTqNd+Wemz bOPXmRyx/v6r62qWQHZ0BzfvjhOfee0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-185-r0XRaucEPxOFPZItCtjJZA-1; Thu, 02 Nov 2023 07:41:28 -0400 X-MC-Unique: r0XRaucEPxOFPZItCtjJZA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BCD62831526; Thu, 2 Nov 2023 11:41:26 +0000 (UTC) Received: from secure.mitica (unknown [10.39.195.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8AFDB2026D4C; Thu, 2 Nov 2023 11:41:19 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Cc: Eric Farman , Laurent Vivier , David Gibson , qemu-block@nongnu.org, Stefan Hajnoczi , Marcel Apfelbaum , Kevin Wolf , David Hildenbrand , Samuel Thibault , qemu-s390x@nongnu.org, Richard Henderson , Leonardo Bras , Corey Minyard , Ilya Leoshkevich , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Markus Armbruster , Christian Borntraeger , Eduardo Habkost , Paolo Bonzini , qemu-ppc@nongnu.org, "Michael S. Tsirkin" , Peter Maydell , Halil Pasic , Gerd Hoffmann , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Li Zhijian , Eric Blake , "Denis V. Lunev" , Hanna Reitz , Fabiano Rosas , Stefan Berger , qemu-arm@nongnu.org, Daniel Henrique Barboza , Thomas Huth , Corey Minyard , John Snow , Jeff Cody , Peter Xu , Nicholas Piggin , Juan Quintela , Harsh Prateek Bora , Jason Wang , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Stefan Weil , Mark Cave-Ayland , Fam Zheng Subject: [PULL 03/40] hw/s390x/s390-stattrib: Simplify handling of the "migration-enabled" property Date: Thu, 2 Nov 2023 12:40:17 +0100 Message-ID: <20231102114054.44360-4-quintela@redhat.com> In-Reply-To: <20231102114054.44360-1-quintela@redhat.com> References: <20231102114054.44360-1-quintela@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 Received-SPF: pass client-ip=170.10.129.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.393, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org Sender: qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org X-TUID: 46hg7Auxc/xl From: Thomas Huth There's no need for dedicated handlers here if they don't do anything special. Acked-by: David Hildenbrand Reviewed-by: Eric Farman Acked-by: Juan Quintela Signed-off-by: Thomas Huth Signed-off-by: Juan Quintela Message-ID: <20231020150554.664422-3-thuth@redhat.com> --- hw/s390x/s390-stattrib.c | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/hw/s390x/s390-stattrib.c b/hw/s390x/s390-stattrib.c index 220e845d12..4f1ab57437 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,11 @@ static void s390_stattrib_realize(DeviceState *dev, Error **errp) } } +static Property s390_stattrib_props[] = { + DEFINE_PROP_BOOL("migration-enabled", S390StAttribState, migration_enabled, true), + DEFINE_PROP_END_OF_LIST(), +}; + static void s390_stattrib_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); @@ -347,22 +353,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 +374,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; } -- 2.41.0