From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39134) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFLKm-0004Ug-5S for qemu-devel@nongnu.org; Tue, 21 Jun 2016 09:03:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFLKY-0007bS-9D for qemu-devel@nongnu.org; Tue, 21 Jun 2016 09:03:16 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:3979 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFLKY-0007bH-3h for qemu-devel@nongnu.org; Tue, 21 Jun 2016 09:03:02 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u5LCxOdn005764 for ; Tue, 21 Jun 2016 09:03:01 -0400 Received: from e06smtp17.uk.ibm.com (e06smtp17.uk.ibm.com [195.75.94.113]) by mx0b-001b2d01.pphosted.com with ESMTP id 23mywx6nbr-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 21 Jun 2016 09:03:01 -0400 Received: from localhost by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 21 Jun 2016 14:03:00 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 6F6E41B08075 for ; Tue, 21 Jun 2016 14:04:09 +0100 (BST) Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u5LD2vfv23724522 for ; Tue, 21 Jun 2016 13:02:58 GMT Received: from d06av10.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u5LC2xeW017293 for ; Tue, 21 Jun 2016 06:02:59 -0600 From: David Hildenbrand Date: Tue, 21 Jun 2016 15:02:07 +0200 In-Reply-To: <1466514153-85777-1-git-send-email-dahi@linux.vnet.ibm.com> References: <1466514153-85777-1-git-send-email-dahi@linux.vnet.ibm.com> Message-Id: <1466514153-85777-3-git-send-email-dahi@linux.vnet.ibm.com> Subject: [Qemu-devel] [RFC 02/28] s390x/cpumodel: expose CPU class properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: ehabkost@redhat.com, jdenemar@redhat.com, imammedo@redhat.com, cornelia.huck@de.ibm.com, borntraeger@de.ibm.com, fiuczy@linux.vnet.ibm.com, mimu@linux.vnet.ibm.com Let's expose the description and migration safety, as class properties, this can be helpful in the future. Acked-by: Cornelia Huck Signed-off-by: David Hildenbrand --- target-s390x/cpu.c | 1 + target-s390x/cpu.h | 1 + target-s390x/cpu_models.c | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+) diff --git a/target-s390x/cpu.c b/target-s390x/cpu.c index 44e53ec..d7d0b62 100644 --- a/target-s390x/cpu.c +++ b/target-s390x/cpu.c @@ -445,6 +445,7 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data) * object_unref(). */ dc->cannot_destroy_with_object_finalize_yet = true; + s390_cpu_model_class_register_props(oc); } static const TypeInfo s390_cpu_type_info = { diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h index f1cb9a2..832da89 100644 --- a/target-s390x/cpu.h +++ b/target-s390x/cpu.h @@ -632,6 +632,7 @@ extern void subsystem_reset(void); void s390_cpu_list(FILE *f, fprintf_function cpu_fprintf); #define cpu_list s390_cpu_list +void s390_cpu_model_class_register_props(ObjectClass *oc); void s390_realize_cpu_model(CPUState *cs, Error **errp); ObjectClass *s390_cpu_class_by_name(const char *name); diff --git a/target-s390x/cpu_models.c b/target-s390x/cpu_models.c index 08ed640..18638a9 100644 --- a/target-s390x/cpu_models.c +++ b/target-s390x/cpu_models.c @@ -98,6 +98,24 @@ static void s390_cpu_model_finalize(Object *obj) { } +static bool get_migratable(Object *obj, Error **errp) +{ + return S390_CPU_GET_CLASS(obj)->migration_safe; +} + +static char *get_description(Object *obj, Error **errp) +{ + return g_strdup(S390_CPU_GET_CLASS(obj)->desc); +} + +void s390_cpu_model_class_register_props(ObjectClass *oc) +{ + object_class_property_add_bool(oc, "migratable", get_migratable, NULL, + NULL); + object_class_property_add_str(oc, "description", get_description, NULL, + NULL); +} + #ifdef CONFIG_KVM static void s390_host_cpu_model_class_init(ObjectClass *oc, void *data) { -- 2.6.6