From patchwork Thu Jan 23 13:48:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228232 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=SyyRQjlT; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483Rnw4Frtz9sR1 for ; Fri, 24 Jan 2020 03:00:52 +1100 (AEDT) Received: from localhost ([::1]:59922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iueuY-0005wy-3H for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 11:00:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51138) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucr9-0004fW-4i for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucr7-0002z4-8y for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:11 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:51541) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucr6-0002w9-Pu for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:09 -0500 Received: by mail-wm1-x32c.google.com with SMTP id t23so2641969wmi.1 for ; Thu, 23 Jan 2020 05:49:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vwlRLCLCGC2CIZun7e1zwkFYcuHIPNLiExkIa5Xe/Rk=; b=SyyRQjlTwKWia6hn8LB2VBZpKGgMpo9uSg5nFZP3ZCZcAF+J12ReVcEN1eBiBxUFMW 9eYyAUzmxU4/pHs1WXG+HK6Hq9Add3PHqFfFMuokOpeqTChsmjd1/aCGjithbAvw8R/n yKUnIWGCXQtUyO2ik5xs3otbYbtLQC9KDj5XvotY+uh3Uf72L0EAXCYpzCd623GX1ovF F8Gfw5vfGN74Bk6fLzmyqOQBp7jCI49g6Z9dcnEtPrvp5TSAxVVKnawse377n86iKUAf kMTT6xa0T5TDPZNdLfUMq6Z9MLpGwcoBuixya4tpGiUNwBUebsM4T57hBYskkFoyH6qc ju2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=vwlRLCLCGC2CIZun7e1zwkFYcuHIPNLiExkIa5Xe/Rk=; b=kaaqm62MQC6HsiU2h631u9au2jWuZ7X2p55vKyJF6pcEhiD7Dsr0NBN3tphG9BhtyY nh24aiSIJcnT+N2bYw8OBblwsUQMvww70fKG4brDtYueut4UF/jH6lESaWC2JyD+ypwl 5ffe35QLKXXTq051XL58L3ZYVu/PQL7R75iXazRqL+IAh1JLZa8u2d8I9pA4/z0Ym5Qi vsqEU6Qg9vm8xuDms/AcJMS2qQr97l8+K45xwA+6Yq3JMlqf7XF+YyY8P2OU3hKw5KOB Np/fLqfhV+RLJse0qLxmHkCsPD7xzFhcB1/9Bdgt3kFWeiiohBe6K1WpiLWNc/gwsRe6 tQKw== X-Gm-Message-State: APjAAAUtGg3iIpJ8Q9Kq6t41020jW0DsH8bd9lAAY53SeyxHwaBY6xPU 9KSbj29p6ESqZi0O7cTOCUslBabx X-Google-Smtp-Source: APXvYqyKX2aqlGGjmgzD57D7bFkDg3dWN4X8byHAKy1Qm9T7/nHCk2kOjxWeQfGi51TvroH+FVTRjA== X-Received: by 2002:a7b:cc98:: with SMTP id p24mr4381121wma.139.1579787346691; Thu, 23 Jan 2020 05:49:06 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:06 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 01/59] cpu: Introduce cpu_class_set_parent_reset() Date: Thu, 23 Jan 2020 14:48:04 +0100 Message-Id: <1579787342-27146-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Greg Kurz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Greg Kurz Similarly to what we already do with qdev, use a helper to overload the reset QOM methods of the parent in children classes, for clarity. Signed-off-by: Greg Kurz Reviewed-by: David Gibson Reviewed-by: Alistair Francis Reviewed-by: Cornelia Huck Acked-by: David Hildenbrand Reviewed-by: Philippe Mathieu-Daudé Message-Id: <157650847239.354886.2782881118916307978.stgit@bahia.lan> Signed-off-by: Paolo Bonzini --- hw/core/cpu.c | 8 ++++++++ include/hw/core/cpu.h | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/hw/core/cpu.c b/hw/core/cpu.c index db1a03c..fde5fd3 100644 --- a/hw/core/cpu.c +++ b/hw/core/cpu.c @@ -239,6 +239,14 @@ void cpu_dump_statistics(CPUState *cpu, int flags) } } +void cpu_class_set_parent_reset(CPUClass *cc, + void (*child_reset)(CPUState *cpu), + void (**parent_reset)(CPUState *cpu)) +{ + *parent_reset = cc->reset; + cc->reset = child_reset; +} + void cpu_reset(CPUState *cpu) { CPUClass *klass = CPU_GET_CLASS(cpu); diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 77c6f05..73e9a86 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -1135,6 +1135,10 @@ void cpu_exec_unrealizefn(CPUState *cpu); */ bool target_words_bigendian(void); +void cpu_class_set_parent_reset(CPUClass *cc, + void (*child_reset)(CPUState *cpu), + void (**parent_reset)(CPUState *cpu)); + #ifdef NEED_CPU_H #ifdef CONFIG_SOFTMMU From patchwork Thu Jan 23 13:48:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228236 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=EMgTWerT; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483RtY00DFz9sR1 for ; Fri, 24 Jan 2020 03:04:52 +1100 (AEDT) Received: from localhost ([::1]:59984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iueyQ-0002Wq-FZ for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 11:04:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51151) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucr9-0004gE-L7 for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucr7-0002zf-PN for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:11 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:51544) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucr7-0002y3-5q for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:09 -0500 Received: by mail-wm1-x32f.google.com with SMTP id t23so2642016wmi.1 for ; Thu, 23 Jan 2020 05:49:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=hT0B8c52JW1mUBzht1lXIfl0L1BXOGqWknjA/tnJ2Qo=; b=EMgTWerTnHZw9W4US7EhrjC6Aar/RnGTaoK2p8EtIY9DvHQG2Q750a1NruMaqMge9u dhfC67J65ZCBm/vpUI8jX2ZIPkTADyCK+4BWsq57JQ+NHLU/4bn/NQU9lwK5efPMJOjx RmTNsZ6Fxu5HQVLrRG2ZTpY0hhGEfVe1VlypTrvL/6r5trCz33uhoQMGH/Zd/FiTxVcM vjer9XFpwFwrt3H4dJN0KdZo1/rRA2mKICzG3WDEI2qpHH3TIUnVNYLJ290y0ZgNiohQ XZIey07icLBHMhTxBa7npVAuTC79qQswSgNIYw6v+D6kDgG6ttCPNn1/27cN/dlGn0DK aKWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=hT0B8c52JW1mUBzht1lXIfl0L1BXOGqWknjA/tnJ2Qo=; b=acWdGR7ZBg/kI7v2MfDdEQ7byBOs+HFoaek4/mYgGgsLf7A9GsxvRq1AZlk3E3mAdl iZ0cv6R4hxkehBsVcdlz+4AFPb6qY20Q+E6oap7uyZsfdE+q56+YOWHNqof2Pu47NxTP p+TXXrUCZ13VpZVYiGVNRztz4xFHQFfcVMNXzxk/sACxTUbkIqA+E5sEjnEMdS/zyltD q8a+qXMx524KI/fej2RXxT17M/ZzKa4qKMWlWsVKsusgDKsuhuc45TI+WSBHGdvHH48z br9m7iUYuhecd1O6gFBcDMYU6qanKKcKiVmGtuVZiHVEqiooc4FzRvijLeUiCubJeePg CBag== X-Gm-Message-State: APjAAAW1rVRitYEGsK/34+KI8M6f61g7D9z1JmoF3r7n07gAsZHmiboB I0lLxp3cWAfVMKEsw3woub6UfAkI X-Google-Smtp-Source: APXvYqz6/h7jEvKeSMWF7f/Y9V1ERz020TgsVuI7YGLru0jqYFr6BT5n8WuP/Mjhv3uJa/32CFUxyw== X-Received: by 2002:a05:600c:54c:: with SMTP id k12mr4318681wmc.124.1579787347492; Thu, 23 Jan 2020 05:49:07 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:06 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 02/59] cpu: Use cpu_class_set_parent_reset() Date: Thu, 23 Jan 2020 14:48:05 +0100 Message-Id: <1579787342-27146-3-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32f X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Greg Kurz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Greg Kurz Convert all targets to use cpu_class_set_parent_reset() with the following coccinelle script: @@ type CPUParentClass; CPUParentClass *pcc; CPUClass *cc; identifier parent_fn; identifier child_fn; @@ +cpu_class_set_parent_reset(cc, child_fn, &pcc->parent_fn); -pcc->parent_fn = cc->reset; ... -cc->reset = child_fn; Signed-off-by: Greg Kurz Acked-by: David Gibson Reviewed-by: Alistair Francis Reviewed-by: Cornelia Huck Acked-by: David Hildenbrand Message-Id: <157650847817.354886.7047137349018460524.stgit@bahia.lan> Signed-off-by: Paolo Bonzini --- target/arm/cpu.c | 3 +-- target/cris/cpu.c | 3 +-- target/i386/cpu.c | 3 +-- target/lm32/cpu.c | 3 +-- target/m68k/cpu.c | 3 +-- target/microblaze/cpu.c | 3 +-- target/mips/cpu.c | 3 +-- target/moxie/cpu.c | 3 +-- target/nios2/cpu.c | 3 +-- target/openrisc/cpu.c | 3 +-- target/ppc/translate_init.inc.c | 3 +-- target/riscv/cpu.c | 3 +-- target/s390x/cpu.c | 3 +-- target/sh4/cpu.c | 3 +-- target/sparc/cpu.c | 3 +-- target/tilegx/cpu.c | 3 +-- target/tricore/cpu.c | 3 +-- target/xtensa/cpu.c | 3 +-- 18 files changed, 18 insertions(+), 36 deletions(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index d62fd5f..411faaa 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2707,8 +2707,7 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) &acc->parent_realize); dc->props = arm_cpu_properties; - acc->parent_reset = cc->reset; - cc->reset = arm_cpu_reset; + cpu_class_set_parent_reset(cc, arm_cpu_reset, &acc->parent_reset); cc->class_by_name = arm_cpu_class_by_name; cc->has_work = arm_cpu_has_work; diff --git a/target/cris/cpu.c b/target/cris/cpu.c index 6a857f5..17c6712 100644 --- a/target/cris/cpu.c +++ b/target/cris/cpu.c @@ -264,8 +264,7 @@ static void cris_cpu_class_init(ObjectClass *oc, void *data) device_class_set_parent_realize(dc, cris_cpu_realizefn, &ccc->parent_realize); - ccc->parent_reset = cc->reset; - cc->reset = cris_cpu_reset; + cpu_class_set_parent_reset(cc, cris_cpu_reset, &ccc->parent_reset); cc->class_by_name = cris_cpu_class_by_name; cc->has_work = cris_cpu_has_work; diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 41f28ce..78bdb7c 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -7149,8 +7149,7 @@ static void x86_cpu_common_class_init(ObjectClass *oc, void *data) &xcc->parent_unrealize); dc->props = x86_cpu_properties; - xcc->parent_reset = cc->reset; - cc->reset = x86_cpu_reset; + cpu_class_set_parent_reset(cc, x86_cpu_reset, &xcc->parent_reset); cc->reset_dump_flags = CPU_DUMP_FPU | CPU_DUMP_CCOP; cc->class_by_name = x86_cpu_class_by_name; diff --git a/target/lm32/cpu.c b/target/lm32/cpu.c index b35537d..687bf35 100644 --- a/target/lm32/cpu.c +++ b/target/lm32/cpu.c @@ -218,8 +218,7 @@ static void lm32_cpu_class_init(ObjectClass *oc, void *data) device_class_set_parent_realize(dc, lm32_cpu_realizefn, &lcc->parent_realize); - lcc->parent_reset = cc->reset; - cc->reset = lm32_cpu_reset; + cpu_class_set_parent_reset(cc, lm32_cpu_reset, &lcc->parent_reset); cc->class_by_name = lm32_cpu_class_by_name; cc->has_work = lm32_cpu_has_work; diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index f276335..f0653cd 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -273,8 +273,7 @@ static void m68k_cpu_class_init(ObjectClass *c, void *data) device_class_set_parent_realize(dc, m68k_cpu_realizefn, &mcc->parent_realize); - mcc->parent_reset = cc->reset; - cc->reset = m68k_cpu_reset; + cpu_class_set_parent_reset(cc, m68k_cpu_reset, &mcc->parent_reset); cc->class_by_name = m68k_cpu_class_by_name; cc->has_work = m68k_cpu_has_work; diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 9cfd744..71d88f6 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -292,8 +292,7 @@ static void mb_cpu_class_init(ObjectClass *oc, void *data) device_class_set_parent_realize(dc, mb_cpu_realizefn, &mcc->parent_realize); - mcc->parent_reset = cc->reset; - cc->reset = mb_cpu_reset; + cpu_class_set_parent_reset(cc, mb_cpu_reset, &mcc->parent_reset); cc->class_by_name = mb_cpu_class_by_name; cc->has_work = mb_cpu_has_work; diff --git a/target/mips/cpu.c b/target/mips/cpu.c index bbcf7ca..6cd6b96 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -189,8 +189,7 @@ static void mips_cpu_class_init(ObjectClass *c, void *data) device_class_set_parent_realize(dc, mips_cpu_realizefn, &mcc->parent_realize); - mcc->parent_reset = cc->reset; - cc->reset = mips_cpu_reset; + cpu_class_set_parent_reset(cc, mips_cpu_reset, &mcc->parent_reset); cc->class_by_name = mips_cpu_class_by_name; cc->has_work = mips_cpu_has_work; diff --git a/target/moxie/cpu.c b/target/moxie/cpu.c index 48996d0..cf47bc7 100644 --- a/target/moxie/cpu.c +++ b/target/moxie/cpu.c @@ -101,8 +101,7 @@ static void moxie_cpu_class_init(ObjectClass *oc, void *data) device_class_set_parent_realize(dc, moxie_cpu_realizefn, &mcc->parent_realize); - mcc->parent_reset = cc->reset; - cc->reset = moxie_cpu_reset; + cpu_class_set_parent_reset(cc, moxie_cpu_reset, &mcc->parent_reset); cc->class_by_name = moxie_cpu_class_by_name; diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c index ca9c7a6..bbdbc0c 100644 --- a/target/nios2/cpu.c +++ b/target/nios2/cpu.c @@ -188,8 +188,7 @@ static void nios2_cpu_class_init(ObjectClass *oc, void *data) device_class_set_parent_realize(dc, nios2_cpu_realizefn, &ncc->parent_realize); dc->props = nios2_properties; - ncc->parent_reset = cc->reset; - cc->reset = nios2_cpu_reset; + cpu_class_set_parent_reset(cc, nios2_cpu_reset, &ncc->parent_reset); cc->class_by_name = nios2_cpu_class_by_name; cc->has_work = nios2_cpu_has_work; diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c index 506aec6..5cd04da 100644 --- a/target/openrisc/cpu.c +++ b/target/openrisc/cpu.c @@ -150,8 +150,7 @@ static void openrisc_cpu_class_init(ObjectClass *oc, void *data) device_class_set_parent_realize(dc, openrisc_cpu_realizefn, &occ->parent_realize); - occ->parent_reset = cc->reset; - cc->reset = openrisc_cpu_reset; + cpu_class_set_parent_reset(cc, openrisc_cpu_reset, &occ->parent_reset); cc->class_by_name = openrisc_cpu_class_by_name; cc->has_work = openrisc_cpu_has_work; diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.inc.c index d33d65d..5ffd07c 100644 --- a/target/ppc/translate_init.inc.c +++ b/target/ppc/translate_init.inc.c @@ -10873,8 +10873,7 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data) pcc->interrupts_big_endian = ppc_cpu_interrupts_big_endian_always; dc->props = ppc_cpu_properties; - pcc->parent_reset = cc->reset; - cc->reset = ppc_cpu_reset; + cpu_class_set_parent_reset(cc, ppc_cpu_reset, &pcc->parent_reset); cc->class_by_name = ppc_cpu_class_by_name; pcc->parent_parse_features = cc->parse_features; diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index d37861a..d6f1872 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -462,8 +462,7 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data) device_class_set_parent_realize(dc, riscv_cpu_realize, &mcc->parent_realize); - mcc->parent_reset = cc->reset; - cc->reset = riscv_cpu_reset; + cpu_class_set_parent_reset(cc, riscv_cpu_reset, &mcc->parent_reset); cc->class_by_name = riscv_cpu_class_by_name; cc->has_work = riscv_cpu_has_work; diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 625daee..ca487f5 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -456,12 +456,11 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data) dc->props = s390x_cpu_properties; dc->user_creatable = true; - scc->parent_reset = cc->reset; + cpu_class_set_parent_reset(cc, s390_cpu_reset_full, &scc->parent_reset); #if !defined(CONFIG_USER_ONLY) scc->load_normal = s390_cpu_load_normal; #endif scc->reset = s390_cpu_reset; - cc->reset = s390_cpu_reset_full; cc->class_by_name = s390_cpu_class_by_name, cc->has_work = s390_cpu_has_work; #ifdef CONFIG_TCG diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index d0a7707..70c8d81 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -214,8 +214,7 @@ static void superh_cpu_class_init(ObjectClass *oc, void *data) device_class_set_parent_realize(dc, superh_cpu_realizefn, &scc->parent_realize); - scc->parent_reset = cc->reset; - cc->reset = superh_cpu_reset; + cpu_class_set_parent_reset(cc, superh_cpu_reset, &scc->parent_reset); cc->class_by_name = superh_cpu_class_by_name; cc->has_work = superh_cpu_has_work; diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index bc65929..9c306e5 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -859,8 +859,7 @@ static void sparc_cpu_class_init(ObjectClass *oc, void *data) &scc->parent_realize); dc->props = sparc_cpu_properties; - scc->parent_reset = cc->reset; - cc->reset = sparc_cpu_reset; + cpu_class_set_parent_reset(cc, sparc_cpu_reset, &scc->parent_reset); cc->class_by_name = sparc_cpu_class_by_name; cc->parse_features = sparc_cpu_parse_features; diff --git a/target/tilegx/cpu.c b/target/tilegx/cpu.c index 2b2a7cc..cd422a0 100644 --- a/target/tilegx/cpu.c +++ b/target/tilegx/cpu.c @@ -142,8 +142,7 @@ static void tilegx_cpu_class_init(ObjectClass *oc, void *data) device_class_set_parent_realize(dc, tilegx_cpu_realizefn, &tcc->parent_realize); - tcc->parent_reset = cc->reset; - cc->reset = tilegx_cpu_reset; + cpu_class_set_parent_reset(cc, tilegx_cpu_reset, &tcc->parent_reset); cc->class_by_name = tilegx_cpu_class_by_name; cc->has_work = tilegx_cpu_has_work; diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c index df807c1..85bc9f0 100644 --- a/target/tricore/cpu.c +++ b/target/tricore/cpu.c @@ -153,8 +153,7 @@ static void tricore_cpu_class_init(ObjectClass *c, void *data) device_class_set_parent_realize(dc, tricore_cpu_realizefn, &mcc->parent_realize); - mcc->parent_reset = cc->reset; - cc->reset = tricore_cpu_reset; + cpu_class_set_parent_reset(cc, tricore_cpu_reset, &mcc->parent_reset); cc->class_by_name = tricore_cpu_class_by_name; cc->has_work = tricore_cpu_has_work; diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index c65dcf9..4856aee 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -184,8 +184,7 @@ static void xtensa_cpu_class_init(ObjectClass *oc, void *data) device_class_set_parent_realize(dc, xtensa_cpu_realizefn, &xcc->parent_realize); - xcc->parent_reset = cc->reset; - cc->reset = xtensa_cpu_reset; + cpu_class_set_parent_reset(cc, xtensa_cpu_reset, &xcc->parent_reset); cc->class_by_name = xtensa_cpu_class_by_name; cc->has_work = xtensa_cpu_has_work; From patchwork Thu Jan 23 13:48:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228195 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=oPJy3guX; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483Rd74tJzz9sPW for ; Fri, 24 Jan 2020 02:53:15 +1100 (AEDT) Received: from localhost ([::1]:59810 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuenB-0003cr-8C for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:53:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51163) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrA-0004gh-5R for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucr9-00030k-4R for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:12 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:33949) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucr7-0002yp-Ox for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:11 -0500 Received: by mail-wm1-x336.google.com with SMTP id s144so1922732wme.1 for ; Thu, 23 Jan 2020 05:49:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=iersXa6LYLpYQZtE6C4xTYe9qeAHp3QZ3EqBuEU1RLI=; b=oPJy3guXU0WXAv2qCnJgOpi23y0ly2qrhOAcIPnAcwA84d6Dhik/3XMuRgKNcfZKQL ZjapA2D5EotzxDBilyRCeFa/tE2WT5ilXj0AjfjHEiEUEw2T47Un4BXjIGAOZLbbUoJD Qd8xMviylmmaekXd1Ub3et9KicDNiA936/5tdEl7b+12fhhtlZmF1gOx3yOiY3ZVQQf7 lC3IK2aasqmgRn0cFgeN4GeZMsobbqntaH8lde5tnYzURWKj2NPKJxFeuBIQ0YjCcFcW wQ7dxa0jmWWSr6TujJn8lJrAfdr2JA1e86kRzVJUhcHEMUqkJGlqmqC81NqRP7afomum bzMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=iersXa6LYLpYQZtE6C4xTYe9qeAHp3QZ3EqBuEU1RLI=; b=BcqDxIevJ03HmYFfBzGNXjE9AcGgr8kEUfLP9nqtzlXfn9cO5xlQERaazsir4QjxSk /UHU7iQFjv+V0uwCNUmTg8fUk9CtLstQU3UWFqq7Ld5q2/pBfL1LfnS3fF8iRVqogEEZ 93tz/JMaW7OJ3hu6/G4G3upZeZJ2Ub6sS4myWB8aueiU+jIrKFHvuSPZCmWA8VF/+j6y IIvq9mnzXedViq/2GpnEIUBDxAFQlm33Txje9itDX84BjCqQEFYQNFQrpCbtD2fJn9uy nb7d9dhuofL+CP1Hp5/9Wgt7SAeOarvPaEfjghms5vot1hpvhUSKfDaPvQwKY7im12My 5c9A== X-Gm-Message-State: APjAAAWiNt+g1JknzlkPbcV1+qHk5EUvrc8ObJ1cYMLumvhad4lir37M +hGXd6/9csWzkpwUMIe9j7NO71Ea X-Google-Smtp-Source: APXvYqxsG8z3lwWetDOD0OrOIj4v5yV/2y8g3hh1v8V0kJGpqETJ4tZaQ+av6ErsPpcINeAvXCqx2A== X-Received: by 2002:a05:600c:22d3:: with SMTP id 19mr4318632wmg.20.1579787348419; Thu, 23 Jan 2020 05:49:08 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:07 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 03/59] pvpanic: introduce crashloaded for pvpanic Date: Thu, 23 Jan 2020 14:48:06 +0100 Message-Id: <1579787342-27146-4-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::336 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: zhenwei pi Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: zhenwei pi Add bit 1 for pvpanic. This bit means that guest hits a panic, but guest wants to handle error by itself. Typical case: Linux guest runs kdump in panic. It will help us to separate the abnormal reboot from normal operation. Signed-off-by: zhenwei pi Message-Id: <20200114023102.612548-2-pizhenwei@bytedance.com> Signed-off-by: Paolo Bonzini --- docs/specs/pvpanic.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/specs/pvpanic.txt b/docs/specs/pvpanic.txt index c7bbacc..bdea68a 100644 --- a/docs/specs/pvpanic.txt +++ b/docs/specs/pvpanic.txt @@ -16,8 +16,12 @@ pvpanic exposes a single I/O port, by default 0x505. On read, the bits recognized by the device are set. Software should ignore bits it doesn't recognize. On write, the bits not recognized by the device are ignored. Software should set only bits both itself and the device recognize. -Currently, only bit 0 is recognized, setting it indicates a guest panic -has happened. + +Bit Definition +-------------- +bit 0: setting it indicates a guest panic has happened. +bit 1: named crashloaded. setting it indicates a guest panic and run + kexec to handle error by guest itself. ACPI Interface -------------- From patchwork Thu Jan 23 13:49:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228190 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=bDhr1awJ; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483RZK64lkz9sSH for ; Fri, 24 Jan 2020 02:50:49 +1100 (AEDT) Received: from localhost ([::1]:59752 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuekp-00084e-6r for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:50:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52219) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuct0-0007bI-Ul for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:51:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucsz-0006l3-C8 for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:51:06 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:39425 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iucsz-0006kU-96 for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:51:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579787464; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PPTdeRCRi0tlQK/tEkcE+Riv/JlR1YXbPbZK0rsXdY8=; b=bDhr1awJPimTT1n1+GEdelFPrCuUp+zddrAyRS8BXG1AB/E5bDwE3SpVqvB5XRbY38WsKA CbWs46+Ivya2KcRdBOpZ2ZPnHgwHu3yJieONhVNRtOrkxsZgq3kdoTibhlaF/hV7fN7MXm J7gvCeBBzTuXEURQdzYPC8Kha6IdGug= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-388-tVaR__ASNOS7g1nPAed_2Q-1; Thu, 23 Jan 2020 08:51:00 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CADA08010DA; Thu, 23 Jan 2020 13:50:59 +0000 (UTC) Received: from 640k.localdomain.com (unknown [10.36.112.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id C792A1CB; Thu, 23 Jan 2020 13:50:58 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 04/59] pvpanic: implement crashloaded event handling Date: Thu, 23 Jan 2020 14:49:54 +0100 Message-Id: <1579787449-27599-5-git-send-email-pbonzini@redhat.com> In-Reply-To: <1579787449-27599-1-git-send-email-pbonzini@redhat.com> References: <1579787449-27599-1-git-send-email-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: tVaR__ASNOS7g1nPAed_2Q-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: zhenwei pi Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: zhenwei pi Handle bit 1 write, then post event to monitor. Suggested by Paolo, declear a new event, using GUEST_PANICKED could cause upper layers to react by shutting down or rebooting the guest. In advance for extention, add GuestPanicInformation in event message. Signed-off-by: zhenwei pi Message-Id: <20200114023102.612548-3-pizhenwei@bytedance.com> Signed-off-by: Paolo Bonzini --- docs/specs/pvpanic.txt | 16 ++++++++-------- hw/misc/pvpanic.c | 11 +++++++++-- include/sysemu/runstate.h | 1 + qapi/run-state.json | 24 ++++++++++++++++++++++-- vl.c | 12 ++++++++++++ 5 files changed, 52 insertions(+), 12 deletions(-) diff --git a/docs/specs/pvpanic.txt b/docs/specs/pvpanic.txt index bdea68a..a90fbca 100644 --- a/docs/specs/pvpanic.txt +++ b/docs/specs/pvpanic.txt @@ -19,9 +19,10 @@ Software should set only bits both itself and the device recognize. Bit Definition -------------- -bit 0: setting it indicates a guest panic has happened. -bit 1: named crashloaded. setting it indicates a guest panic and run - kexec to handle error by guest itself. +bit 0: a guest panic has happened and should be processed by the host +bit 1: a guest panic has happened and will be handled by the guest; + the host should record it or report it, but should not affect + the execution of the guest. ACPI Interface -------------- @@ -30,13 +31,12 @@ pvpanic device is defined with ACPI ID "QEMU0001". Custom methods: RDPT: To determine whether guest panic notification is supported. Arguments: None -Return: Returns a byte, bit 0 set to indicate guest panic - notification is supported. Other bits are reserved and - should be ignored. +Return: Returns a byte, with the same semantics as the I/O port + interface. WRPT: To send a guest panic event -Arguments: Arg0 is a byte, with bit 0 set to indicate guest panic has - happened. Other bits are reserved and should be cleared. +Arguments: Arg0 is a byte to be written, with the same semantics as + the I/O interface. Return: None The ACPI device will automatically refer to the right port in case it diff --git a/hw/misc/pvpanic.c b/hw/misc/pvpanic.c index d65ac86..4ebda78 100644 --- a/hw/misc/pvpanic.c +++ b/hw/misc/pvpanic.c @@ -21,11 +21,13 @@ #include "hw/qdev-properties.h" #include "hw/misc/pvpanic.h" -/* The bit of supported pv event */ +/* The bit of supported pv event, TODO: include uapi header and remove this */ #define PVPANIC_F_PANICKED 0 +#define PVPANIC_F_CRASHLOADED 1 /* The pv event value */ #define PVPANIC_PANICKED (1 << PVPANIC_F_PANICKED) +#define PVPANIC_CRASHLOADED (1 << PVPANIC_F_CRASHLOADED) #define ISA_PVPANIC_DEVICE(obj) \ OBJECT_CHECK(PVPanicState, (obj), TYPE_PVPANIC) @@ -34,7 +36,7 @@ static void handle_event(int event) { static bool logged; - if (event & ~PVPANIC_PANICKED && !logged) { + if (event & ~(PVPANIC_PANICKED | PVPANIC_CRASHLOADED) && !logged) { qemu_log_mask(LOG_GUEST_ERROR, "pvpanic: unknown event %#x.\n", event); logged = true; } @@ -43,6 +45,11 @@ static void handle_event(int event) qemu_system_guest_panicked(NULL); return; } + + if (event & PVPANIC_CRASHLOADED) { + qemu_system_guest_crashloaded(NULL); + return; + } } #include "hw/isa/isa.h" diff --git a/include/sysemu/runstate.h b/include/sysemu/runstate.h index 0b41555..f760094 100644 --- a/include/sysemu/runstate.h +++ b/include/sysemu/runstate.h @@ -63,6 +63,7 @@ ShutdownCause qemu_reset_requested_get(void); void qemu_system_killed(int signal, pid_t pid); void qemu_system_reset(ShutdownCause reason); void qemu_system_guest_panicked(GuestPanicInformation *info); +void qemu_system_guest_crashloaded(GuestPanicInformation *info); #endif diff --git a/qapi/run-state.json b/qapi/run-state.json index d7477cd..b83a436 100644 --- a/qapi/run-state.json +++ b/qapi/run-state.json @@ -357,16 +357,36 @@ 'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } } ## +# @GUEST_CRASHLOADED: +# +# Emitted when guest OS crash loaded is detected +# +# @action: action that has been taken, currently always "run" +# +# @info: information about a panic +# +# Since: 5.0 +# +# Example: +# +# <- { "event": "GUEST_CRASHLOADED", +# "data": { "action": "run" } } +# +## +{ 'event': 'GUEST_CRASHLOADED', + 'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } } + +## # @GuestPanicAction: # # An enumeration of the actions taken when guest OS panic is detected # # @pause: system pauses # -# Since: 2.1 (poweroff since 2.8) +# Since: 2.1 (poweroff since 2.8, run since 5.0) ## { 'enum': 'GuestPanicAction', - 'data': [ 'pause', 'poweroff' ] } + 'data': [ 'pause', 'poweroff', 'run' ] } ## # @GuestPanicInformationType: diff --git a/vl.c b/vl.c index 71d3e7e..9f5f477 100644 --- a/vl.c +++ b/vl.c @@ -1468,6 +1468,18 @@ void qemu_system_guest_panicked(GuestPanicInformation *info) } } +void qemu_system_guest_crashloaded(GuestPanicInformation *info) +{ + qemu_log_mask(LOG_GUEST_ERROR, "Guest crash loaded"); + + qapi_event_send_guest_crashloaded(GUEST_PANIC_ACTION_RUN, + !!info, info); + + if (info) { + qapi_free_GuestPanicInformation(info); + } +} + void qemu_system_reset_request(ShutdownCause reason) { if (no_reboot && reason != SHUTDOWN_CAUSE_SUBSYSTEM_RESET) { From patchwork Thu Jan 23 13:48:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228198 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=AOZ947dU; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483RgX5Thdz9sPW for ; Fri, 24 Jan 2020 02:55:19 +1100 (AEDT) Received: from localhost ([::1]:59832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuepA-0006gU-6W for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:55:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51204) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrB-0004j9-VV for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrA-00032S-J8 for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:13 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:54625) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrA-00030J-CG for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:12 -0500 Received: by mail-wm1-x333.google.com with SMTP id b19so2627771wmj.4 for ; Thu, 23 Jan 2020 05:49:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OucTBWXsjhFgmzRgCBoTRR2Qk1l2bk/1eGxf/v19814=; b=AOZ947dUpJUNt0ImnYdsmIR4oHJvg92uJIlY1faGeMPxXs+Hx2cyJ3CToMPPPjzsW1 lYZrVvVhz05kC0EQoBcIi0TF6gok7QlvI3sHlc/5DlPUpR0Mz+lhA+bkVmihca5AytMh drOQhUvpKr7hYX7lcmezLFM1iha4rjTFzI9lEoiJppR0bpqUTwmZa/s6Edyd7faKOOy6 HWK0Xj/wN/TouNedBpGXexZCkkErZx+uU1hj6/i87XrMYaKK+lG6LUTcTgrUj3E09BJH KKhUajG8a2+fW7HKyauwjhOrfRmvy6WK5vNP1ttJPzQ+TrzvMglHjV768QZAgSpwEbEJ +M9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=OucTBWXsjhFgmzRgCBoTRR2Qk1l2bk/1eGxf/v19814=; b=d4zoNobUAV0tC5hxDc+H3PTrErmQ2Qnc46L316oTVXwq78reXWUz2OgSxDVYxT+Tfc gnpfTE2wm6nmbw6EOhHqSddyY0Qh+Xc15yQtW/0NuHO8pSQiG4rZmo1QBZXXv7bRElkd zF3UGDt0KlOiVZlGDpzX+AjG/GByzm0y5PCMPwp4JYSTJwzPD0F6Oqm5BqejniSeVe4/ FQFiZHDPA5yZSP6fuXcJ6AoNgZqrIJuJ5ZcZgL4GcZmhtf+yP7OuRcYu18v6nTG95Lcc GUTixEI6G3q/SBs8iAcFa1r8hmc0XYo108BsRz95HMUOuCYm7uMuSRFZ9PqOxA+PRGqH 6XrQ== X-Gm-Message-State: APjAAAW/KLNpwFWJBj0ZkmGRmRfea/qIbO4aohT0qYIZWHYN15PXSgNW 0g/mzA0gF0TDxZv6bn31iHDnHsWc X-Google-Smtp-Source: APXvYqz1cnMMVijYti84UU33HGEpmLm5QjRJP43b/T9vyB/nVZ6uKvJDrKpKUUkBOESfSpM3H4AS8w== X-Received: by 2002:a1c:6485:: with SMTP id y127mr4445066wmb.11.1579787350100; Thu, 23 Jan 2020 05:49:10 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:09 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 05/59] qom/object: Display more helpful message when an interface is missing Date: Thu, 23 Jan 2020 14:48:08 +0100 Message-Id: <1579787342-27146-6-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::333 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé When adding new devices implementing QOM interfaces, we might forgot to add the Kconfig dependency that pulls the required objects in when building. Since QOM dependencies are resolved at runtime, we don't get any link-time failures, and QEMU aborts while starting: $ qemu ... Segmentation fault (core dumped) (gdb) bt #0 0x00007ff6e96b1e35 in raise () from /lib64/libc.so.6 #1 0x00007ff6e969c895 in abort () from /lib64/libc.so.6 #2 0x00005572bc5051cf in type_initialize (ti=0x5572be6f1200) at qom/object.c:323 #3 0x00005572bc505074 in type_initialize (ti=0x5572be6f1800) at qom/object.c:301 #4 0x00005572bc505074 in type_initialize (ti=0x5572be6e48e0) at qom/object.c:301 #5 0x00005572bc506939 in object_class_by_name (typename=0x5572bc56109a) at qom/object.c:959 #6 0x00005572bc503dd5 in cpu_class_by_name (typename=0x5572bc56109a, cpu_model=0x5572be6d9930) at hw/core/cpu.c:286 Since the caller has access to the qdev parent/interface names, we can simply display them to avoid starting a debugger: $ qemu ... qemu: missing interface 'fancy-if' for object 'fancy-dev' Aborted (core dumped) This commit is similar to e02bdf1cecd2 ("Display more helpful message when an object type is missing"). Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20200118162348.17823-1-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- qom/object.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qom/object.c b/qom/object.c index 0d971ca..36123fb 100644 --- a/qom/object.c +++ b/qom/object.c @@ -317,6 +317,11 @@ static void type_initialize(TypeImpl *ti) for (i = 0; i < ti->num_interfaces; i++) { TypeImpl *t = type_get_by_name(ti->interfaces[i].typename); + if (!t) { + error_report("missing interface '%s' for object '%s'", + ti->interfaces[i].typename, parent->name); + abort(); + } for (e = ti->class->interfaces; e; e = e->next) { TypeImpl *target_type = OBJECT_CLASS(e->data)->type; From patchwork Thu Jan 23 13:48:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228173 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=PcD1MV1f; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483RH651m8z9sPW for ; Fri, 24 Jan 2020 02:37:38 +1100 (AEDT) Received: from localhost ([::1]:59576 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iueY4-0007KG-9f for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:37:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51222) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrC-0004k3-Lh for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrA-00032j-L4 for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:14 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:52975) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrA-00031K-EV for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:12 -0500 Received: by mail-wm1-x32a.google.com with SMTP id p9so2644038wmc.2 for ; Thu, 23 Jan 2020 05:49:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gl7eWmA7CA9XKm3RFgregvJlE8LU8fI3r6RyQ6MZ0c0=; b=PcD1MV1fsFXokrsvY7vAKB2jiAGEru343pJDBzGqPZLOpuKsYuYbBf4V8oze8KzU9P owaXjKVf9sEX1ap/k/DLD+FTfhLbLVgxfZeiE1xGOs5Va3j2oE8bNJ55CatZL8MJD2yG VexI0WFmT260AtxLcoK+u/10rADHiS4XVUpREsc9psUQuSJn2NfJrJKRHnEDvUeiqegQ 7c4LTmg1cwUv7Rq0nsVKEybAigs1wgeEzWOusSfvH/Tv9rwHhjQntn8yUfK9R96dx6Kt NoXoExhXzjAL/7Vr+AVAf2pwTjOS0WJVZqngW/tE3U2yZdkXaxLl5q8z0Qw8DssqACEA ErNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=gl7eWmA7CA9XKm3RFgregvJlE8LU8fI3r6RyQ6MZ0c0=; b=nLatFqlRHQxym8i1uWLWcZ1MDdpx0/UECuU/RbNuEi+XPZc4vBLcZUnxbAs73nsJVj lwaMjPlF58P0oRjvDjK58l3bW4rqq9ZL3At8siPrj8AmtQXOT4Z1E1jsXeZu7YtCakUI j4b3w6QGKZ3w4lGN+I70oI47PNqBFtbbFSbPa+nVGL2mWAhRwfEVwPzErWZc10ky95Ab EbCpyLpM4+dKplU6v+ztlbXebZkqQTKxzcH7ojMi3CaLTmssV1V+y29dalx5/FeD3IAX DSyWT4oUxiXCZ1hDCPP68xiHEMHxsOidm8fcekinpPfz2f4uwqn/4kYTwe9I4pQVUFDT kR+w== X-Gm-Message-State: APjAAAUiZNW7WQC+uqBxEQMlcEbeNKzjwyXuoILYtN5YixNRLKrmHJ0v +YCieQHyOGRKBqMsiOhnqoyfTLy+ X-Google-Smtp-Source: APXvYqwvLR8zAiuT8HwiV6xD2SjZCQBDBntTtI6MMzovI074bivLArp1PA/Ru6JICV4EX7cIoVvC3w== X-Received: by 2002:a7b:c3d8:: with SMTP id t24mr4312838wmj.175.1579787351077; Thu, 23 Jan 2020 05:49:11 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:10 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 06/59] audio/audio: Add missing fall through comment Date: Thu, 23 Jan 2020 14:48:09 +0100 Message-Id: <1579787342-27146-7-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32a X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé When building with GCC9 using CFLAG -Wimplicit-fallthrough=2 we get: audio/audio.c: In function ‘audio_pcm_init_info’: audio/audio.c:306:14: error: this statement may fall through [-Werror=implicit-fallthrough=] 306 | sign = 1; | ~~~~~^~~ audio/audio.c:307:5: note: here 307 | case AUDIO_FORMAT_U8: | ^~~~ cc1: all warnings being treated as errors Similarly to e46349414, add the missing fall through comment to hint GCC. Fixes: 2b9cce8c8c Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Aleksandar Markovic Reviewed-by: Gerd Hoffmann Message-Id: <20191218192526.13845-2-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- audio/audio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/audio/audio.c b/audio/audio.c index abea027..f63f397 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -304,6 +304,7 @@ void audio_pcm_init_info (struct audio_pcm_info *info, struct audsettings *as) switch (as->fmt) { case AUDIO_FORMAT_S8: sign = 1; + /* fall through */ case AUDIO_FORMAT_U8: mul = 1; break; From patchwork Thu Jan 23 13:48:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228231 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=FbyF1sEV; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483RnZ39Wdz9sR1 for ; Fri, 24 Jan 2020 03:00:33 +1100 (AEDT) Received: from localhost ([::1]:59910 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iueuD-0005fv-Mv for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 11:00:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51224) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrC-0004k9-OG for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrB-000347-E6 for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:14 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:54618) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrB-00032w-7f for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:13 -0500 Received: by mail-wm1-x32b.google.com with SMTP id b19so2627867wmj.4 for ; Thu, 23 Jan 2020 05:49:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=K91PaAbwuPHcYYRyoA3KVsErzg14dVUsL6XXT+HRvuA=; b=FbyF1sEVLC/4Jb2cKaDiC9rNGz7TYDNibxxvXV2OyP6ffn5glrbEIlruc2bF13/Jh+ Qx0m8yBxwiyHvWU78MrfA/TAg9W4f6VYam6/GUQpQ5MdDei6I/GXMERmqOdJ1scGBPjc gomk0utgjzrKw8eQ+iYSWg2hdwXN6Uu8Qd11VfB475i8+3MOG8NOs5m3xPZPKQk/84kT GqALK+oOjoxZv6O5gez5Z3VWU/Sb+c6/bwcTiLklQVlkTnyeK65SkFAB2X9F9Sb6ArLJ psL7Xmsso1FXhX2DRxZGXjURAX1rTxw9p3spDsg4BS6oYuPIqZcRr/ofJn2R1h/w8J3q hfvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=K91PaAbwuPHcYYRyoA3KVsErzg14dVUsL6XXT+HRvuA=; b=Egel3EtETm91j6ABUdvIMHPBuQ/rst/s15CAn0HdndRNF4JLylNc/xZiLFqd7Z0/sf 6HQt/ohs9yJ4/vz6P4fgNBmcti9efRC2Kup72FlxYDQ5Qt+TQlaLAClzwwXazE1lYnZA dbpVIoCXbsyywlK/4JREclEtT1l0r9MK1dcv4D+TdopnoghI6KpasXCFIXr+PcysNrFy CCB7gltqAfQo6RGgXZJxiWvs1sSLH1OxuypKlCu+h5ySHcjlaNja01XagzwR/maWGScL 9v5q9JbYHn+op5LHgHJlKnuvHnZgv3lDDbQNpqJVq9hR+0voQMlPmvLv610Y031SHDa5 MJPw== X-Gm-Message-State: APjAAAWq14k11Ov6qruZ/62/VYJDG5FD46yMyk3WhAAveQVUI9zNkxdg yXBFQGRXwLGlOc90kMBl7X9y7yrN X-Google-Smtp-Source: APXvYqzqIxANCFi5cnyN/Z3yzXiMcHkwMSszZFimHzZiy6T7jDsiBf0NhaM07IFHzzx8p5rbxS/coA== X-Received: by 2002:a1c:9602:: with SMTP id y2mr4282216wmd.23.1579787352092; Thu, 23 Jan 2020 05:49:12 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:11 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 07/59] hw/display/tcx: Add missing fall through comments Date: Thu, 23 Jan 2020 14:48:10 +0100 Message-Id: <1579787342-27146-8-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32b X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé When building with GCC9 using CFLAG -Wimplicit-fallthrough=2 we get: hw/display/tcx.c: In function ‘tcx_dac_writel’: hw/display/tcx.c:453:26: error: this statement may fall through [-Werror=implicit-fallthrough=] 453 | s->dac_index = (s->dac_index + 1) & 0xff; /* Index autoincrement */ | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ hw/display/tcx.c:454:9: note: here 454 | default: | ^~~~~~~ hw/display/tcx.c: In function ‘tcx_dac_readl’: hw/display/tcx.c:412:22: error: this statement may fall through [-Werror=implicit-fallthrough=] 412 | s->dac_index = (s->dac_index + 1) & 0xff; /* Index autoincrement */ | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ hw/display/tcx.c:413:5: note: here 413 | default: | ^~~~~~~ cc1: all warnings being treated as errors Give a hint to GCC by adding the missing fall through comments. Fixes: 55d7bfe22 Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Aleksandar Markovic Reviewed-by: Mark Cave-Ayland Message-Id: <20191218192526.13845-3-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/display/tcx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/display/tcx.c b/hw/display/tcx.c index 14e829d..abbeb30 100644 --- a/hw/display/tcx.c +++ b/hw/display/tcx.c @@ -410,6 +410,7 @@ static uint64_t tcx_dac_readl(void *opaque, hwaddr addr, case 2: val = s->b[s->dac_index] << 24; s->dac_index = (s->dac_index + 1) & 0xff; /* Index autoincrement */ + /* fall through */ default: s->dac_state = 0; break; @@ -451,6 +452,7 @@ static void tcx_dac_writel(void *opaque, hwaddr addr, uint64_t val, s->b[index] = val >> 24; update_palette_entries(s, index, index + 1); s->dac_index = (s->dac_index + 1) & 0xff; /* Index autoincrement */ + /* fall through */ default: s->dac_state = 0; break; From patchwork Thu Jan 23 13:48:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228238 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=EQN9kUtp; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483Rvs64WKz9sR1 for ; Fri, 24 Jan 2020 03:06:01 +1100 (AEDT) Received: from localhost ([::1]:60004 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuezX-0004JO-EL for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 11:05:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51254) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrD-0004lg-UX for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrC-00036P-Tk for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:15 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:33948) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrC-000358-NJ for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:14 -0500 Received: by mail-wm1-x334.google.com with SMTP id s144so1922914wme.1 for ; Thu, 23 Jan 2020 05:49:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=e6FP2ihGyimY4vj+dOSdMZBpX4HIMQWZAgOG4qQpKUc=; b=EQN9kUtpRS3FItvt7DfiHy6IyyEQD2oDGD7zuuczFNfbzVlQ8lbAv4pmpOpvdU0AMF uDdHw/RQe54jGQYPWMguWMmPmRKshBPoQWPI4Bu9jdlhXyOOV730xll3JMfplfCfl+aD J2hlw/zMTgimuNXdeSKgaU3QYhMryZz+ItVaDklMzifMchKUj8GdLJRKrEhqMhuAHv1w 7x4gSt5iqa4duqHgCs5F+NjNIXTHETvXPLsbzqxlGcJ17txgc6nHmmxoQTc7iUE5fLOC sBP0qfSJ9hclWpYShmvp6x3fieYzlKAVqN9ARiVcH21N+d7TajyNm8haAbEpY1VWI6LY ck1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=e6FP2ihGyimY4vj+dOSdMZBpX4HIMQWZAgOG4qQpKUc=; b=uhe2gNKpOWIqKO/E9ZCKg1u2VG/LRxDhugQJx7CO004KFSOlAqqyYchVh3mphGfhuu Gc6ZUXVDW/9DXwSLdr8STn4HmKtI1AEKPKoaGeS1E3cD1qpU0An9VVsbpygVyg0QqGHP l/UjhGWfvbVgMwt2WLEx8+xSjFPdgDFyw8PzBn0BOPJLg4T4x3V7XMsvopE1VQ5DokHc t8MqggAOOH8uSPsQHMN+QT0mvjjjkyHXaJyOQ03eQ5PSxc2J3QCfogeAD3dfDeEg8Zlu m/q2LRF5SInSLtXhKjPNCtd3T3gAlHChCxDPRS75DbqNvAwZ5dzu5w6Kc16v5M+f5Fok C0qQ== X-Gm-Message-State: APjAAAXcAu2XwomMzuoyb85tiGdfxDVWwgKam87BROeMJy/87GmguCS4 6DiW660XnrFlXgiwrRI9LJhBJc3L X-Google-Smtp-Source: APXvYqwDTn8oMJPb7dsuAp5iCB7OI1Q7OsICH9eiMaz6XbBIrJbgaONUHTA14OMdGJaJVG9iuslpoQ== X-Received: by 2002:a7b:cc98:: with SMTP id p24mr4381755wma.139.1579787353575; Thu, 23 Jan 2020 05:49:13 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:12 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 08/59] hw/timer/aspeed_timer: Add a fall through comment Date: Thu, 23 Jan 2020 14:48:11 +0100 Message-Id: <1579787342-27146-9-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::334 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Reported by GCC9 when building with CFLAG -Wimplicit-fallthrough=2: hw/timer/aspeed_timer.c: In function ‘aspeed_timer_set_value’: hw/timer/aspeed_timer.c:283:24: error: this statement may fall through [-Werror=implicit-fallthrough=] 283 | if (old_reload || !t->reload) { | ~~~~~~~~~~~^~~~~~~~~~~~~ hw/timer/aspeed_timer.c:287:5: note: here 287 | case TIMER_REG_STATUS: | ^~~~ cc1: all warnings being treated as errors Add the missing fall through comment. Fixes: 1403f364472 Reviewed-by: Cédric Le Goater Reviewed-by: Aleksandar Markovic Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20191218192526.13845-4-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/timer/aspeed_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/timer/aspeed_timer.c b/hw/timer/aspeed_timer.c index a8c38cc..c91f184 100644 --- a/hw/timer/aspeed_timer.c +++ b/hw/timer/aspeed_timer.c @@ -283,7 +283,7 @@ static void aspeed_timer_set_value(AspeedTimerCtrlState *s, int timer, int reg, if (old_reload || !t->reload) { break; } - + /* fall through to re-enable */ case TIMER_REG_STATUS: if (timer_enabled(t)) { uint64_t now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); From patchwork Thu Jan 23 13:49:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228225 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=D9uKJg7b; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483Rjb1JZtz9sSH for ; Fri, 24 Jan 2020 02:57:06 +1100 (AEDT) Received: from localhost ([::1]:59868 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuequ-0000a7-Cj for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:57:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52298) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuct7-0007jA-Ak for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:51:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iuct6-0006wD-8P for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:51:13 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:38606 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iuct6-0006vZ-5K for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:51:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579787471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NqscLWDnKRxDhBqt6gkRB5/5l0nOX51w0oSzCS1wQGY=; b=D9uKJg7boPL51NzTr9+SxiOP3rzH43qpDl/HjrPuqAnNweDXvRAgqQP9/U5yKXfM5XfJ8Y LDwpn5XILb0UnE3P1wFMn6HBSAdlXtx5xtUthmtq3EMC67m9pb6KXLkJ5B2JWS9jObuYet Y6PcEfbFKhgDWJJDNl8OrtMh5O/ApCc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-296-JQkRDZKqOGelQv7ipuNWZQ-1; Thu, 23 Jan 2020 08:51:10 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 80CC21007EF0 for ; Thu, 23 Jan 2020 13:51:09 +0000 (UTC) Received: from 640k.localdomain.com (unknown [10.36.112.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7C4BF8575C; Thu, 23 Jan 2020 13:51:08 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 09/59] hw/net/imx_fec: Rewrite fall through comments Date: Thu, 23 Jan 2020 14:49:59 +0100 Message-Id: <1579787449-27599-10-git-send-email-pbonzini@redhat.com> In-Reply-To: <1579787449-27599-1-git-send-email-pbonzini@redhat.com> References: <1579787449-27599-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: JQkRDZKqOGelQv7ipuNWZQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé GCC9 is confused by this comment when building with CFLAG -Wimplicit-fallthrough=2: hw/net/imx_fec.c: In function ‘imx_eth_write’: hw/net/imx_fec.c:906:12: error: this statement may fall through [-Werror=implicit-fallthrough=] 906 | if (unlikely(single_tx_ring)) { | ^ hw/net/imx_fec.c:912:5: note: here 912 | case ENET_TDAR: /* FALLTHROUGH */ | ^~~~ cc1: all warnings being treated as errors Rewrite the comments in the correct place, using 'fall through' which is recognized by GCC and static analyzers. Reviewed-by: Richard Henderson Reviewed-by: Aleksandar Markovic Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Message-Id: <20191218192526.13845-5-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/net/imx_fec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/net/imx_fec.c b/hw/net/imx_fec.c index bd99236..c01ce4f 100644 --- a/hw/net/imx_fec.c +++ b/hw/net/imx_fec.c @@ -909,7 +909,8 @@ static void imx_eth_write(void *opaque, hwaddr offset, uint64_t value, TYPE_IMX_FEC, __func__); return; } - case ENET_TDAR: /* FALLTHROUGH */ + /* fall through */ + case ENET_TDAR: if (s->regs[ENET_ECR] & ENET_ECR_ETHEREN) { s->regs[index] = ENET_TDAR_TDAR; imx_eth_do_tx(s, index); From patchwork Thu Jan 23 13:48:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228125 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=AaS/WIK+; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483QjQ0MgYz9sSL for ; Fri, 24 Jan 2020 02:11:54 +1100 (AEDT) Received: from localhost ([::1]:58898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iue99-0006Ea-DK for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:11:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51284) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrF-0004ny-Nx for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrE-0003BI-LD for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:17 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:33757) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrE-00039g-Ep for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:16 -0500 Received: by mail-wm1-x329.google.com with SMTP id m10so1389237wmc.0 for ; Thu, 23 Jan 2020 05:49:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=edun+OJ+YJzFF5lv8jtNkTbaWNOC2ILXKY6V/xrxpmY=; b=AaS/WIK+Vp8VzdZ2g3g6E6uGHTOSpBadzOvJ49AzRVyDwY+B+VsS1T006rKFefGUC/ Nx3O76y0b6zlIlcX0PJxGJBl2/vyMXKgh+T+kHTYKFOMtkOtWyoif7X9uS6Lk4fAhZyh ohzibnMwTHvMG6Q3508y6zAnGRYw3POF2fX4F+NGRHozKjECzXSsn2gnr7eImHT5ilS3 6VYnI+o3sP1a+WJyz9qKHa4Kk2K1vYYvQB9vGoxJmnAYrEo9IrYtOnf4zNWiYg18YbK+ 33sNeJf0pvg7sInVRWDUfRecG/isFvD1eSy3IepM4kM3rxj2Tq9P+k8e2csWJP7aPgVU 82ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=edun+OJ+YJzFF5lv8jtNkTbaWNOC2ILXKY6V/xrxpmY=; b=RQGNtMBZmqdLBfuA7DKJSfi8icSKYFBa5JXWTe4zJOMNCze43QpPtD+igqX7WXyvBj HuVztaWLyJ0vfcoOiSKFJ1s2CbwwsnNqtxCuu+vWF0GL+7FvlSJf+3PXE2t0/DH4i7HM JIUHHtkvchSh14TGln6OJFFirp8CW1W71GI11N9EZysh4a2TxawKhwuCpShj+rJaHX/C k3RYAToGtWD51xZjsVKhlfdf7OXfSeKBfbHaYeWxETj4CKe0Sl06rPBmS5GzRr5wBJrj 4ODtGdiemBVrlEupH3bYQDEH2geJC/UgVy5iSRTQdceBRuJLiKNIQD8Sy/8MtI56vB82 TXIw== X-Gm-Message-State: APjAAAV9JXDex9jox+VAMSxj+JYGNxyx5hJpFolq0sGi/khjPcDhdaVV R/QMGSfi8sozK9cexeN41de7rJRg X-Google-Smtp-Source: APXvYqzm+Ihy8uzmhSx5kYvJh0HGVcI3gbN2wEGPLoSf+bC2IoiPozlo+8lnqpaq5sgHjMLpairptw== X-Received: by 2002:a05:600c:d5:: with SMTP id u21mr1203162wmm.98.1579787355304; Thu, 23 Jan 2020 05:49:15 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:14 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 10/59] hw/net/imx_fec: Remove unuseful FALLTHROUGH comments Date: Thu, 23 Jan 2020 14:48:13 +0100 Message-Id: <1579787342-27146-11-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::329 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé We don't need to explicit these obvious switch fall through comments. Stay consistent with the rest of the codebase. Suggested-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Aleksandar Markovic Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Message-Id: <20191218192526.13845-6-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/net/imx_fec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/net/imx_fec.c b/hw/net/imx_fec.c index c01ce4f..5a83678 100644 --- a/hw/net/imx_fec.c +++ b/hw/net/imx_fec.c @@ -901,8 +901,8 @@ static void imx_eth_write(void *opaque, hwaddr offset, uint64_t value, s->regs[index] = 0; } break; - case ENET_TDAR1: /* FALLTHROUGH */ - case ENET_TDAR2: /* FALLTHROUGH */ + case ENET_TDAR1: + case ENET_TDAR2: if (unlikely(single_tx_ring)) { qemu_log_mask(LOG_GUEST_ERROR, "[%s]%s: trying to access TDAR2 or TDAR1\n", From patchwork Thu Jan 23 13:48:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228242 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=EIn8b5Ye; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483RyQ3cD2z9sSH for ; Fri, 24 Jan 2020 03:08:14 +1100 (AEDT) Received: from localhost ([::1]:60050 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuf1f-000852-Qs for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 11:08:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51295) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrG-0004p2-Ex for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrF-0003CO-CN for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:18 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:51541) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrF-0003B8-5C for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:17 -0500 Received: by mail-wm1-x32a.google.com with SMTP id t23so2642432wmi.1 for ; Thu, 23 Jan 2020 05:49:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DTyTmB3blHTLxdPGZH2ZkYa27bOTCp2Z3S4ce3QZa2c=; b=EIn8b5YebcmW98vsvO39G/qlI5u91D2kFfdrrVHgpybuzsBU+3yZnDpvMzTZcpi2gk pbk4l3Gv/7ObCgfaZmAbwjj3nichZZciHFpBIGRefWqSyl2q5StyCCaBE2rXq1+NkSds s5yKVmzfs7BVl2BElJNuIDYurVEV6sgKhx1TMZsPpp0vivWBkM3UHVxV2UcamhlvwJGt cXCWo7RNrJQoQ3k92s/Ng/d9o+3zubguA/+QBVuazi2nqEQliEA5eduV6v3z45h4joHc 0Caw2Px87RNkjis5jJPYbAwRqUnwNh4tzBOGnxuAiEINKeuPOTH7FdwT23jlbl04ApP3 2VhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=DTyTmB3blHTLxdPGZH2ZkYa27bOTCp2Z3S4ce3QZa2c=; b=fhLsIQ34ZpmOG4cXe6ZJXQ985rmR4/enkhoRvhjl0Cj/Oo8Lep9nZ9NUzQ+cNh1GOl PjzhiQzEWjjm/X9DgjXT3hdX+gpaJJj23kkpqpxc9oX7D8nEFdxMSDGffXRiHN7iTjrO pyor5YPHhEuHqpfSc4DAUo9Mo8YInwB8oi0T1Gh6Z+p8QE200s/Ii0UoHu0UksZCFVRJ 8C8knlpFBBesj5CtB9JbeNHcy2n21C4bnMj+Vz0B0jrS55vQfmKCNMKPUlDog0aJIcvv 7+oG9Vn7AwCLzgGTbr8pD/b6+tqbc4mSsR3DOKgJKvXrYyBBWLxcYJQT5JZ5yON+dRwS pkYA== X-Gm-Message-State: APjAAAVknUrPC23D8wsuSg73zQF0gQwF+z4gntHt7OIZcvBskbjcd+Ub Eu3u/w4czJ1whzMfN+T1ABVD3jri X-Google-Smtp-Source: APXvYqzWYAnYKW9YyXXtZuk1DIGIrPuTfAk0yvx2v3EWW85t4sJ3lUBH+8MTPJBerfcmS7LiSD1zlw== X-Received: by 2002:a1c:5f8a:: with SMTP id t132mr4365554wmb.162.1579787356090; Thu, 23 Jan 2020 05:49:16 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:15 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 11/59] hw/pci-host/designware: Remove unuseful FALLTHROUGH comment Date: Thu, 23 Jan 2020 14:48:14 +0100 Message-Id: <1579787342-27146-12-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32a X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé We don't need to explicit this obvious switch fall through. Stay consistent with the rest of the codebase. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Aleksandar Markovic Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Message-Id: <20191218192526.13845-7-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/pci-host/designware.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci-host/designware.c b/hw/pci-host/designware.c index 71e9b0d..dd24551 100644 --- a/hw/pci-host/designware.c +++ b/hw/pci-host/designware.c @@ -182,7 +182,7 @@ designware_pcie_root_config_read(PCIDevice *d, uint32_t address, int len) break; case DESIGNWARE_PCIE_ATU_CR1: - case DESIGNWARE_PCIE_ATU_CR2: /* FALLTHROUGH */ + case DESIGNWARE_PCIE_ATU_CR2: val = viewport->cr[(address - DESIGNWARE_PCIE_ATU_CR1) / sizeof(uint32_t)]; break; From patchwork Thu Jan 23 13:48:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228175 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Mbeww9PY; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483RKv00Tmz9sSN for ; Fri, 24 Jan 2020 02:40:01 +1100 (AEDT) Received: from localhost ([::1]:59602 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iueaL-0001pj-S0 for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:39:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51309) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrH-0004qK-KG for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrG-0003EL-D6 for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:19 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:37538) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrG-0003D5-7C for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:18 -0500 Received: by mail-wr1-x434.google.com with SMTP id w15so3165037wru.4 for ; Thu, 23 Jan 2020 05:49:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EB6B/is9mQvDGkoPXZc/Kbfawg7I6UbaVwup9pSP1Q0=; b=Mbeww9PYzevWo8wEmP649qJ27+8jn6fCjX1zK6o4MUdfQSKY9FkWhUYoLBjpd5502S AF8BuwrXJ/08XhlkGF2odnGirCffgGTt9PI03EZ8pQaY5/vQ0RPaNm3klirz28kfDf4u 1+dkWtu407+p/543PjmCqw3VFPlVjz7bjlPc4xT+swbFEBEioXKT7QI6DJfBAJBRnBaR ZX3ncr8R4atFj13yldo1hSBEBo3+nLpc6bUS/iZDL/rA5idEUpQ0T/+E8nzwZ4k/EShr RA5L2mU1SYTH/bFLCfUuHPclxK+O4+ABTPaLh8YVRbL/hSvnZEOD6Ra7OywDhsnudhuj IP1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=EB6B/is9mQvDGkoPXZc/Kbfawg7I6UbaVwup9pSP1Q0=; b=kSBlpms+umNbiWFEyn44+N1S3UHTIWHrQ5TL2kLCvNZbgXSnMYLMNfEjh7tRKViNBP 2u4ZMZrsahgwM5c3Q0arDYMYkLkCL6d+78TfYpBYO4Rhp8HhSi8NTeexxdNxsBJhz85M YXFe2Da6VKQRqZUnjbbgwMIm3VvkBmze1GL2E2gRrFN7VYJlqtjKDdqVSXxwgKrYqsov n+t1mbTseZBpLak9a7TvzikZfsp6JbrNS/sHVbChA7Ftjcs/bz0Vdhf8nti6ytQxvESM fW+XQAu30whh5GnfzNe1Zkzz8GLvLWVeqQ8eLZ/6CrkFtw2vF1vOTtYF6t5+yOHg7Sfm peew== X-Gm-Message-State: APjAAAXDm6jjGjJgfwr8xmnQ6nyoaPyutk7tpzhPdgnxzaR6DwsdcXBc 5iEuiyL97SSNJPLds6FKb51b6B+/ X-Google-Smtp-Source: APXvYqwkX7Ypg5lVR4Sj3Cr9Iz84FYkfOEkUceH1+2Gr1T5uXXG8eNTpbLtiFZsMfmpb5SijWBaKJA== X-Received: by 2002:adf:df03:: with SMTP id y3mr17891512wrl.260.1579787356878; Thu, 23 Jan 2020 05:49:16 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:16 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 12/59] configure: Do not build libfdt if not required Date: Thu, 23 Jan 2020 14:48:15 +0100 Message-Id: <1579787342-27146-13-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::434 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé We only require libfdt for system emulation, in a small set of architecture: 4077 # fdt support is mandatory for at least some target architectures, 4078 # so insist on it if we're building those system emulators. 4079 fdt_required=no 4080 for target in $target_list; do 4081 case $target in 4082 aarch64*-softmmu|arm*-softmmu|ppc*-softmmu|microblaze*-softmmu|mips64el-softmmu|riscv*-softmmu) 4083 fdt_required=yes Do not build libfdt if we did not manually specified --enable-fdt, or have one of the platforms that require it in our target list. Reviewed-by: Thomas Huth Reviewed-by: Alistair Francis Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Message-Id: <20200118140619.26333-2-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure b/configure index 557e438..c67a7e7 100755 --- a/configure +++ b/configure @@ -4095,6 +4095,8 @@ if test "$fdt_required" = "yes"; then "targets which need it (by specifying a cut down --target-list)." fi fdt=yes +elif test "$fdt" != "yes" ; then + fdt=no fi if test "$fdt" != "no" ; then From patchwork Thu Jan 23 13:48:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228128 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=rv7YyKkV; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483Qm01RgXz9sP3 for ; Fri, 24 Jan 2020 02:14:08 +1100 (AEDT) Received: from localhost ([::1]:58988 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iueBJ-0000oN-RT for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:14:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51322) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrI-0004rf-Ju for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrH-0003GH-IN for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:20 -0500 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:33236) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrH-0003Eu-AV for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:19 -0500 Received: by mail-wr1-x444.google.com with SMTP id b6so3192938wrq.0 for ; Thu, 23 Jan 2020 05:49:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eTr7REOAleaAyfl/HuxFmf5p5T5F7PayCyv/OCMj0WQ=; b=rv7YyKkVDjJpDA6wkmE/VA+FMWclXUowiWMkryXzuRero5HwlTUvNHMPY24MEjuVXl XXMhOhxHB4pWSpMpCSnOv4dVA00Dd3B1lofx8ei5R1S+SrUX5fjLvAx9uyDHivlGy3N1 TAjpYyXjWSuR5gJ3ejNJxU/qbzPf4bgHfOt1zpKyGqg37Xrw+Ggt0WzAXhMaSYA0YhAY m0E5ZNJnBEHd2BX8LPCHybdfnOSPlpldFgz5OZzG7yUZ38GqlwJjOuLtomwCHeS9RxeF MVMwNSvXBh4jg6Z3Tyig/F59dB9h3h/7xJh9UX4IvXIO5di2Hc1L2SRySsZpI/pf6EyV yDIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=eTr7REOAleaAyfl/HuxFmf5p5T5F7PayCyv/OCMj0WQ=; b=cLIlcreyS/J9/bFliDKqEdO6gNvqzajHShnen27utUrmM+shb4wYTYA4wh+QvmdF2p oE4hdjxN5tGrSZDRbZwLR8DfHDJXs6IBB1mYorRRb4WlPvvpJ8wGSr+sNCqgmYfh1rSU 5PPYFME9EpEqUG3CFJqAKAiC0JjLhV9vJ0OO6PVehdRRY1GBgy/b+/JcTTM+8iRj+QLM XYL14nzusuGNfuAwVfgGM2IX9H2dNzad9/XGD1RjSdBPA0jL+A6m6sgzGqjm/FXZ34Ep PGJ9sJOnfR97+ZNnGEwEEw7vXP3bwW3hfmtntvgtgpuB3/oAHjLX4Ng554lXFekCVqMb BK7A== X-Gm-Message-State: APjAAAW7ki9U0h5hVCfbytdvhT7nJ3cZ1PZWyt/L48nZ0RDHJ5DFEnQc QVE934495bYRLp/YV5Gt39ET9mcK X-Google-Smtp-Source: APXvYqwfqD1KgnmTr1Cnzw25AFVZMF0V8tdquqWZbYWFga/U9aIg4PtVJGqKsEUXyIe46jkhRhK7tw== X-Received: by 2002:adf:f581:: with SMTP id f1mr17815471wro.264.1579787358106; Thu, 23 Jan 2020 05:49:18 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:17 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 13/59] Makefile: Clarify all the codebase requires qom/ objects Date: Thu, 23 Jan 2020 14:48:16 +0100 Message-Id: <1579787342-27146-14-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé QEMU user-mode also requires the qom/ objects, it is not only used by "system emulation and qemu-img". As we will use a big if() block, move it upper in the "Common libraries for tools and emulators" section. Reviewed-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Message-Id: <20200118140619.26333-3-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- Makefile.objs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Makefile.objs b/Makefile.objs index 7c1e50f..5aae561 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -2,6 +2,7 @@ # Common libraries for tools and emulators stub-obj-y = stubs/ util-obj-y = crypto/ util/ qobject/ qapi/ +qom-obj-y = qom/ chardev-obj-y = chardev/ @@ -27,11 +28,6 @@ block-obj-m = block/ crypto-obj-y = crypto/ ####################################################################### -# qom-obj-y is code used by both qemu system emulation and qemu-img - -qom-obj-y = qom/ - -####################################################################### # io-obj-y is code used by both qemu system emulation and qemu-img io-obj-y = io/ From patchwork Thu Jan 23 13:48:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228129 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=n+Dk1KTN; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483Qpx1dXpz9sSL for ; Fri, 24 Jan 2020 02:16:40 +1100 (AEDT) Received: from localhost ([::1]:59082 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iueDl-0003rh-Qy for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:16:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51341) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrK-0004tj-48 for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrI-0003H3-Lc for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:21 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:44792) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrI-0003Ge-F9 for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:20 -0500 Received: by mail-wr1-x42f.google.com with SMTP id q10so3116513wrm.11 for ; Thu, 23 Jan 2020 05:49:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vJD0BoXFI1BC+rrhGs3A0H4XskjTico//vi5GiSKD8E=; b=n+Dk1KTNmi0db8PleazGqj6izocf777l+1xU5JfGNiuvhAmUncm5i1aFBvanUnIR3x Zrzpc2ZQBwrCiCnWQW5eA//DiexwgnVcOjxPiQhKTSIxEwl4KNK8uYsoBkVWAYrMczvZ JYs8m2/hp0lOfke7CMzMCBNWxRaQowWxP9x1ia9vyQgtZZ+iJS49Z5+TAm6QNgAydG9o r9M9OLVmo7W0ivWnA0rkb/W34ulPDG3vIhD2ku+LruAGkMI7v2AzOXY0ZrGcVpKltegE Gpzexh0UrWKOBzyU5vQo/pxA1wdeQYcFL9xH4L22piL1QGoackoJXAOW4M5SlhT19PhP fwAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=vJD0BoXFI1BC+rrhGs3A0H4XskjTico//vi5GiSKD8E=; b=S0IBckYiBPCzANEa5Krxesyj5AUfBm+2vet5DAyFsMdFy8JrTwzD96wVFbZhtikcJU Rfby4VBREH6iHWLBkugnAArjPlIXGxkSskPt+RDIw5vJJ/hBSjyXUE2298gUA2I6OmUZ ahUCcaADCKEwjFnNMeiXdvyLl6aPAGPkp9sQ9JWMoeimq1rTNkxe/7ROL45NMCnN8Ro2 A2W9DvFGgdV+d8CuMn0NTSt7SQ0qCV9sn8n4O/dQmAM46EYNJxxFwiAXtYQDEjOW2ktT atQNzKpR7NBD1oYu4Z0fl0R55oN3dNPtJEgCXAZe9DRi3qLa+aTf1iRVhBZ3B7Unrwv8 RIKQ== X-Gm-Message-State: APjAAAU4JOolH2Sskpr3/hnhAMu3xQ2MjJ3V2CNZWED+SpsMGkYgy9S1 ca7+cseA0Lpf2ltom5ENWNmliYET X-Google-Smtp-Source: APXvYqwALekMVITrC7yIBH8eHz81gdkGCVSXKLfl3GYcOmYLIhnJBt+aD/YyKo7JP7H7sWZqIa2CBQ== X-Received: by 2002:a5d:44ca:: with SMTP id z10mr17816376wrr.266.1579787359176; Thu, 23 Jan 2020 05:49:19 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:18 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 14/59] Makefile: Restrict system emulation and tools objects Date: Thu, 23 Jan 2020 14:48:17 +0100 Message-Id: <1579787342-27146-15-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42f X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Restrict all the system emulation and tools objects with a Makefile IF (CONFIG_SOFTMMU OR CONFIG_TOOLS) check. Using the same description over and over is not very helpful. Use it once, just before the if() block. Reviewed-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Message-Id: <20200118140619.26333-4-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- Makefile.objs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/Makefile.objs b/Makefile.objs index 5aae561..395dd1e 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -4,15 +4,14 @@ stub-obj-y = stubs/ util-obj-y = crypto/ util/ qobject/ qapi/ qom-obj-y = qom/ -chardev-obj-y = chardev/ - ####################################################################### -# authz-obj-y is code used by both qemu system emulation and qemu-img +# code used by both qemu system emulation and qemu-img -authz-obj-y = authz/ +ifeq ($(call lor,$(CONFIG_SOFTMMU),$(CONFIG_TOOLS)),y) -####################################################################### -# block-obj-y is code used by both qemu system emulation and qemu-img +chardev-obj-y = chardev/ + +authz-obj-y = authz/ block-obj-y = nbd/ block-obj-y += block.o blockjob.o job.o @@ -22,16 +21,12 @@ block-obj-$(CONFIG_REPLICATION) += replication.o block-obj-m = block/ -####################################################################### -# crypto-obj-y is code used by both qemu system emulation and qemu-img - crypto-obj-y = crypto/ -####################################################################### -# io-obj-y is code used by both qemu system emulation and qemu-img - io-obj-y = io/ +endif # CONFIG_SOFTMMU or CONFIG_TOOLS + ###################################################################### # Target independent part of system emulation. The long term path is to # suppress *all* target specific code in case of system emulation, i.e. a From patchwork Thu Jan 23 13:48:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228131 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=hVcijICK; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483QtH193gz9sSL for ; Fri, 24 Jan 2020 02:19:35 +1100 (AEDT) Received: from localhost ([::1]:59126 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iueGa-0007XA-O8 for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:19:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51346) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrK-0004uH-He for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrJ-0003HX-Et for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:22 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:37952) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrJ-0003H7-94 for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:21 -0500 Received: by mail-wm1-x32d.google.com with SMTP id u2so2611658wmc.3 for ; Thu, 23 Jan 2020 05:49:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hpoGYi5O9+KNRZJsn5fTTGDu/AscfeXtzSOUj6qEzek=; b=hVcijICKzjqCe6ZhEycjOdNgtjiU9mA344y0TdyHJm06ky9xW57HmDs6BFB7hWRX3p mtcf3V0Wo9J7eKiYxC4tw41WGUOGuvPeAHBrQG908Ki7GfHpYfrnZMr5Rq9zniAzAOuK Qu5co+se3NMTb7qnNlmaH9Hxuz4HbZm1xFgL0txL6JbL0XkgCB/CFylsKb9AIlusN6Tt qvdTzJjSYC603JgrWA4QLsAE06pRwnd66eDipLtsgRz3W0/vF7mYjw6IsZGYjsJpgzFD y5tWhx7vmtpqSXba0+tThm9fPxzUOZhZaraNqamMax152NMq4f3EtUOPaQc42REqZynb EkYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=hpoGYi5O9+KNRZJsn5fTTGDu/AscfeXtzSOUj6qEzek=; b=IX/pm+QJTAna9XyQF96rR7XOsfKNjr9dygirl+IE4GJzzAPA3k9953xT/L532nU6pH BlehCLwlWL8BiLQQ8HA3mr8Vn8kLrNAnz3lQ+SgLBBdahedzHLRTeLR5T3g1I56bhBkE oDoEi4GTS33T7VoGymIN4jDsLxFTQGynsnwGmvOkVxZKQYJuSF0GM4DytElk4xEh/Bb/ 65+q7heF+2lCnGl4k3zVObyKlqqsqEGM0Wc99sB7S7Jz3I3zacvD9QxTs7LSDr85FJgP BHALQ8DyhxNbAHoWwRnyu9qVJkQzBDXeaV6D9XyldUN4oBinmsoEIXUkPCZZ0pygIqTg 6Fww== X-Gm-Message-State: APjAAAVEs2XzD67hyY+60bLjIzNENyOo5ScoDejJbtnUVFjzpg44Bx0t nW8e6fTvv5aod/3n2QEEUMl0Tu5q X-Google-Smtp-Source: APXvYqzpEmuGgAow/N80AGi6PY/Ef9hFHOWm6ctUz8SwFO1Yo3n/hhbpjAwd/z56eMN8SplWx8HYWA== X-Received: by 2002:a7b:c119:: with SMTP id w25mr3416710wmi.116.1579787360128; Thu, 23 Jan 2020 05:49:20 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:19 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 15/59] Makefile: Remove unhelpful comment Date: Thu, 23 Jan 2020 14:48:18 +0100 Message-Id: <1579787342-27146-16-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32d X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé It is pointless to keep qapi/ object separate from the other common-objects. Drop the comment. Reviewed-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Message-Id: <20200118140619.26333-5-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- Makefile.objs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Makefile.objs b/Makefile.objs index 395dd1e..c6321d0 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -71,11 +71,9 @@ qemu-seccomp.o-libs := $(SECCOMP_LIBS) common-obj-$(CONFIG_FDT) += device_tree.o -###################################################################### -# qapi - common-obj-y += qapi/ -endif + +endif # CONFIG_SOFTMMU ####################################################################### # Target-independent parts used in system and user emulation From patchwork Thu Jan 23 13:48:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228179 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=j5V8V04X; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483RMy1Lntz9sSN for ; Fri, 24 Jan 2020 02:41:50 +1100 (AEDT) Received: from localhost ([::1]:59632 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuec7-0004J9-Qt for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:41:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51363) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrL-0004vc-Cs for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrK-0003IB-Bf for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:23 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:43675) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrK-0003Hb-5j for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:22 -0500 Received: by mail-wr1-x432.google.com with SMTP id d16so3113125wre.10 for ; Thu, 23 Jan 2020 05:49:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kwopIYB/WLvPXsn1n5soFXTxjBcyD4Z2aHNDQJbuDLo=; b=j5V8V04XdmUw9XwQxjLzBRIwNE5CDm5i65eubKo6FTvLrAXu/suDp+1y0BlNTQjCu7 BkGki89TOXJlf6e4BfrGIgsi7JAVOGxzhneZXxCbCcduuz99XHlizPzi8J7wUUM5INQa vctiYh/5BafuMrO8OzsXuoEY4aBG6hYEt70RZDaTMGz0QqNlRKoteYmgi2D8gY1GXoo4 oEAyKoT7EjPh6XbiShKcsMj0KdElL/j8oXzGdNTGxJPrPx9pkw0s7VJLUiDWsTw2ceA1 nfoEN/yxeB8tLsrififYwq/qYlH/dda0RGDP91GFbEAaw5JjHEQ7ngX0MDIg3QKfHWWO uLPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=kwopIYB/WLvPXsn1n5soFXTxjBcyD4Z2aHNDQJbuDLo=; b=GH/aceuJd/CItF2g4zmvnfwukSfGjuy1aJHUOjcuEL+765br1Q2w/6KYE/hayvTC3J C1GDmwKw4Yh44tOI2pUf/WRdNJqlpXrDnmKB3TkR9aMpbEPbkVDcD4UKM079yXL5KX/c bicykrFwM7U824FQJ377p3jNkLdMd+ZDN/mTV/z+B50pFOvb1+YrqBm8uQGbGnUFZnhv IPh026VDchDLOBekAG5VAkB5ifBLFACVUGMtkFf42ssEEfV796wZyvrOSijOkjqkRDlv g1OnQSlIaupFtvndbP7Q4B7S5pWr5ZGgR4SJC8burM8brRPTyQbOVRfoUzHMtNRCw9Ng QuxQ== X-Gm-Message-State: APjAAAUP7DeV8yk0VJRy9cjFwvtmj0AGlCPDmPLH6MWHRA2mMUUCMABd rQLPoi13MHKhd6x7ZWg2J0eqZnbp X-Google-Smtp-Source: APXvYqwM46v7H66iEYghLH08OlMbyDTsdeLu7ymBZdamxB8jZHnMXpAk1+cxUREmdvUtJ6VGeQHHJw== X-Received: by 2002:adf:eb48:: with SMTP id u8mr17451878wrn.283.1579787360962; Thu, 23 Jan 2020 05:49:20 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:20 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 16/59] hw/core: Restrict reset handlers API to system-mode Date: Thu, 23 Jan 2020 14:48:19 +0100 Message-Id: <1579787342-27146-17-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::432 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé The user-mode code does not use this API, restrict it to the system-mode. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Reviewed-by: Thomas Huth Message-Id: <20200118140619.26333-6-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/core/Makefile.objs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/core/Makefile.objs b/hw/core/Makefile.objs index 0edd9e6..2fea68c 100644 --- a/hw/core/Makefile.objs +++ b/hw/core/Makefile.objs @@ -1,6 +1,7 @@ # core qdev-related obj files, also used by *-user: common-obj-y += qdev.o qdev-properties.o -common-obj-y += bus.o reset.o +common-obj-y += bus.o +common-obj-$(CONFIG_SOFTMMU) += reset.o common-obj-$(CONFIG_SOFTMMU) += qdev-fw.o common-obj-$(CONFIG_SOFTMMU) += fw-path-provider.o # irq.o needed for qdev GPIO handling: From patchwork Thu Jan 23 13:48:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228181 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Gm25RKwY; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483RPv07WXz9sSP for ; Fri, 24 Jan 2020 02:43:31 +1100 (AEDT) Received: from localhost ([::1]:59646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuedk-0006ie-QI for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:43:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51378) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrM-0004xI-Mv for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrL-0003Iu-7U for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:24 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:32912) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrL-0003IJ-0k for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:23 -0500 Received: by mail-wr1-x431.google.com with SMTP id b6so3193169wrq.0 for ; Thu, 23 Jan 2020 05:49:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sSRCj6UHzSKPSE/jS0TsBZzey3FUZ4xZz9WVN3llpok=; b=Gm25RKwYQ1ffbx2mrFC30lLqBW3KBRS5+pq4iW6e9U8Q/lSq0L/Ryly9z+gMm/DB4g eKtt42NLU4aEXgDlztuZ/FwFxSMxHVXJTgA1gPUh22EnBc+G0QUkxPeNjYqUyRaXpggR 3M7Dn9KE1JKqIwnubV70/YYEUF8XWHYPa6frg2prtco4q2tX0RHUFfjnJ030qWca70Lo W+WDq44HWpjaQylcsjTGmW1Brsy2+zz3kqPw5T9OVuAZWXSW4rvexHPMfznNPstIq/P5 TeMvksg/2Vo9QAVAIpIwnL5ulPgVEWeP9vN4u9Pj9dme36C7hpEHXm+V9DwGdcL43cNB 3vJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=sSRCj6UHzSKPSE/jS0TsBZzey3FUZ4xZz9WVN3llpok=; b=TJxYJHPBtkhLmglJGvx50vBg9Qzg6Ub4nhVMW4SF3lGdilh0ii4/9r7YmJ/sncsCsh hoSO++NIKzlCbt9hQruUV6qVL7XDQpeW/nLvI9zlnv1LznD6bvLbJ/1EoGPNkeUk4DXi Fu8LfVKanaIxBWkzzjJw9HjDrDIgRO4ZtJY/+Yn1CS1+pwWwAYde1Wi6sUprPk3kDlt5 moC+K+jA7RQU2dl/2ybO7MUNuGXwAi2tfkW5lOGuFKC3D16mBlpnBBL8M/vV26omm5B4 8vnRUBVjAgZKX3zaStqZpwG7iLTZhgY6lQz93T1RGOTQDOvuD0pcuTZ3YUsHZCF/Kg7U 8Njw== X-Gm-Message-State: APjAAAV/sAXg5tIsOLY+gIIWJeQaHhTSYIjQ5GderqyPKIFtgSHdJtHR VeHZHjUQVUfTO5yhIUF7bi5ccizQ X-Google-Smtp-Source: APXvYqzLfpI3wLyNIP46Ai8mFu87iwH2jx0xl3FLdGR9u32XC1/vKNz8wq+74PJ24U0MaXV887lc8g== X-Received: by 2002:adf:f501:: with SMTP id q1mr18051521wro.263.1579787361793; Thu, 23 Jan 2020 05:49:21 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:21 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 17/59] hw/core/Makefile: Group generic objects versus system-mode objects Date: Thu, 23 Jan 2020 14:48:20 +0100 Message-Id: <1579787342-27146-18-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::431 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé To ease review/modifications of this Makefile, group generic objects first, then system-mode specific ones, and finally peripherals (which are only used in system-mode). No logical changes introduced here. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20200118140619.26333-7-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/core/Makefile.objs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/hw/core/Makefile.objs b/hw/core/Makefile.objs index 2fea68c..a522b72 100644 --- a/hw/core/Makefile.objs +++ b/hw/core/Makefile.objs @@ -1,32 +1,32 @@ # core qdev-related obj files, also used by *-user: common-obj-y += qdev.o qdev-properties.o common-obj-y += bus.o +common-obj-y += cpu.o +common-obj-y += hotplug.o +common-obj-y += vmstate-if.o +# irq.o needed for qdev GPIO handling: +common-obj-y += irq.o + common-obj-$(CONFIG_SOFTMMU) += reset.o common-obj-$(CONFIG_SOFTMMU) += qdev-fw.o common-obj-$(CONFIG_SOFTMMU) += fw-path-provider.o -# irq.o needed for qdev GPIO handling: -common-obj-y += irq.o -common-obj-y += hotplug.o common-obj-$(CONFIG_SOFTMMU) += nmi.o common-obj-$(CONFIG_SOFTMMU) += vm-change-state-handler.o -common-obj-y += cpu.o -common-obj-y += vmstate-if.o +common-obj-$(CONFIG_SOFTMMU) += qdev-properties-system.o +common-obj-$(CONFIG_SOFTMMU) += sysbus.o +common-obj-$(CONFIG_SOFTMMU) += machine.o +common-obj-$(CONFIG_SOFTMMU) += null-machine.o +common-obj-$(CONFIG_SOFTMMU) += loader.o +common-obj-$(CONFIG_SOFTMMU) += machine-hmp-cmds.o +obj-$(CONFIG_SOFTMMU) += machine-qmp-cmds.o +obj-$(CONFIG_SOFTMMU) += numa.o common-obj-$(CONFIG_EMPTY_SLOT) += empty_slot.o common-obj-$(CONFIG_XILINX_AXI) += stream.o common-obj-$(CONFIG_PTIMER) += ptimer.o -common-obj-$(CONFIG_SOFTMMU) += sysbus.o -common-obj-$(CONFIG_SOFTMMU) += machine.o -common-obj-$(CONFIG_SOFTMMU) += loader.o common-obj-$(CONFIG_FITLOADER) += loader-fit.o -common-obj-$(CONFIG_SOFTMMU) += qdev-properties-system.o common-obj-$(CONFIG_REGISTER) += register.o common-obj-$(CONFIG_OR_IRQ) += or-irq.o common-obj-$(CONFIG_SPLIT_IRQ) += split-irq.o common-obj-$(CONFIG_PLATFORM_BUS) += platform-bus.o common-obj-$(CONFIG_GENERIC_LOADER) += generic-loader.o -common-obj-$(CONFIG_SOFTMMU) += null-machine.o - -obj-$(CONFIG_SOFTMMU) += machine-qmp-cmds.o -obj-$(CONFIG_SOFTMMU) += numa.o -common-obj-$(CONFIG_SOFTMMU) += machine-hmp-cmds.o From patchwork Thu Jan 23 13:48:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228133 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=bwufXO6M; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483Qxw0XDxz9sSL for ; Fri, 24 Jan 2020 02:22:44 +1100 (AEDT) Received: from localhost ([::1]:59226 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iueJd-0003pZ-DQ for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:22:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51390) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrN-0004yd-IY for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrM-0003KF-7I for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:25 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:42621) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrM-0003JC-0e; Thu, 23 Jan 2020 08:49:24 -0500 Received: by mail-wr1-x432.google.com with SMTP id q6so3119522wro.9; Thu, 23 Jan 2020 05:49:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=jY1ubrmRPI/N9e83it0SvGrTTTMW6ORYETMpVxkJm8s=; b=bwufXO6MzdcXkQkZ56t1PkveXG+D9Lqe9/6N6eQbIctpTi1JqTcgt2HqOgoHxIgaPC 02hQAtW+qjx1ZuEkpDkIrJbgLb9PWHfNI+2nCHXGR7aSCrc+/+gNdzSs5+lR44ag7Msd AYknKJzVn8DGZn/JIZreokSTXVjoOa5KdpX7MXMz+IWwOMkGEIUDUIFD4admzu1KlrYQ dORHrkj2ups/dxcPCIZr03kRJP0LvSabVVPVMVYPDhsZ9/QxNUoS7/l0Oiam2NHRu96x 0hW5TuxIX91V0KFSPOu9hffQiaPUXvN5VgzsSaG1xKGD444HyDnduJyBe5vjyXIfLkSA lWgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=jY1ubrmRPI/N9e83it0SvGrTTTMW6ORYETMpVxkJm8s=; b=Jzxxq4LjMPa1msY3c/Ps9zPyCcsfLtV16mPOykieZcoPApmw9P6ePS+r5Af/jV7uEI DLwl4lj30LU8EsmnicByLEfWc9/GBpU2fHQSeEFq76I509OdjAE6hDrZFMtniHpx9hJJ jGoxcuSZjWws8mkNVbtwK/mj+CCDNroyqsKba25XlrVh4CRytT1Flk5fqbByfvUnml/C 8bz57A8hxRLgXLuKP1h+DJHqG5JVhJA1fxAjPcTbWSE9lMPrPyIUM4wArJfNo4v0gGIh H/xT3DBVtDDPvDvvTEKwJXo/lFy9n3Vk22+9HA/wPsnJ6WoWG9/38cAAdFYo5/xMF6jG UUeg== X-Gm-Message-State: APjAAAUpHaNWOzM8jt0RKn3mMnlwo/Wjo2+Fh2T7poFrHVLsWuf4j2L3 +OsKBf0DPaaaeAFl3iacJSZ6U6Ob X-Google-Smtp-Source: APXvYqxasHh3K0y8gIm5bu4HQN4KwTRjyocD4qsJ+vhwZKFBeAM4e1n45Q6dUWaTrGnQZW9LXBm6Kg== X-Received: by 2002:adf:edc4:: with SMTP id v4mr17460405wro.336.1579787362779; Thu, 23 Jan 2020 05:49:22 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:22 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 18/59] target/i386: kvm: initialize feature MSRs very early Date: Thu, 23 Jan 2020 14:48:21 +0100 Message-Id: <1579787342-27146-19-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::432 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Some read-only MSRs affect the behavior of ioctls such as KVM_SET_NESTED_STATE. We can initialize them once and for all right after the CPU is realized, since they will never be modified by the guest. Reported-by: Qingua Cheng Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini Message-Id: <1579544504-3616-2-git-send-email-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- target/i386/kvm.c | 81 ++++++++++++++++++++++++++++++-------------------- target/i386/kvm_i386.h | 1 + 2 files changed, 49 insertions(+), 33 deletions(-) diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 7ee3202..f6dd6b7 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -67,6 +67,8 @@ * 255 kvm_msr_entry structs */ #define MSR_BUF_SIZE 4096 +static void kvm_init_msrs(X86CPU *cpu); + const KVMCapabilityInfo kvm_arch_required_capabilities[] = { KVM_CAP_INFO(SET_TSS_ADDR), KVM_CAP_INFO(EXT_CPUID), @@ -1842,6 +1844,8 @@ int kvm_arch_init_vcpu(CPUState *cs) has_msr_tsc_aux = false; } + kvm_init_msrs(cpu); + r = hyperv_init_vcpu(cpu); if (r) { goto fail; @@ -2660,11 +2664,53 @@ static void kvm_msr_entry_add_vmx(X86CPU *cpu, FeatureWordArray f) VMCS12_MAX_FIELD_INDEX << 1); } +static int kvm_buf_set_msrs(X86CPU *cpu) +{ + int ret = kvm_vcpu_ioctl(CPU(cpu), KVM_SET_MSRS, cpu->kvm_msr_buf); + if (ret < 0) { + return ret; + } + + if (ret < cpu->kvm_msr_buf->nmsrs) { + struct kvm_msr_entry *e = &cpu->kvm_msr_buf->entries[ret]; + error_report("error: failed to set MSR 0x%" PRIx32 " to 0x%" PRIx64, + (uint32_t)e->index, (uint64_t)e->data); + } + + assert(ret == cpu->kvm_msr_buf->nmsrs); + return 0; +} + +static void kvm_init_msrs(X86CPU *cpu) +{ + CPUX86State *env = &cpu->env; + + kvm_msr_buf_reset(cpu); + if (has_msr_arch_capabs) { + kvm_msr_entry_add(cpu, MSR_IA32_ARCH_CAPABILITIES, + env->features[FEAT_ARCH_CAPABILITIES]); + } + + if (has_msr_core_capabs) { + kvm_msr_entry_add(cpu, MSR_IA32_CORE_CAPABILITY, + env->features[FEAT_CORE_CAPABILITY]); + } + + /* + * Older kernels do not include VMX MSRs in KVM_GET_MSR_INDEX_LIST, but + * all kernels with MSR features should have them. + */ + if (kvm_feature_msrs && cpu_has_vmx(env)) { + kvm_msr_entry_add_vmx(cpu, env->features); + } + + assert(kvm_buf_set_msrs(cpu) == 0); +} + static int kvm_put_msrs(X86CPU *cpu, int level) { CPUX86State *env = &cpu->env; int i; - int ret; kvm_msr_buf_reset(cpu); @@ -2722,17 +2768,6 @@ static int kvm_put_msrs(X86CPU *cpu, int level) } #endif - /* If host supports feature MSR, write down. */ - if (has_msr_arch_capabs) { - kvm_msr_entry_add(cpu, MSR_IA32_ARCH_CAPABILITIES, - env->features[FEAT_ARCH_CAPABILITIES]); - } - - if (has_msr_core_capabs) { - kvm_msr_entry_add(cpu, MSR_IA32_CORE_CAPABILITY, - env->features[FEAT_CORE_CAPABILITY]); - } - /* * The following MSRs have side effects on the guest or are too heavy * for normal writeback. Limit them to reset or full state updates. @@ -2910,14 +2945,6 @@ static int kvm_put_msrs(X86CPU *cpu, int level) /* Note: MSR_IA32_FEATURE_CONTROL is written separately, see * kvm_put_msr_feature_control. */ - - /* - * Older kernels do not include VMX MSRs in KVM_GET_MSR_INDEX_LIST, but - * all kernels with MSR features should have them. - */ - if (kvm_feature_msrs && cpu_has_vmx(env)) { - kvm_msr_entry_add_vmx(cpu, env->features); - } } if (env->mcg_cap) { @@ -2933,19 +2960,7 @@ static int kvm_put_msrs(X86CPU *cpu, int level) } } - ret = kvm_vcpu_ioctl(CPU(cpu), KVM_SET_MSRS, cpu->kvm_msr_buf); - if (ret < 0) { - return ret; - } - - if (ret < cpu->kvm_msr_buf->nmsrs) { - struct kvm_msr_entry *e = &cpu->kvm_msr_buf->entries[ret]; - error_report("error: failed to set MSR 0x%" PRIx32 " to 0x%" PRIx64, - (uint32_t)e->index, (uint64_t)e->data); - } - - assert(ret == cpu->kvm_msr_buf->nmsrs); - return 0; + return kvm_buf_set_msrs(cpu); } diff --git a/target/i386/kvm_i386.h b/target/i386/kvm_i386.h index 7d0242f..00bde7a 100644 --- a/target/i386/kvm_i386.h +++ b/target/i386/kvm_i386.h @@ -46,4 +46,5 @@ bool kvm_enable_x2apic(void); bool kvm_has_x2apic_api(void); bool kvm_hv_vpindex_settable(void); + #endif From patchwork Thu Jan 23 13:48:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228183 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=d20n0S15; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483RRr1Hb5z9sSN for ; Fri, 24 Jan 2020 02:45:11 +1100 (AEDT) Received: from localhost ([::1]:59664 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuefM-00014R-Df for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:45:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51406) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrO-000503-Hd for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrN-0003LW-5f for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:26 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:54227) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrM-0003KN-Ut for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:25 -0500 Received: by mail-wm1-x32d.google.com with SMTP id m24so2637198wmc.3 for ; Thu, 23 Jan 2020 05:49:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=qaX9ibASrC+U4AOLQHROo7/WmwP1t+LSS0nvSrlZ/0c=; b=d20n0S15I4NT5fQEJ7D7WRfwl+FUe37oObbW38bPV57IPOWbVTK1LYvAkoy0+IlMHm lBDHXgzJdYyQBzDhTtPV2SRfB70+o3Lp6Nj950Y+ltJMZ7MOHo/+Y8xvmU1wgOHTQA27 xdEJkDdhla2Enb4udnzWyqgPw2NAKyp9aE5DxpqTiHto8BANxYZnJjBxYQzs54d7yBYZ wogxC8xr6AseKi4QSODX1whe17bbM3Djk5K9MamjTTtlsVpWkqNt8T0rNjd1WMbHWcQY buqW+O5A4e3JBb1iJqfobSEvTE7cCwcnUKJpnFOLNh0RnID2C1agOADgiUuFcQPHFcIe 4FKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=qaX9ibASrC+U4AOLQHROo7/WmwP1t+LSS0nvSrlZ/0c=; b=qX4IKM0y5eGBAfL4L+hIwrm9wQgdSz3+8m4Yphq4kwTkNzhA7kRpH/R/kLXLBoLDtr i3yZVc1DBtuhiMeBHg/SUXpluBzbOWD3zE2fufEK4m8AdMTvxNjd3GUk/ba97CRUMx5v jy6fqZZkwlvFD1owYFi6SIb/qnReQczzBzeMHVeXP5oNrQBJQutqHF6sEYzj2bfUqzQW fG9MrtWCXnJxQ5fB4cxjT/sTBa1BbUbrKMRzVGF95uhPni/jCnqOcZmByxGEZjS3oUZ6 ymGAdZ/eFZhoGufdHbZJpk/YSv61+Vfa3KR+eCovR4koggIr9DI92YgTaB2opFDYObwz ggTg== X-Gm-Message-State: APjAAAUeGu6okW8BS5PeGGIUq0c92g1fBxq1ksVDtwckV9xuOVDvaSww tdIUokvklw3MB+7ibtGrQoUTAfBO X-Google-Smtp-Source: APXvYqzvc4marP26fSl3Dz0Jrh90Zj5WO/ja3cd+BtajACURDCu2V7HkT8Eb8oJyodVNpqi0UnF+nw== X-Received: by 2002:a7b:c204:: with SMTP id x4mr4413993wmi.20.1579787363725; Thu, 23 Jan 2020 05:49:23 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:23 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 19/59] target/i386: add a ucode-rev property Date: Thu, 23 Jan 2020 14:48:22 +0100 Message-Id: <1579787342-27146-20-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32d X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Add the property and plumb it in TCG and HVF (the latter of which tried to support returning a constant value but used the wrong MSR). Signed-off-by: Paolo Bonzini Message-Id: <1579544504-3616-3-git-send-email-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 10 ++++++++++ target/i386/cpu.h | 3 +++ target/i386/hvf/x86_emu.c | 4 +--- target/i386/misc_helper.c | 4 ++++ 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 78bdb7c..790254e 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6418,6 +6418,15 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp) } } + if (cpu->ucode_rev == 0) { + /* The default is the same as KVM's. */ + if (IS_AMD_CPU(env)) { + cpu->ucode_rev = 0x01000065; + } else { + cpu->ucode_rev = 0x100000000ULL; + } + } + /* mwait extended info: needed for Core compatibility */ /* We always wake on interrupt even if host does not have the capability */ cpu->mwait.ecx |= CPUID_MWAIT_EMX | CPUID_MWAIT_IBE; @@ -7100,6 +7109,7 @@ static Property x86_cpu_properties[] = { DEFINE_PROP_UINT32("min-level", X86CPU, env.cpuid_min_level, 0), DEFINE_PROP_UINT32("min-xlevel", X86CPU, env.cpuid_min_xlevel, 0), DEFINE_PROP_UINT32("min-xlevel2", X86CPU, env.cpuid_min_xlevel2, 0), + DEFINE_PROP_UINT64("ucode-rev", X86CPU, ucode_rev, 0), DEFINE_PROP_BOOL("full-cpuid-auto-level", X86CPU, full_cpuid_auto_level, true), DEFINE_PROP_STRING("hv-vendor-id", X86CPU, hyperv_vendor_id), DEFINE_PROP_BOOL("cpuid-0xb", X86CPU, enable_cpuid_0xb, true), diff --git a/target/i386/cpu.h b/target/i386/cpu.h index e6de38a..576f309 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -348,6 +348,7 @@ typedef enum X86Seg { #define MSR_IA32_SPEC_CTRL 0x48 #define MSR_VIRT_SSBD 0xc001011f #define MSR_IA32_PRED_CMD 0x49 +#define MSR_IA32_UCODE_REV 0x8b #define MSR_IA32_CORE_CAPABILITY 0xcf #define MSR_IA32_ARCH_CAPABILITIES 0x10a @@ -1627,6 +1628,8 @@ struct X86CPU { CPUNegativeOffsetState neg; CPUX86State env; + uint64_t ucode_rev; + uint32_t hyperv_spinlock_attempts; char *hyperv_vendor_id; bool hyperv_synic_kvm_only; diff --git a/target/i386/hvf/x86_emu.c b/target/i386/hvf/x86_emu.c index 3df7672..92ab815 100644 --- a/target/i386/hvf/x86_emu.c +++ b/target/i386/hvf/x86_emu.c @@ -664,8 +664,6 @@ static void exec_lods(struct CPUX86State *env, struct x86_decode *decode) RIP(env) += decode->len; } -#define MSR_IA32_UCODE_REV 0x00000017 - void simulate_rdmsr(struct CPUState *cpu) { X86CPU *x86_cpu = X86_CPU(cpu); @@ -681,7 +679,7 @@ void simulate_rdmsr(struct CPUState *cpu) val = cpu_get_apic_base(X86_CPU(cpu)->apic_state); break; case MSR_IA32_UCODE_REV: - val = (0x100000000ULL << 32) | 0x100000000ULL; + val = x86_cpu->ucode_rev; break; case MSR_EFER: val = rvmcs(cpu->hvf_fd, VMCS_GUEST_IA32_EFER); diff --git a/target/i386/misc_helper.c b/target/i386/misc_helper.c index 3eff688..aed16fe 100644 --- a/target/i386/misc_helper.c +++ b/target/i386/misc_helper.c @@ -229,6 +229,7 @@ void helper_rdmsr(CPUX86State *env) #else void helper_wrmsr(CPUX86State *env) { + X86CPU *x86_cpu = env_archcpu(env); uint64_t val; cpu_svm_check_intercept_param(env, SVM_EXIT_MSR, 1, GETPC()); @@ -371,6 +372,9 @@ void helper_wrmsr(CPUX86State *env) env->msr_bndcfgs = val; cpu_sync_bndcs_hflags(env); break; + case MSR_IA32_UCODE_REV: + val = x86_cpu->ucode_rev; + break; default: if ((uint32_t)env->regs[R_ECX] >= MSR_MC0_CTL && (uint32_t)env->regs[R_ECX] < MSR_MC0_CTL + From patchwork Thu Jan 23 13:48:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228187 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=VSmqLjEf; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483RVZ6K5lz9sSN for ; Fri, 24 Jan 2020 02:47:34 +1100 (AEDT) Received: from localhost ([::1]:59708 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuehg-0004A5-Gu for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:47:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51422) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrP-000510-7v for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrO-0003NI-2e for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:27 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:33976) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrN-0003Li-Sq for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:26 -0500 Received: by mail-wr1-x42c.google.com with SMTP id t2so3184863wrr.1 for ; Thu, 23 Jan 2020 05:49:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=UMWrztDn+2LOmfXo42GQL/DUYv1hMbW6To+XMh241c8=; b=VSmqLjEfDORaSkkfqKJkOzc4jyped5SjgrwHODGjHHEBG/x9lAr76n1QWUR0qykeIa AR9o7H8pg7YAl40FtkbWGnDQZqIFKzPoVnq8lhcFUDoJxnR7gB1r5hmGrmivfQ33Re5r tscxSwOGICaQeLIHIOQ664HdXN7EL/CAKXzfhWetpTjhXLDmUzGTUp64AHjLwGi9G9PJ v0JODmi4LsJvn4HA5Xm33uqWBDr0CeMOjIY2gtk1NUMaiOciJXYYcYZg83tlyx9cEJfL e31HhHi791/xZzPOTXzUx8N+cZNNkE9QSTNG/O94aXRoeWLeCQsarZOSc5rH4rx+j6cf gUPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=UMWrztDn+2LOmfXo42GQL/DUYv1hMbW6To+XMh241c8=; b=P/yaCbNHsWmbDPqu6tZrzpHgkS78ebtnnkSdiv0rkbS2hYCb6qKAw6pSmNZlau1TjW KGSObF74BWu0Q6CS75ZbaBRO/e4U1CGTJnMZYKXwRETh3vjZopDL42vG2bkvd78Z4ob+ uTKIDXQLn6BoPICcaDvjoOuOmVJPipqpRnKHB2tH5VBRGrAvDDy84R1IP5Ckf/Sk4k6T dSdhBzaVNuAVWprQ+Z2D5Kb7nFE7gCTsehDlryDBv1XKYEopbR9t5Vi5Vn2lhod2lsxT cVSW2T5ugRrSRi+OaNvNK9JS4kXz9URYBTplyuMQXxzVYBivElGTqI2z6D17M3OqHH8h U/BQ== X-Gm-Message-State: APjAAAXWdQKq2tYN8yCnKo9HjJwmmvNhfPZH9OjoQcYMy16wWrJrk5Jt OI4OWpySZOIvMVmz03bYphhCvxp/ X-Google-Smtp-Source: APXvYqw3pudCNWgLIwx8kvTUfuoebXNC0GGHmXmGVuqkx20fLotv3YMtHr386pTSqYKMd78PXRGMOQ== X-Received: by 2002:a5d:6305:: with SMTP id i5mr18053571wru.399.1579787364676; Thu, 23 Jan 2020 05:49:24 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:24 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 20/59] target/i386: kvm: initialize microcode revision from KVM Date: Thu, 23 Jan 2020 14:48:23 +0100 Message-Id: <1579787342-27146-21-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" KVM can return the host microcode revision as a feature MSR. Use it as the default value for -cpu host. Signed-off-by: Paolo Bonzini Message-Id: <1579544504-3616-4-git-send-email-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 4 ++++ target/i386/kvm.c | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 790254e..ffe5de0 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6416,6 +6416,10 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp) &cpu->mwait.ecx, &cpu->mwait.edx); env->features[FEAT_1_ECX] |= CPUID_EXT_MONITOR; } + if (kvm_enabled() && cpu->ucode_rev == 0) { + cpu->ucode_rev = kvm_arch_get_supported_msr_feature(kvm_state, + MSR_IA32_UCODE_REV); + } } if (cpu->ucode_rev == 0) { diff --git a/target/i386/kvm.c b/target/i386/kvm.c index f6dd6b7..1b67090 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -2696,6 +2696,11 @@ static void kvm_init_msrs(X86CPU *cpu) env->features[FEAT_CORE_CAPABILITY]); } + if (kvm_arch_get_supported_msr_feature(kvm_state, + MSR_IA32_UCODE_REV)) { + kvm_msr_entry_add(cpu, MSR_IA32_UCODE_REV, cpu->ucode_rev); + } + /* * Older kernels do not include VMX MSRs in KVM_GET_MSR_INDEX_LIST, but * all kernels with MSR features should have them. From patchwork Thu Jan 23 13:48:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228248 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=BKebEUJc; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483S18369pz9sR1 for ; Fri, 24 Jan 2020 03:10:36 +1100 (AEDT) Received: from localhost ([::1]:60080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuf3x-0003tW-VX for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 11:10:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51447) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrQ-000524-54 for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrO-0003PH-QS for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:27 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:51545) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrO-0003NM-Jn for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:26 -0500 Received: by mail-wm1-x32d.google.com with SMTP id t23so2642906wmi.1 for ; Thu, 23 Jan 2020 05:49:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=a3Vb+m8pIg/1dpP/XvEglAqzMTsZNDlRtfXxmF7Em2c=; b=BKebEUJcRdIDLzX4bvuH2hSYhArhNnEu3syt5szEd5qZoSD0Jwl83Cwc0shkTOX6XU 0PR+QdilFtuPW19HFsL88DfNNjhioI/MokSeihtNUoAGuMIO9qIzANhELNmha1AWOaIZ TrrAdKsKX3FkkUrwjVN4T7W2PtO1aNWwPzBxUaQv/DB+Htqt9OMSbBhxavtRlXo96jt3 lw0X+6LlFZ3dh73Xd7CN0lFNK+xhH9pn1ee7Gtx1X/7Vd/aqoqtcF44rsMhi586XYhg5 hl9K2Wr9/+GOGQTvMvijFEC7ydDWcZx86puDgV4tVmI2pHUrckAx/MAzBqZpbWXQDTO1 XCqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=a3Vb+m8pIg/1dpP/XvEglAqzMTsZNDlRtfXxmF7Em2c=; b=iwz4zqnO/W/TRN4HavXJG3ldYZoLJvPJ+6sVW+ljJQ7nfCMde7bu4Bijs+XLV7R62w mgzmSDfZ+CcmL9eVxsWMVs/EB4zRFZKvypRCh+dBj457mPtq0BnzOQqKZQcLTqx4BlKr CgH/+vB80SlQ8hmjZW6tq71IlRESCmeKvCfBanvRtpGCPRasJEW3mklJNGAyj8LWap2M uepJWy0ccNAnyh8vW1SQZS8Uhi83TmBfQSIJXYFR+Bl/jOJQ4u36IzzLTfAQRMWq2wIi 91f1p6U2EvulovpqEi5w6NKlollgT1dt0ajB6RphkVa2NGq8hZ/BwkgAfoF/RpykEWFb WRig== X-Gm-Message-State: APjAAAUmXHKvB11DM5G+JA1focdc8YjAXuELPMFkyXtky4QGuHxhmja5 r4ArwUS1J7URL5wCmmhHcte1J5ez X-Google-Smtp-Source: APXvYqwpjt+zUCLrMp5EktQ2/r5SpanmA/igmsQC9I+RDMA6oLPp+OZRcdStGR8Ld1RD7tKMK5k5Ig== X-Received: by 2002:a05:600c:20f:: with SMTP id 15mr4286053wmi.128.1579787365492; Thu, 23 Jan 2020 05:49:25 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:24 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 21/59] virtio-scsi: delete vqs in unrealize to avoid memleaks Date: Thu, 23 Jan 2020 14:48:24 +0100 Message-Id: <1579787342-27146-22-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32d X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pan Nengyuan Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Pan Nengyuan This patch fix memleaks when attaching/detaching virtio-scsi device, the memory leak stack is as follow: Direct leak of 21504 byte(s) in 3 object(s) allocated from: #0 0x7f491f2f2970 (/lib64/libasan.so.5+0xef970) ??:? #1 0x7f491e94649d (/lib64/libglib-2.0.so.0+0x5249d) ??:? #2 0x564d0f3919fa (./x86_64-softmmu/qemu-system-x86_64+0x2c3e9fa) /mnt/sdb/qemu/hw/virtio/virtio.c:2333 #3 0x564d0f2eca55 (./x86_64-softmmu/qemu-system-x86_64+0x2b99a55) /mnt/sdb/qemu/hw/scsi/virtio-scsi.c:912 #4 0x564d0f2ece7b (./x86_64-softmmu/qemu-system-x86_64+0x2b99e7b) /mnt/sdb/qemu/hw/scsi/virtio-scsi.c:924 #5 0x564d0f39ee47 (./x86_64-softmmu/qemu-system-x86_64+0x2c4be47) /mnt/sdb/qemu/hw/virtio/virtio.c:3531 #6 0x564d0f980224 (./x86_64-softmmu/qemu-system-x86_64+0x322d224) /mnt/sdb/qemu/hw/core/qdev.c:865 Reported-by: Euler Robot Signed-off-by: Pan Nengyuan Reviewed-by: Stefan Hajnoczi Message-Id: <20200117075547.60864-2-pannengyuan@huawei.com> Signed-off-by: Paolo Bonzini --- hw/scsi/virtio-scsi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index 4bc73a3..858b3aa 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -943,7 +943,13 @@ void virtio_scsi_common_unrealize(DeviceState *dev) { VirtIODevice *vdev = VIRTIO_DEVICE(dev); VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(dev); + int i; + virtio_del_queue(vdev, 0); + virtio_del_queue(vdev, 1); + for (i = 0; i < vs->conf.num_queues; i++) { + virtio_del_queue(vdev, i + 2); + } g_free(vs->cmd_vqs); virtio_cleanup(vdev); } From patchwork Thu Jan 23 13:48:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228145 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=XkCtbHku; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483R0V3YLKz9sSP for ; Fri, 24 Jan 2020 02:24:58 +1100 (AEDT) Received: from localhost ([::1]:59264 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iueLn-0007Bb-Ve for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:24:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51470) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrQ-00053K-T1 for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrP-0003SD-Oz for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:28 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:55785) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrP-0003Ps-Ii for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:27 -0500 Received: by mail-wm1-x332.google.com with SMTP id q9so2635473wmj.5 for ; Thu, 23 Jan 2020 05:49:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=+U+IhI9S2shiMvtu75gJowqZ/s3WgewzmHW03jb/rC4=; b=XkCtbHkuWGN/UMK5R4mByTDuNLFXQnpP1hKyudOLDUPAlHjV3lYPfjQyFVXuyZENNr Wo++6EkWtjXbO5UrjRBnVVj3PwpE+AAJuj3KiQ56k3IZ1AgPIphVtzoIS1YAAhnguiV4 Mi9XwoBZDEMIN0FkJNSMmCwI7OR/00Kd01pWVepo76XvP6/+qT0e7hhI1OM86aorNwqp mtSsLBqKla92VyijvS8hjFjFIZ+fB8jxV5PWJSWFn6OpepUg+fEYFi7Hf0t8kI2iX9Lv 5SL3+TvL1gykIqrU0fml6gBgdsJSeEN0w/4cNbt+UzV9nScJ+TiacbpbthVSsM9+MmGT b68w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=+U+IhI9S2shiMvtu75gJowqZ/s3WgewzmHW03jb/rC4=; b=l2smaxIgTbHJCYZyBrDe5nKEa00pp5OhP0rZLXgso1JxFqlNPi0CNtGz1nsZmsYTJE ObueWORHPabJRraSOaMWrvDgezVQ9Cri4l2NFXZfWH5WlffHb5Ho/oWFabuDtF7z7uj2 1F+XEWoPfIraBPB6rQksK3+K/6GsdrM2f7ocgo1CpPZn36Xrsz5+jdKFFTr9DHyvJm34 45YQmM3WhcGqHP6cUuWtyKYa9shGAUs5flEgJPhmA0GBL1ul1e4sXZmyCb2YRpLQ/mpT IFcp6dP8g1mzE7rJlVsc+PjzGZK4NS0OerUbBiGvrxt59+/Fejj9hakCd35jZaiY/spZ H9IA== X-Gm-Message-State: APjAAAW3QJVmSvUtjYS8WrSbeTyK/0lVWQT2fGTigZlVAzwLO+DjfnmZ 3oOUPme5Yr6AueI9O17Sttpo9XUL X-Google-Smtp-Source: APXvYqxvtoehS1A+AMWeedPNn6Sjr/W437HQSZVz8NYb4nDK4unxNP+7yiE01GRXOeVUtjqzB/9cmA== X-Received: by 2002:a05:600c:2318:: with SMTP id 24mr4455975wmo.48.1579787366368; Thu, 23 Jan 2020 05:49:26 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:25 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 22/59] virtio-scsi: convert to new virtio_delete_queue Date: Thu, 23 Jan 2020 14:48:25 +0100 Message-Id: <1579787342-27146-23-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::332 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pan Nengyuan Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Pan Nengyuan Use virtio_delete_queue to make it more clear. Signed-off-by: Pan Nengyuan Reviewed-by: Stefan Hajnoczi Message-Id: <20200117075547.60864-3-pannengyuan@huawei.com> Signed-off-by: Paolo Bonzini --- hw/scsi/virtio-scsi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index 858b3aa..d3af42e 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -945,10 +945,10 @@ void virtio_scsi_common_unrealize(DeviceState *dev) VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(dev); int i; - virtio_del_queue(vdev, 0); - virtio_del_queue(vdev, 1); + virtio_delete_queue(vs->ctrl_vq); + virtio_delete_queue(vs->event_vq); for (i = 0; i < vs->conf.num_queues; i++) { - virtio_del_queue(vdev, i + 2); + virtio_delete_queue(vs->cmd_vqs[i]); } g_free(vs->cmd_vqs); virtio_cleanup(vdev); From patchwork Thu Jan 23 13:50:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228194 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=DdfOhXYT; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483RcW2q1Rz9sPW for ; Fri, 24 Jan 2020 02:52:43 +1100 (AEDT) Received: from localhost ([::1]:59792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuemf-0002vl-0M for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:52:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52566) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuctY-0008Rk-Lp for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:51:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iuctX-0008CH-MI for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:51:40 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:39833 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iuctX-0008C7-Jg for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:51:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579787499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4nZPBPEpS4N93wi4NNoDHelrGdOiS+pGdinBjcODOW8=; b=DdfOhXYTMrn4qk2KUjxv19wkRUCZS9hc19A8BWhTYcFEIn9MMM3yq7S5uymrm1bPCTAflN Nw3LmSa6hVj9nXBpqFiH5cMwZFE/SpBYV6/e0HFAzo8lXPbWy0kSXY9qCWNr+/H9syjZIe BrPozi5LvgMLo4dirJ+0wFQk1bfGOgU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-279-ilGF7TiLOGKOksutP83hDA-1; Thu, 23 Jan 2020 08:51:38 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 03C101137853 for ; Thu, 23 Jan 2020 13:51:36 +0000 (UTC) Received: from 640k.localdomain.com (unknown [10.36.112.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5D66B8575A; Thu, 23 Jan 2020 13:51:33 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 23/59] hw/ppc/spapr_rtas: Use local MachineState variable Date: Thu, 23 Jan 2020 14:50:13 +0100 Message-Id: <1579787449-27599-24-git-send-email-pbonzini@redhat.com> In-Reply-To: <1579787449-27599-1-git-send-email-pbonzini@redhat.com> References: <1579787449-27599-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: ilGF7TiLOGKOksutP83hDA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 207.211.31.81 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Since we have the MachineState already available locally, use it instead of the global current_machine. Reviewed-by: Greg Kurz Acked-by: David Gibson Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20200121110349.25842-2-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/ppc/spapr_rtas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c index 8d8d8cd..e88bb19 100644 --- a/hw/ppc/spapr_rtas.c +++ b/hw/ppc/spapr_rtas.c @@ -281,7 +281,7 @@ static void rtas_ibm_get_system_parameter(PowerPCCPU *cpu, "DesProcs=%d," "MaxPlatProcs=%d", max_cpus, - current_machine->ram_size / MiB, + ms->ram_size / MiB, ms->smp.cpus, max_cpus); if (pcc->n_host_threads > 0) { From patchwork Thu Jan 23 13:50:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228197 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Z2jwf1BM; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483Rfq6qqRz9sPW for ; Fri, 24 Jan 2020 02:54:43 +1100 (AEDT) Received: from localhost ([::1]:59824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iueob-0005pX-IH for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:54:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52585) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuctd-00008P-TE for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:51:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iuctc-0008Lo-UJ for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:51:45 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:40808 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iuctc-0008L4-RT for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:51:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579787504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7ZAKcaYK/1ruN2bloXbMQjJI12mYPfN7fiiBhG4qly8=; b=Z2jwf1BMjnEvJmCzXJ+dF9LHr5OHJwQxyXtHiUW2vVU3YEm+3EbFq6WdgZ/hKrgx3jxsJL zpnFE5ZBsPo1OCI2QfN1iClBnStfpiGjkYJV6rDnlliahAQTjKIZUCm8p9l5HF4moY5h8u Py0sNvtraMwd/DbQtCbLB02w+VImNQk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-44-Kanf8ig4PnKlizzvcjDxTw-1; Thu, 23 Jan 2020 08:51:42 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2979818CA25B for ; Thu, 23 Jan 2020 13:51:42 +0000 (UTC) Received: from 640k.localdomain.com (unknown [10.36.112.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 775BD85785; Thu, 23 Jan 2020 13:51:36 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 24/59] hw/ppc/spapr_rtas: Access MachineState via SpaprMachineState argument Date: Thu, 23 Jan 2020 14:50:14 +0100 Message-Id: <1579787449-27599-25-git-send-email-pbonzini@redhat.com> In-Reply-To: <1579787449-27599-1-git-send-email-pbonzini@redhat.com> References: <1579787449-27599-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: Kanf8ig4PnKlizzvcjDxTw-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé We received a SpaprMachineState argument. Since SpaprMachineState inherits of MachineState, use it instead of calling qdev_get_machine. Reviewed-by: Greg Kurz Acked-by: David Gibson Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20200121110349.25842-3-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/ppc/spapr_rtas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c index e88bb19..6f06e9d 100644 --- a/hw/ppc/spapr_rtas.c +++ b/hw/ppc/spapr_rtas.c @@ -267,7 +267,7 @@ static void rtas_ibm_get_system_parameter(PowerPCCPU *cpu, uint32_t nret, target_ulong rets) { PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu); - MachineState *ms = MACHINE(qdev_get_machine()); + MachineState *ms = MACHINE(spapr); unsigned int max_cpus = ms->smp.max_cpus; target_ulong parameter = rtas_ld(args, 0); target_ulong buffer = rtas_ld(args, 1); From patchwork Thu Jan 23 13:48:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228249 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=n8Q7bErZ; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483S2k0Ffdz9sR1 for ; Fri, 24 Jan 2020 03:11:58 +1100 (AEDT) Received: from localhost ([::1]:60104 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuf5H-0005lJ-LJ for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 11:11:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51531) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrT-00057E-Rx for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrS-0003ZU-Rw for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:31 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:37077) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrS-0003XL-Ko for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:30 -0500 Received: by mail-wm1-x335.google.com with SMTP id f129so2613150wmf.2 for ; Thu, 23 Jan 2020 05:49:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ivjz8iFRMvc+SVdpsYBWr7dQMjtFmxs9hPvui4StZIM=; b=n8Q7bErZI9CmlPWMT/KqNpKwm4f6wNLx/I5raQ6DuS8QSxtjP1disioZ8VQ6mk74ta J/3HykrYEC0hObby+PKJ7x4OalAD8V89mjBP996lG7p3m+NNPpcAPT06Jf9YCj1o7qRX pVrh+iqjNicFLB3jS2mVKGtpHSwZ28OO9YaGxzmQuDBeoVOvkZjkeR8Izt8A4DjypKcd JnhJuSq/5YD7nHPZtsj7X4pvCqLQe7wgFSC1fYzc5FOfZeneO0BKz0vO09XuSCdp1mG0 /TOAORfBD/I2rddWZkNEHkmhONLkaq+/8CaSpz7BKRPhnY9+CJS0EgSBN2evX8bJmxma eiNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Ivjz8iFRMvc+SVdpsYBWr7dQMjtFmxs9hPvui4StZIM=; b=A6uXbQSL2T8Gh1KH6B1pvCjjhXiqxtk2kCvNQDXOsoUEtFTcrLeFPMaKzCwWGROB6P zcPNvXdQHxfMQ0GvNNGwY9nZtWvSahA0XrHGQWMvqOj4APDkdVLQviupSf1t6vPsigiX Ytx6zOpctysK3sNxc+Q/YVu8jHfQ/zgB/yOwtKYxEkOUgBa3sZVu4LYTdjRCwulicsvj fqrWiyLykvLOuBK6Pjqt+2Hw99ta+V2fII1DFgFp/DKHAXsOU0QtPYHAmSMOJfJspp+J g+lf5IOk5UJ+47LS08rsE9Do07ssD+LYuprTY12JBGxuIuC0AAG0/5nf7sqY3Tf0xt9i J9kQ== X-Gm-Message-State: APjAAAWvC5O9/qJwx1cTtoI89aFeQXa7eHjMiuLjPXVO+v5fMksU8iWk mI2fMAwgdHwR8kfTcGm86Wr2WhH8 X-Google-Smtp-Source: APXvYqxHdkDyTRvX6t4qjPGYoHgDv269GRN7RdA3ICvXT4bW+315NyDW3Zon+xgnq/G+wgfC3PvMXQ== X-Received: by 2002:a7b:c119:: with SMTP id w25mr3417363wmi.116.1579787369415; Thu, 23 Jan 2020 05:49:29 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:28 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 25/59] hw/ppc/spapr_rtas: Remove local variable Date: Thu, 23 Jan 2020 14:48:28 +0100 Message-Id: <1579787342-27146-26-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::335 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé We only access this variable in the RTAS_SYSPARM_SPLPAR_CHARACTERISTICS case. Use it in place and remove the local declaration. Suggested-by: Greg Kurz Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20200121110349.25842-4-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/ppc/spapr_rtas.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c index 6f06e9d..85135e0 100644 --- a/hw/ppc/spapr_rtas.c +++ b/hw/ppc/spapr_rtas.c @@ -268,7 +268,6 @@ static void rtas_ibm_get_system_parameter(PowerPCCPU *cpu, { PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu); MachineState *ms = MACHINE(spapr); - unsigned int max_cpus = ms->smp.max_cpus; target_ulong parameter = rtas_ld(args, 0); target_ulong buffer = rtas_ld(args, 1); target_ulong length = rtas_ld(args, 2); @@ -280,10 +279,10 @@ static void rtas_ibm_get_system_parameter(PowerPCCPU *cpu, "DesMem=%" PRIu64 "," "DesProcs=%d," "MaxPlatProcs=%d", - max_cpus, + ms->smp.max_cpus, ms->ram_size / MiB, ms->smp.cpus, - max_cpus); + ms->smp.max_cpus); if (pcc->n_host_threads > 0) { char *hostthr_val, *old = param_val; From patchwork Thu Jan 23 13:50:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228226 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=cW7mP+GH; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483Rjs5mgxz9sSH for ; Fri, 24 Jan 2020 02:57:21 +1100 (AEDT) Received: from localhost ([::1]:59872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuer8-0000yS-93 for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:57:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52637) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuctk-0000IK-0R for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:51:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucti-00008J-WD for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:51:51 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:55109 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iucti-00007V-TF for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:51:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579787510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lxxsWczgJ89+Ohb/tyyLZer/UrAQ+OmM/+BuLx5zcqk=; b=cW7mP+GHRL2KkjubSvtynba5opn4U5R1UAFzC31XSi/Gnsv5vuT+uRxu5SbzmrKQdQSZdx o23u6wvgGUP6CRkfirWpMKMF24govs/0iM/aaD284k0jMoX9MxXiB2ngxLeybdMAWYAppH nodjsQ3yhcLdSsDR3NRxCbsdrWYdEpY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-336-vVNnUJH7P-SGlqSU2R5GLQ-1; Thu, 23 Jan 2020 08:51:48 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F154B80259F for ; Thu, 23 Jan 2020 13:51:47 +0000 (UTC) Received: from 640k.localdomain.com (unknown [10.36.112.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 461F08575A; Thu, 23 Jan 2020 13:51:45 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 26/59] target/arm/kvm: Use CPUState::kvm_state in kvm_arm_pmu_supported() Date: Thu, 23 Jan 2020 14:50:16 +0100 Message-Id: <1579787449-27599-27-git-send-email-pbonzini@redhat.com> In-Reply-To: <1579787449-27599-1-git-send-email-pbonzini@redhat.com> References: <1579787449-27599-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: vVNnUJH7P-SGlqSU2R5GLQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé KVMState is already accessible via CPUState::kvm_state, use it. Reviewed-by: Alistair Francis Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20200121110349.25842-5-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- target/arm/kvm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/arm/kvm.c b/target/arm/kvm.c index b87b59a..8d82889 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -181,9 +181,7 @@ void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu) bool kvm_arm_pmu_supported(CPUState *cpu) { - KVMState *s = KVM_STATE(current_machine->accelerator); - - return kvm_check_extension(s, KVM_CAP_ARM_PMU_V3); + return kvm_check_extension(cpu->kvm_state, KVM_CAP_ARM_PMU_V3); } int kvm_arm_get_max_vm_ipa_size(MachineState *ms) From patchwork Thu Jan 23 13:48:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228262 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=tde2CATV; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483S5K11wMz9sR1 for ; Fri, 24 Jan 2020 03:14:13 +1100 (AEDT) Received: from localhost ([::1]:60132 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuf7S-0000tj-K4 for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 11:14:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51555) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrV-00059Q-DL for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrU-0003dp-Cr for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:33 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:32914) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrU-0003bQ-6U for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:32 -0500 Received: by mail-wr1-x432.google.com with SMTP id b6so3193706wrq.0 for ; Thu, 23 Jan 2020 05:49:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kxEhjtEiGmz3JhKefGP6i9CMB+/OyKskAJ9ppHwR4AA=; b=tde2CATV/AmzKhBEGnx/NvDvcAKpIhm8SOFlQELRr47kL6SKdwP6NdgSl5BuFH7dhE Mnf6+H7k8wP8udSMVikFuEZ8zhKyDNzggPLdkBUb0jPCmutsAcHmPPzIHVU0ho/e/rAZ 5JMFQJAhOCq6V3cyYPzcB/SqtHCYDfV+fY43nVWBfQxE33rxCfavq7Gxs6Lk/Rgle0wq 2L1srQtNk3CrUEFXeKXLJHR18X4mYpl5Wxb5c0tmmwnLP08L6ZFUwUxNLNG7+FdAJnMW JuAvHz1sYai+tWULzOWf1TcWLiOAeK7hYJcM4F5hC56EbeipLUKmiSk/Tn37WSW+MPzn s6Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=kxEhjtEiGmz3JhKefGP6i9CMB+/OyKskAJ9ppHwR4AA=; b=q0bpYFTNyODJyDRcCqol71xOE+QYVpJgz6Y6nz/MRN4PCtkXPZ3Nx1yEplnkcNh5RI diTXoiEYHnUGx1Km6X+Gcy3zWvmc6MTdiyR5CEQTWyVfrz8SYRXUpRuZJtd5ewfRVj4h J1eIbjCNjC1K6OlM+O6M/Kq8n+JuEg6w62R58WOFJZ2SuMidiqYu8xppbpWd/wuulxAX FU/tttuRcT4RWmLzDW3zgtBDcm0UupA0dxI7ofdLQWSpg9Lkysjoij9iI9/bNmtMkXeZ xbyUGOhf/TsS0cBlFFJLpBeZq4nv73woQKEPWIVzmZFQxxdc1xxoLM8F8NBvLUby/Ebq BsQw== X-Gm-Message-State: APjAAAWvSXA/LtEZNj9fjZ3iSLiwDIyJohEEfJuesv6+OzpI8G1KyMAZ csjqw4TmeVWiJBmVKDhai1a/AD8L X-Google-Smtp-Source: APXvYqyRDq0QrH4BKXg8dN08K58gOGxaSkPRa/rF45H3B4dP12rQZtjRs4LtC23dD26wJwzM/8TU5w== X-Received: by 2002:adf:ee82:: with SMTP id b2mr17037429wro.194.1579787370954; Thu, 23 Jan 2020 05:49:30 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:30 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 27/59] qom/object: Display more helpful message when a parent is missing Date: Thu, 23 Jan 2020 14:48:30 +0100 Message-Id: <1579787342-27146-28-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::432 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé QEMU object model is scarse in documentation. Some calls are recursive, and it might be hard to figure out even trivial issues. We can avoid developers to waste time in a debugging session by displaying a simple error message. This commit is also similar to e02bdf1cecd2 ("Display more helpful message when an object type is missing"). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cornelia Huck Message-Id: <20200121110349.25842-7-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- qom/object.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qom/object.c b/qom/object.c index 36123fb..90155fa 100644 --- a/qom/object.c +++ b/qom/object.c @@ -173,7 +173,11 @@ static TypeImpl *type_get_parent(TypeImpl *type) { if (!type->parent_type && type->parent) { type->parent_type = type_get_by_name(type->parent); - g_assert(type->parent_type != NULL); + if (!type->parent_type) { + fprintf(stderr, "Type '%s' is missing its parent '%s'\n", + type->name, type->parent); + abort(); + } } return type->parent_type; From patchwork Thu Jan 23 13:48:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228189 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=fsJAKLi6; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483RXw2dFlz9sPW for ; Fri, 24 Jan 2020 02:49:36 +1100 (AEDT) Received: from localhost ([::1]:59734 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iueje-0006w7-7D for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:49:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51572) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrX-0005Br-86 for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrV-0003gU-5W for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:35 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:51554) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrU-0003dt-V6 for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:33 -0500 Received: by mail-wm1-x336.google.com with SMTP id t23so2643262wmi.1 for ; Thu, 23 Jan 2020 05:49:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8o2MYpvI7aFlrgYsavAuUGYtCTtrg8wkmD8yOXg8nnA=; b=fsJAKLi6UhEXrhKGxW9/uVdq7MtDu8rJJAwboEmWG13CgOtZpqyeTXFCB/Xf/1EbyN cEXWgR8OcsjFUVEcQxMlsuJnG+rbkBtKKWI/+nTWZfTcN61JtZ+FWA0mya5sXXRGUHLE pzVFm9VLYDcpEhckzDk53UD97FwaG1O3UAogA9ReXZAdsZ6FbPotondicqH4jEHB7frk DEAALTq31pdxf+x5S+pmk/ac+WABSwE6HVAjIab08yuiv0ATqAJRfxXs5vHgkFHwMsRQ EceSH0kXePf9LMHunNm+DkKbI71jcx/yomqgBXcAonKn3sgBVIS8sSNnEq9pVY3zvhC/ BkgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=8o2MYpvI7aFlrgYsavAuUGYtCTtrg8wkmD8yOXg8nnA=; b=WED+LnA/MddkFgD+yrg8HMQ9NFlZRkv1DB0yfDFYiM/jc0ZjXLhOnFtvqAviqPaMBC 7ebBNTXC6tcffQvZAeiGcIfo7csH5u2cR1uyj5emewSekbBQNtHp+wKn0HGbEIC0+qFG mdHGb1a39sPSS7rPl/bZvm9n5EouNMQM70abftJYw/Io35JBNFjA+VQBC8Qh4v7EM7PR 8ur44pUUfYA+RNuvlMSOPJIAvKp4cZ69zD1D5c9+YuaBEf6ywUZv9wM+NHisoCBvYmdr B3I1boJx03D7AZJU49uBoig/INQK2DoElTTbKF8WaUpxy4PGA3dEjYb/rrWvE2dc84BC BVpw== X-Gm-Message-State: APjAAAX6o+t9pvUSSX4h06ja7CLWQfLiYCUVhZ1Hg7wwVuTARFEO2DPE RTqdU5c7pJTqzPEfp3ppJR1CVrqP X-Google-Smtp-Source: APXvYqzYl8unTyylQ2Jwcf3aclmnpGyRHmmIUo38uCC23TFafCmfTcTevXz/zEA8+A2YmMiICmiYRg== X-Received: by 2002:a05:600c:1050:: with SMTP id 16mr4460164wmx.86.1579787371810; Thu, 23 Jan 2020 05:49:31 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:31 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 28/59] accel: Introduce the current_accel() wrapper Date: Thu, 23 Jan 2020 14:48:31 +0100 Message-Id: <1579787342-27146-29-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::336 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé The accel/ code only accesses the MachineState::accel field. As we simply want to access the accelerator, not the machine, add a current_accel() wrapper. Suggested-by: Paolo Bonzini Reviewed-by: Alistair Francis Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cornelia Huck Message-Id: <20200121110349.25842-9-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- accel/accel.c | 5 +++++ include/sysemu/accel.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/accel/accel.c b/accel/accel.c index 1c5c3a6..cb555e3 100644 --- a/accel/accel.c +++ b/accel/accel.c @@ -63,6 +63,11 @@ int accel_init_machine(AccelState *accel, MachineState *ms) return ret; } +AccelState *current_accel(void) +{ + return current_machine->accelerator; +} + void accel_setup_post(MachineState *ms) { AccelState *accel = ms->accelerator; diff --git a/include/sysemu/accel.h b/include/sysemu/accel.h index d4c1429..47e5788 100644 --- a/include/sysemu/accel.h +++ b/include/sysemu/accel.h @@ -70,4 +70,6 @@ int accel_init_machine(AccelState *accel, MachineState *ms); /* Called just before os_setup_post (ie just before drop OS privs) */ void accel_setup_post(MachineState *ms); +AccelState *current_accel(void); + #endif From patchwork Thu Jan 23 13:48:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228277 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=l9/Dg+eQ; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483SBb3M8Zz9sR1 for ; Fri, 24 Jan 2020 03:18:47 +1100 (AEDT) Received: from localhost ([::1]:60208 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iufBs-0006iV-Sz for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 11:18:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51606) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrY-0005EH-Kv for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrX-0003m4-3N for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:36 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:37078) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrW-0003gy-S1 for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:35 -0500 Received: by mail-wm1-x335.google.com with SMTP id f129so2613332wmf.2 for ; Thu, 23 Jan 2020 05:49:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sIQ5W5UHd6LBNn/RrQOAOd5yBbO+3FGu4Aq0XOiBiHM=; b=l9/Dg+eQZ75w9soBwCO6fh2v6EqLEzATIGICcRJRPZXmiipOkVkC8Yla8S1A1D+8pK rFbWamRgwQipXWdbO7PiiSRk/dLwNSqlgD2lG/wA07utjKOzFYg8qwN5szSonEe40y7D OARYAcrM+vH6grYXfxXD7CZLSLU0OkWgMeKGuRons0wyMTieqDWxdUQH7PwGdxzQVnQl +U0InAQek3KoCaoLI4cXeNMXs4md5kumYNaabZ49wI7bRduQVmLWcNHA1nYF11wxKHij LqBJLS49H2EAnedQ6kw8ZuwCw4v+u0g1e9fdhzASJ7cCZsBwCsN4flNV5D+C7Vf2LKxE qpDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=sIQ5W5UHd6LBNn/RrQOAOd5yBbO+3FGu4Aq0XOiBiHM=; b=KodbTBzrfiAm0QGIqWRsW1sPT+Oge2U16PJq5yQs7H9+Krmkz203Ed8UFJ1DmEoAS1 RPnEs4id68sbCg1SgLR6rhrfcrxWTyeXDwpJLmgG7wR54rCUYcHxTisA/H5FWiHJ/NX7 C9ZiDYTNUN8c7cog7UaqCeiQzFs7c0LbQCNWzzvqyPEuRWAlf7c2zNKYRS3LewtspOHC XMT8aYD0t9Gp7zjiRoJHmYQmHYLYBjFQLgQCtGx2LjT2AuVExD7JarjnrMaHZuU/fKzu Nii0jU5MrQDkVzqFZwc1o9JkhJ0XTeChx6oYZKORDtSe1COR8VMjygye4JujaR4ILeQW cYBA== X-Gm-Message-State: APjAAAWwx5+bZv40GjSnKw3gTeg+Xodv37PZ311RWWN5PiXpdggOBwMJ 65zq5nyi9yZDLpD/uNf5gtVcl6sZ X-Google-Smtp-Source: APXvYqw47qhhzW7kQNkUAeBOLynk2iTEnGb8NKNwJy/XBatNlpd22p8R/UMyBCeluw8DVqVqD4Aj6w== X-Received: by 2002:a7b:c204:: with SMTP id x4mr4414604wmi.20.1579787372743; Thu, 23 Jan 2020 05:49:32 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:32 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 29/59] accel: Replace current_machine->accelerator by current_accel() wrapper Date: Thu, 23 Jan 2020 14:48:32 +0100 Message-Id: <1579787342-27146-30-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::335 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé We actually want to access the accelerator, not the machine, so use the current_accel() wrapper instead. Suggested-by: Paolo Bonzini Reviewed-by: Alistair Francis Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20200121110349.25842-10-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- accel/kvm/kvm-all.c | 4 ++-- accel/tcg/tcg-all.c | 2 +- memory.c | 2 +- target/arm/kvm64.c | 5 ++--- target/i386/kvm.c | 2 +- target/ppc/kvm.c | 4 ++-- vl.c | 2 +- 7 files changed, 10 insertions(+), 11 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 1ada2f4..c111312 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -164,7 +164,7 @@ static NotifierList kvm_irqchip_change_notifiers = int kvm_get_max_memslots(void) { - KVMState *s = KVM_STATE(current_machine->accelerator); + KVMState *s = KVM_STATE(current_accel()); return s->nr_slots; } @@ -1848,7 +1848,7 @@ static int kvm_max_vcpu_id(KVMState *s) bool kvm_vcpu_id_is_valid(int vcpu_id) { - KVMState *s = KVM_STATE(current_machine->accelerator); + KVMState *s = KVM_STATE(current_accel()); return vcpu_id >= 0 && vcpu_id < kvm_max_vcpu_id(s); } diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index 1dc384c..1802ce0 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -124,7 +124,7 @@ static void tcg_accel_instance_init(Object *obj) static int tcg_init(MachineState *ms) { - TCGState *s = TCG_STATE(current_machine->accelerator); + TCGState *s = TCG_STATE(current_accel()); tcg_exec_init(s->tb_size * 1024 * 1024); cpu_interrupt_handler = tcg_handle_interrupt; diff --git a/memory.c b/memory.c index d7b9bb6..8547987 100644 --- a/memory.c +++ b/memory.c @@ -3104,7 +3104,7 @@ void mtree_info(bool flatview, bool dispatch_tree, bool owner) }; GArray *fv_address_spaces; GHashTable *views = g_hash_table_new(g_direct_hash, g_direct_equal); - AccelClass *ac = ACCEL_GET_CLASS(current_machine->accelerator); + AccelClass *ac = ACCEL_GET_CLASS(current_accel()); if (ac->has_memory) { fvi.ac = ac; diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index 876184b..e3c580e 100644 --- a/target/arm/kvm64.c +++ b/target/arm/kvm64.c @@ -26,7 +26,6 @@ #include "sysemu/kvm.h" #include "sysemu/kvm_int.h" #include "kvm_arm.h" -#include "hw/boards.h" #include "internals.h" static bool have_guest_debug; @@ -613,14 +612,14 @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) bool kvm_arm_aarch32_supported(CPUState *cpu) { - KVMState *s = KVM_STATE(current_machine->accelerator); + KVMState *s = KVM_STATE(current_accel()); return kvm_check_extension(s, KVM_CAP_ARM_EL1_32BIT); } bool kvm_arm_sve_supported(CPUState *cpu) { - KVMState *s = KVM_STATE(current_machine->accelerator); + KVMState *s = KVM_STATE(current_accel()); return kvm_check_extension(s, KVM_CAP_ARM_SVE); } diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 1b67090..6ef291d 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -149,7 +149,7 @@ bool kvm_allows_irq0_override(void) static bool kvm_x2apic_api_set_flags(uint64_t flags) { - KVMState *s = KVM_STATE(current_machine->accelerator); + KVMState *s = KVM_STATE(current_accel()); return !kvm_vm_enable_cap(s, KVM_CAP_X2APIC_API, 0, flags); } diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index b5799e6..06fd0cc 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -258,7 +258,7 @@ static void kvm_get_smmu_info(struct kvm_ppc_smmu_info *info, Error **errp) struct ppc_radix_page_info *kvm_get_radix_page_info(void) { - KVMState *s = KVM_STATE(current_machine->accelerator); + KVMState *s = KVM_STATE(current_accel()); struct ppc_radix_page_info *radix_page_info; struct kvm_ppc_rmmu_info rmmu_info; int i; @@ -2907,7 +2907,7 @@ void kvmppc_svm_off(Error **errp) return; } - rc = kvm_vm_ioctl(KVM_STATE(current_machine->accelerator), KVM_PPC_SVM_OFF); + rc = kvm_vm_ioctl(KVM_STATE(current_accel()), KVM_PPC_SVM_OFF); if (rc && rc != -ENOTTY) { error_setg_errno(errp, -rc, "KVM_PPC_SVM_OFF ioctl failed"); } diff --git a/vl.c b/vl.c index 9f5f477..368dda1 100644 --- a/vl.c +++ b/vl.c @@ -2824,7 +2824,7 @@ static void configure_accelerators(const char *progname) } if (init_failed) { - AccelClass *ac = ACCEL_GET_CLASS(current_machine->accelerator); + AccelClass *ac = ACCEL_GET_CLASS(current_accel()); error_report("falling back to %s", ac->name); } From patchwork Thu Jan 23 13:48:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228275 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=DLLV5iSe; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483S8T6QGPz9sSH for ; Fri, 24 Jan 2020 03:16:57 +1100 (AEDT) Received: from localhost ([::1]:60180 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iufA6-0004l9-Ld for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 11:16:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51583) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrX-0005Ct-So for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrW-0003kr-QR for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:35 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:36548) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrW-0003jb-KG for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:34 -0500 Received: by mail-wm1-x32b.google.com with SMTP id p17so2612951wma.1 for ; Thu, 23 Jan 2020 05:49:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=v/VgNXOBwqlXi77Cypci6UQXOG1m8+dEPsEh2RkKozI=; b=DLLV5iSesL9OJoKrYqawkYuFpirNytSCncrUG4k7Hn3OHOqwgE398wLZusCZnbXGaH 3bqQWsN9rI1UfdnAJ0b/yS0Iud6Q1UoaaowL5ZdPTGM7Yo9bxE+7D58R/KIa3rKJ0nMA nz0U3+zah4b0uSffMW4nX13NcG7vk+7vq83VVWoqa2++N/AICBG7yJu6zQSbc8r7JsjH ZCbcdA27wO580v5kGdsXfA6Iyzw7LNUXU1uytk0Bx6L17e2iCaMy443+UmiOEhSx8x0W HRX4WdWIwl9PA++jDy/SltV/hIdbDlJokICPH63dIgL4nQgSYr6PQra9I2zs2wGYQnLC PIrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=v/VgNXOBwqlXi77Cypci6UQXOG1m8+dEPsEh2RkKozI=; b=OPJJWIbXiSR4r+HeCGCtqR6xF99uZFVufd1s3nUNiWEaL8EP0iRWZSTWsBrHVFvYP0 E21TGnsVbPgdzpFTTXodbvmVUONL6dGxz+PQXgDOTIYqoDyvFW4+g/szvc/+3oWhVLwf A7+fTGxAhOu9rlXM42AZ4mIYvV3cnXTbTDfyreK+i3oRZ6pPsK2HowHco6YttqpJTxLt izWCPBM4B2M1VuZhpe3MkZXbcAYQWFzdYvSXUMaDtrFwX4OBx/kw0ljv3jJZuGVYqStH tC5WPlxSOGfw8XFcF8VOmi9OusLFj+ebOTLQQiv7J6TVUA3Q6u5dnVIMRwHBnklfBnOu 1qSQ== X-Gm-Message-State: APjAAAXB8NPIbuhw8Wf+JrW5UHUNn6LyzP3FwEcMUzEXRMcd1xSXjRZI XkpMm2UnqvTNdRle9aITMs927r1x X-Google-Smtp-Source: APXvYqxQ0Edf/75PjdyMiqSqCPJVTmes/9ooXVwvK/QkMWGN5wLW8BiV/9yAwpIHq8rSX4T5j5Q2jg== X-Received: by 2002:a7b:cbc9:: with SMTP id n9mr4424211wmi.89.1579787373537; Thu, 23 Jan 2020 05:49:33 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:33 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 30/59] accel/tcg: Sanitize include path Date: Thu, 23 Jan 2020 14:48:33 +0100 Message-Id: <1579787342-27146-31-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32b X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Commit af0440ae852 moved the qemu_tcg_configure() function, but introduced extraneous 'include/' in the includes path. As it is not necessary, remove it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cornelia Huck Message-Id: <20200121110349.25842-11-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- accel/tcg/tcg-all.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index 1802ce0..acfdcfd 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -31,9 +31,9 @@ #include "sysemu/cpus.h" #include "qemu/main-loop.h" #include "tcg/tcg.h" -#include "include/qapi/error.h" -#include "include/qemu/error-report.h" -#include "include/hw/boards.h" +#include "qapi/error.h" +#include "qemu/error-report.h" +#include "hw/boards.h" #include "qapi/qapi-builtin-visit.h" typedef struct TCGState { From patchwork Thu Jan 23 13:48:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228162 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=sRy8iOPN; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483R2z09MXz9sPW for ; Fri, 24 Jan 2020 02:27:07 +1100 (AEDT) Received: from localhost ([::1]:59306 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iueNs-0001zx-N8 for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:27:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51610) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrY-0005Ei-Pe for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrX-0003pm-PI for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:36 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:35779) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrX-0003lj-Iy for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:35 -0500 Received: by mail-wm1-x32b.google.com with SMTP id p17so2626280wmb.0 for ; Thu, 23 Jan 2020 05:49:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ep2zLWRWUErqyW26G/7lhPUdGhrXWSwt7t7lct6ZAZY=; b=sRy8iOPNqjb9Q0e2dDwtuRigFidACVrae3MelcvgkdCPP+ArYPOnJAlPxN21NoOPS0 4sct7Lr1t7i6GZe2+TVWQTIGbzCn75rWzZyh2b9T2YGp/WRPYmo3hyPy63NMu+kP5IGp SqKwMKwKiicnAonCavYGT+14n8nxy6AbPIzpoIF4N6qHSwa/emeigKZhnf8qdqmwc8I9 chyUg/GKnjtGgP/5l/Vb1dMBSDKeYrP1WJp/jA9onsw6dj3GtujQW7iWc2QyWkssmBAV 7qR1dUUa2pcVrUtQHm6E8bfIAobPZaYYrpHzq3yOJVby2HAahgCuFEs7XUfJxBx4rqYp YFIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ep2zLWRWUErqyW26G/7lhPUdGhrXWSwt7t7lct6ZAZY=; b=N9UXYUhbE40jQu9WvaPna8oJZOEik0wqcBFrFP//3ZdiyGi3UgTjnru/T3nX5m/XYI oTL+5fHPOy1IY5RDtd/AXcID/UzhFyQqCKFqKfJC3tB1lxnL1WGxLJmEgAC038XiERK7 9tIZH+TaVFZDcZiYCYHz+vWaVbREviiuULAgOcRk4bnhqmvZ3k9BVAa/McHLG3w+7LDD QwuUha9q+ziRBt6hBI4Pi6EDiYIoG+Dfm1xbP+cWTZYQSsMRwi3crJWYCIbP0JkRxQ+H Wx8a/b1PojwIm8S9guReJebUeVbkOSd/xGYlPXvcMVWR6WDF+37uqdUAG6lv3sLO1d4q MIRQ== X-Gm-Message-State: APjAAAWTX2dhwEWbyvbSZRBoMcm12vgp3LrUFXKjJm33uASMphA9YnN0 RbXj+KUjqK7NyfxXXhgBLhWD2C/6 X-Google-Smtp-Source: APXvYqyPtPwo4u5aktCz6eQ0F5hMEgXvZG5rGa+U9tUQtKJcRAcTxTBgGp82kgslX/PZCP7WeVXpgw== X-Received: by 2002:a05:600c:54c:: with SMTP id k12mr4320665wmc.124.1579787374395; Thu, 23 Jan 2020 05:49:34 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:33 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 31/59] object: add extra sanity checks Date: Thu, 23 Jan 2020 14:48:34 +0100 Message-Id: <1579787342-27146-32-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32b X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Type system checked that children class_size >= parent class_size, but not instances. Fix that. Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20200110153039.1379601-2-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- qom/object.c | 1 + 1 file changed, 1 insertion(+) diff --git a/qom/object.c b/qom/object.c index 90155fa..dcb6863 100644 --- a/qom/object.c +++ b/qom/object.c @@ -307,6 +307,7 @@ static void type_initialize(TypeImpl *ti) int i; g_assert(parent->class_size <= ti->class_size); + g_assert(parent->instance_size <= ti->instance_size); memcpy(ti->class, parent->class, parent->class_size); ti->class->interfaces = NULL; ti->class->properties = g_hash_table_new_full( From patchwork Thu Jan 23 13:48:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228285 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=VItPUOK7; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483SFD6Xwxz9sSH for ; Fri, 24 Jan 2020 03:21:04 +1100 (AEDT) Received: from localhost ([::1]:60254 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iufE5-0002Xm-JU for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 11:21:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51623) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrZ-0005Fl-JY for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrY-0003tP-Ix for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:37 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:54627) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrY-0003pw-Ce for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:36 -0500 Received: by mail-wm1-x331.google.com with SMTP id b19so2629274wmj.4 for ; Thu, 23 Jan 2020 05:49:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kb+EYMV7I0i7u1W/G6zmMLHU6IYUgpjoqADdG+CD2XM=; b=VItPUOK7AulvllwpzmXLbubCZhFtLOdA9WKq4zE/vxoFCTkh/pVZkf2YWODXyEtv1+ g97Rz7B66fkkwkkk6X2d2UwYnayFFO7StZ03aY6AJR2aSERoGzFRw9gTElboYM9WJ4Bt 1SAWbb4uTx3LtpaYOFJh2Cpbx4dHe9oON2HseadjJLPwC9QVQ3DsUEGunVL/l/xudQWY yj4CRshabQYpDBAoLOZoiqPJsx2uEj6GP1JxSBsHrOApXB8MyttYhZ8tnESr/M2plMwf EXLV9XM4rnHSacLcwNYu4rF7qO7L5OBFE2KKLFD3NiIgQGdFGeUkRj1zja/KnYEvMhJi 9AFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=kb+EYMV7I0i7u1W/G6zmMLHU6IYUgpjoqADdG+CD2XM=; b=QJB1U6pXq2QT5nVMh8/PVNhdAaSFQHyF4s5KJgOFkMNjEFXokGjiksimuBvMPiIuoY XCT6IDVhe5tZIRYD+pxJTV2jLjw8pjxDnpr5xsC/vztlFckzAbKy2xmVgKy3PKKZaVbU S69eCV9vSkhETscs4UDwMbUnLIDlSHc1BznHXhROHk9RwLu+1OePM0bpWd+hOvMT+mVk bMg11dsixUxq6VNZa2s5Zr7b58/wBeGhC8eJIyACQQZh7HLP7soFQCmSBEP0mgg1wC5q VeMNq6SB36UYAeuccooBFToX1IWWujUJYModYrFq+1uhGgpbUJdd60D06egSpGxFHqkG 8dng== X-Gm-Message-State: APjAAAW8KEdjVC6x1RTe/dH7TfFeJdBpHjF1YR7ZVyvMs149tgUE7CLM KNKNJz8McDS4x865hMS8nBmzRjda X-Google-Smtp-Source: APXvYqxenBqB4yj/vIAoRLi8rqhZkB1O1gpLvrw2n+HX2ASui1FPQGCuEFkXdX6Rb5mvPItT6mBPjQ== X-Received: by 2002:a05:600c:d5:: with SMTP id u21mr1204530wmm.98.1579787375204; Thu, 23 Jan 2020 05:49:35 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:34 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 32/59] qdev: remove duplicated qdev_property_add_static() doc Date: Thu, 23 Jan 2020 14:48:35 +0100 Message-Id: <1579787342-27146-33-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::331 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau The function is already documented in the header. Signed-off-by: Marc-André Lureau Message-Id: <20200110153039.1379601-3-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- hw/core/qdev.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 58e87d3..b47dc07 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -717,16 +717,6 @@ static void qdev_property_add_legacy(DeviceState *dev, Property *prop, g_free(name); } -/** - * qdev_property_add_static: - * @dev: Device to add the property to. - * @prop: The qdev property definition. - * @errp: location to store error information. - * - * Add a static QOM property to @dev for qdev property @prop. - * On error, store error in @errp. Static properties access data in a struct. - * The type of the QOM property is derived from prop->info. - */ void qdev_property_add_static(DeviceState *dev, Property *prop, Error **errp) { From patchwork Thu Jan 23 13:48:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228165 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=VjAs6WXM; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483R5S1CNVz9sPW for ; Fri, 24 Jan 2020 02:29:16 +1100 (AEDT) Received: from localhost ([::1]:59326 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuePx-0005FF-SQ for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:29:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51639) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucra-0005Hm-Sp for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrZ-0003xq-Ce for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:38 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:55789) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrZ-0003tm-55 for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:37 -0500 Received: by mail-wm1-x335.google.com with SMTP id q9so2636076wmj.5 for ; Thu, 23 Jan 2020 05:49:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wOZKXE7AorDry02zwCbHQd2VJJlOO0auii3FGQwWC48=; b=VjAs6WXMmqWPkBZfM9WJdJ39aEbu49bbcM0h9eMYw/J4uuzLZMsUAkq4MOVDHAZ4tD zH1VJIq6IezJmfkpSumT1rzpeYtBjftzreYHBCrVcI3d/qKmQPEDdQcGgKWpPW0mrNm8 FSpEDPftoXZfhWnEwL9GVClekbi78tSWDrIR2amWzYjWZVl8AIlCCdHpVp/HrdkGZIc2 Loq5wl55EG3nsf5BF9xfKIL6zKXoZLOwcv7oVElSf5pQF15vbpNzl4SGNEuWiFVqW4Fc tQI5hwUsstpzZXolhTFTAPuwATB+oymgOWiIng6iA5j7eZjB5LAXtn7ZRsZ7xdz0FkI4 0Hqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=wOZKXE7AorDry02zwCbHQd2VJJlOO0auii3FGQwWC48=; b=L9ge6CIVLs6yyiBMJ0bg5vKGEKBrarPfrEmNZhdOlyCHz572OyrDyf0fdQebCHJMzO m46sTAFMvYz9HwfBwSzrMlrqvGv4kq45eWIcRBnLottY7NoDEpb96zrMQzRvp23IQdv2 oP4qb4qrnVEMGHcjRLDaMP/EsjDUr3DKaca7l8viv7t2nl0cvYyKuoKKYqQWblJ460pI ltSHy8X7MXIBwmeOCVgJDz2PCYBKyFLv1GyQnva1dDiVvRUHRbIrqmtCgWTCFye4pkW6 r1nyhxnTuBVVfy3DjGMt5C64nmdo3xJW3vmFeL9PDuBnWoCyVnN8mm0pkTShY8H/IPZo aPiQ== X-Gm-Message-State: APjAAAV9vjYT4rEhsq8egTdpfVg5mU6V3+decP2kPz4W/96+zA6h4UjO ncpQc5QjCYAz8SOgcn07Cz+OLqfJ X-Google-Smtp-Source: APXvYqx5BGq6bmGTmqnu+hlYgoACuIcZqwp4NMRg6le4qfa50fLZwbJuLCnrT5ojRRVk1OFzwq1nxg== X-Received: by 2002:a1c:5f41:: with SMTP id t62mr4429316wmb.42.1579787376018; Thu, 23 Jan 2020 05:49:36 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:35 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 33/59] qdev: remove extraneous error Date: Thu, 23 Jan 2020 14:48:36 +0100 Message-Id: <1579787342-27146-34-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::335 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau All callers use error_abort, and even the function itself calls with error_abort. Signed-off-by: Marc-André Lureau Message-Id: <20200110153039.1379601-4-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- hw/core/qdev.c | 15 ++++----------- include/hw/qdev-properties.h | 3 +-- target/arm/cpu.c | 36 ++++++++++++------------------------ 3 files changed, 17 insertions(+), 37 deletions(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index b47dc07..60aec8b 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -717,24 +717,17 @@ static void qdev_property_add_legacy(DeviceState *dev, Property *prop, g_free(name); } -void qdev_property_add_static(DeviceState *dev, Property *prop, - Error **errp) +void qdev_property_add_static(DeviceState *dev, Property *prop) { - Error *local_err = NULL; Object *obj = OBJECT(dev); if (prop->info->create) { - prop->info->create(obj, prop, &local_err); + prop->info->create(obj, prop, &error_abort); } else { object_property_add(obj, prop->name, prop->info->name, prop->info->get, prop->info->set, prop->info->release, - prop, &local_err); - } - - if (local_err) { - error_propagate(errp, local_err); - return; + prop, &error_abort); } object_property_set_description(obj, prop->name, @@ -989,7 +982,7 @@ static void device_initfn(Object *obj) do { for (prop = DEVICE_CLASS(class)->props; prop && prop->name; prop++) { qdev_property_add_legacy(dev, prop, &error_abort); - qdev_property_add_static(dev, prop, &error_abort); + qdev_property_add_static(dev, prop); } class = object_class_get_parent(class); } while (class != object_class_by_name(TYPE_DEVICE)); diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h index a90a9ce..906e697 100644 --- a/include/hw/qdev-properties.h +++ b/include/hw/qdev-properties.h @@ -253,13 +253,12 @@ void error_set_from_qdev_prop_error(Error **errp, int ret, DeviceState *dev, * qdev_property_add_static: * @dev: Device to add the property to. * @prop: The qdev property definition. - * @errp: location to store error information. * * Add a static QOM property to @dev for qdev property @prop. * On error, store error in @errp. Static properties access data in a struct. * The type of the QOM property is derived from prop->info. */ -void qdev_property_add_static(DeviceState *dev, Property *prop, Error **errp); +void qdev_property_add_static(DeviceState *dev, Property *prop); void qdev_alias_all_properties(DeviceState *target, Object *source); diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 411faaa..d161da8 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1104,26 +1104,22 @@ void arm_cpu_post_init(Object *obj) if (arm_feature(&cpu->env, ARM_FEATURE_CBAR) || arm_feature(&cpu->env, ARM_FEATURE_CBAR_RO)) { - qdev_property_add_static(DEVICE(obj), &arm_cpu_reset_cbar_property, - &error_abort); + qdev_property_add_static(DEVICE(obj), &arm_cpu_reset_cbar_property); } if (!arm_feature(&cpu->env, ARM_FEATURE_M)) { - qdev_property_add_static(DEVICE(obj), &arm_cpu_reset_hivecs_property, - &error_abort); + qdev_property_add_static(DEVICE(obj), &arm_cpu_reset_hivecs_property); } if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) { - qdev_property_add_static(DEVICE(obj), &arm_cpu_rvbar_property, - &error_abort); + qdev_property_add_static(DEVICE(obj), &arm_cpu_rvbar_property); } if (arm_feature(&cpu->env, ARM_FEATURE_EL3)) { /* Add the has_el3 state CPU property only if EL3 is allowed. This will * prevent "has_el3" from existing on CPUs which cannot support EL3. */ - qdev_property_add_static(DEVICE(obj), &arm_cpu_has_el3_property, - &error_abort); + qdev_property_add_static(DEVICE(obj), &arm_cpu_has_el3_property); #ifndef CONFIG_USER_ONLY object_property_add_link(obj, "secure-memory", @@ -1136,8 +1132,7 @@ void arm_cpu_post_init(Object *obj) } if (arm_feature(&cpu->env, ARM_FEATURE_EL2)) { - qdev_property_add_static(DEVICE(obj), &arm_cpu_has_el2_property, - &error_abort); + qdev_property_add_static(DEVICE(obj), &arm_cpu_has_el2_property); } if (arm_feature(&cpu->env, ARM_FEATURE_PMU)) { @@ -1154,32 +1149,27 @@ void arm_cpu_post_init(Object *obj) if (arm_feature(&cpu->env, ARM_FEATURE_VFP)) { cpu->has_vfp = true; if (!kvm_enabled()) { - qdev_property_add_static(DEVICE(obj), &arm_cpu_has_vfp_property, - &error_abort); + qdev_property_add_static(DEVICE(obj), &arm_cpu_has_vfp_property); } } if (arm_feature(&cpu->env, ARM_FEATURE_NEON)) { cpu->has_neon = true; if (!kvm_enabled()) { - qdev_property_add_static(DEVICE(obj), &arm_cpu_has_neon_property, - &error_abort); + qdev_property_add_static(DEVICE(obj), &arm_cpu_has_neon_property); } } if (arm_feature(&cpu->env, ARM_FEATURE_M) && arm_feature(&cpu->env, ARM_FEATURE_THUMB_DSP)) { - qdev_property_add_static(DEVICE(obj), &arm_cpu_has_dsp_property, - &error_abort); + qdev_property_add_static(DEVICE(obj), &arm_cpu_has_dsp_property); } if (arm_feature(&cpu->env, ARM_FEATURE_PMSA)) { - qdev_property_add_static(DEVICE(obj), &arm_cpu_has_mpu_property, - &error_abort); + qdev_property_add_static(DEVICE(obj), &arm_cpu_has_mpu_property); if (arm_feature(&cpu->env, ARM_FEATURE_V7)) { qdev_property_add_static(DEVICE(obj), - &arm_cpu_pmsav7_dregion_property, - &error_abort); + &arm_cpu_pmsav7_dregion_property); } } @@ -1198,12 +1188,10 @@ void arm_cpu_post_init(Object *obj) NULL, NULL, &error_abort); } - qdev_property_add_static(DEVICE(obj), &arm_cpu_cfgend_property, - &error_abort); + qdev_property_add_static(DEVICE(obj), &arm_cpu_cfgend_property); if (arm_feature(&cpu->env, ARM_FEATURE_GENERIC_TIMER)) { - qdev_property_add_static(DEVICE(cpu), &arm_cpu_gt_cntfrq_property, - &error_abort); + qdev_property_add_static(DEVICE(cpu), &arm_cpu_gt_cntfrq_property); } } From patchwork Thu Jan 23 13:48:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228168 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=B11h9vC8; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483R9P3p8fz9sPW for ; Fri, 24 Jan 2020 02:32:41 +1100 (AEDT) Received: from localhost ([::1]:59500 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iueTG-0000eh-OH for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:32:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51647) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrb-0005Ik-DI for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucra-00042M-6n for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:39 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:42618) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucra-0003yD-04 for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:38 -0500 Received: by mail-wr1-x42c.google.com with SMTP id q6so3120238wro.9 for ; Thu, 23 Jan 2020 05:49:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iMY7RCyLDjVvD/6DMcsQnff3G2M3+BaxKEPV2kf0Sdo=; b=B11h9vC83d5DX0RkqTTv9sx7Q7jXyKLFhtU7h63Qa0zeZr3NRynrFYzWwVbPs5NSAy Ijz/pXUodkRbllvzhuO0EMzH1QdeFe1O6GYhF121iQH3VLUUWb0forb0h7KWPYZ8J4Ij 6ylvnBlfBadurrb/YX+50E2yMuBWJ4uWSphaw9jgX9rnbB4Jwek7twrF1sHzzwNdvRL+ ootgy8NOWV3a5TTeMywcj2lgJ9aozjcEJtJSUuxYAb5frdPB3DSJ0U/MXVC42nMQmqDN wfID7t34uU9K/mcTXFV5TuoBAvyLcDyXJCMxkiARSt+EfJYI2r76E/n2z18cWgCTWNuT fd0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=iMY7RCyLDjVvD/6DMcsQnff3G2M3+BaxKEPV2kf0Sdo=; b=qY4++3jSGYwc9/Sl1PI8OcCCeaxqpOaJQRO+vCgGfZ6k7hJctNGlbvQRe9IpV6gWh+ OXxcEKiuExQWuWmaPDSXagL+JWKu6YbdcFc7SiNur2hbp8QZMOBYAoxOaGMx5i8HVzXH 8iqYK1xHoG5k5H6/1MYqP9knbfPQ5Y3P46h9VbDu/Y5aQiz5TKb/gJKafplwcweC8/wd GwEu2fH8jxjBtrSRnB/dD45LWrv3TjNRXPTPj8WuUO7P4Hijwm0OoK8yx+z9pHSlCWpG ruT4Emv0OCdqMRvq0oWHU8XfcixgSmjE335+dl+ijF0b5xOR92GOpqu9QXtClusslZL9 9lWQ== X-Gm-Message-State: APjAAAXhBFEibv1muDeO6cNYqneU9vqmocc1f0OeHMF2rYADGpLnpk6P ejSz0B8ri5hKCpjN0ppPTXoiepgi X-Google-Smtp-Source: APXvYqzO/wfzNBsPUxWqsX52SJ/PORF98s8kBd5OzOY0JXkcvF9O/qESv5FHWKRy5Y7qIOprMaKSqg== X-Received: by 2002:adf:df03:: with SMTP id y3mr17892903wrl.260.1579787376819; Thu, 23 Jan 2020 05:49:36 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:36 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 34/59] qdev: move helper function to monitor/misc Date: Thu, 23 Jan 2020 14:48:37 +0100 Message-Id: <1579787342-27146-35-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Move the one-user function to the place it is being used. Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20200110153039.1379601-5-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- hw/core/qdev.c | 26 -------------------------- include/hw/qdev-core.h | 2 -- monitor/misc.c | 26 ++++++++++++++++++++++++++ 3 files changed, 26 insertions(+), 28 deletions(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 60aec8b..8708605 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -760,32 +760,6 @@ void qdev_alias_all_properties(DeviceState *target, Object *source) } while (class != object_class_by_name(TYPE_DEVICE)); } -static int qdev_add_hotpluggable_device(Object *obj, void *opaque) -{ - GSList **list = opaque; - DeviceState *dev = (DeviceState *)object_dynamic_cast(OBJECT(obj), - TYPE_DEVICE); - - if (dev == NULL) { - return 0; - } - - if (dev->realized && object_property_get_bool(obj, "hotpluggable", NULL)) { - *list = g_slist_append(*list, dev); - } - - return 0; -} - -GSList *qdev_build_hotpluggable_device_list(Object *peripheral) -{ - GSList *list = NULL; - - object_child_foreach(peripheral, qdev_add_hotpluggable_device, &list); - - return list; -} - static bool device_get_realized(Object *obj, Error **errp) { DeviceState *dev = DEVICE(obj); diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 1518495..6b0e7b2 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -457,8 +457,6 @@ extern bool qdev_hot_removed; char *qdev_get_dev_path(DeviceState *dev); -GSList *qdev_build_hotpluggable_device_list(Object *peripheral); - void qbus_set_hotplug_handler(BusState *bus, Object *handler, Error **errp); void qbus_set_bus_hotplug_handler(BusState *bus, Error **errp); diff --git a/monitor/misc.c b/monitor/misc.c index de1ca4d..4752150 100644 --- a/monitor/misc.c +++ b/monitor/misc.c @@ -1959,6 +1959,32 @@ void object_add_completion(ReadLineState *rs, int nb_args, const char *str) g_slist_free(list); } +static int qdev_add_hotpluggable_device(Object *obj, void *opaque) +{ + GSList **list = opaque; + DeviceState *dev = (DeviceState *)object_dynamic_cast(OBJECT(obj), + TYPE_DEVICE); + + if (dev == NULL) { + return 0; + } + + if (dev->realized && object_property_get_bool(obj, "hotpluggable", NULL)) { + *list = g_slist_append(*list, dev); + } + + return 0; +} + +static GSList *qdev_build_hotpluggable_device_list(Object *peripheral) +{ + GSList *list = NULL; + + object_child_foreach(peripheral, qdev_add_hotpluggable_device, &list); + + return list; +} + static void peripheral_device_del_completion(ReadLineState *rs, const char *str, size_t len) { From patchwork Thu Jan 23 13:48:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228170 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=bwN2Pb4a; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483RF30gXNz9sSH for ; Fri, 24 Jan 2020 02:35:51 +1100 (AEDT) Received: from localhost ([::1]:59536 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iueWK-0004dO-Ng for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:35:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51659) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrc-0005KV-4m for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrb-00044m-00 for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:39 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:36380) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucra-00042j-QI for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:38 -0500 Received: by mail-wr1-x431.google.com with SMTP id z3so3162078wru.3 for ; Thu, 23 Jan 2020 05:49:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DKAk75UkCwuPlyN5K83IjxSwbXLW3UXbzJBFox5GXjM=; b=bwN2Pb4aKherd8cZVUeShzKQgdOZLj3/lQKOidaGEdjYS2Ne4WnqPTi/vU5lJoZWlI x0c8OVPM6p+bKKHcMgUa8EhQAkIgeK5hSTY3wXdQ5KOwa4jRQq7qGYYuehEk6IUlLA21 Myf8NYrZVV5KHGCcBBJCdOHDfwnhlDaQW0PcZ2RPBvs4oARyuU14IF4Gn6xXWYQdWQcp t+DWWzDNVPX1YYrNFBpN67yAGYMg8SbLAJzBkbJl7a9ylg917NZakhdy1kxPNQkHh4x6 iSQPzHiDC5xMBStt0LLbGBf27I2kz3spT8MEJqRlTg0WznHsSfEdPiLzjoXKlzB6w0RR 0UbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=DKAk75UkCwuPlyN5K83IjxSwbXLW3UXbzJBFox5GXjM=; b=aSTbYpcbGZiuaJyNkpkw2a2Cek2qXQal764OjdCWzrOD7hzu1o8E+XFiOdNXjVTqCB bVGr2zUtyoTM6DVZgzrD3PUfKKj9s1Vso3A0q3rkJBjpkk10qIEmjHCCjn19WJtStYzK ZHE7d9rieVt4tOCDgLZaKle8aHDTvX4Ro7i27OdWqqr4GfYunkeKNuzJ/aOjYhbZbu4u HMioFNXv+DHR2TJwaKnad0ECKPpJct6iM+VOxqrRcw0Wauod/ygu9OfM5i+iKU95/NOa aclbbpr1rd3zipNKODLFrfxgUQVwRIAcJNY84BcQk8jNjX3nXsUVitGur0AyKrJ2gR0l 4Q5g== X-Gm-Message-State: APjAAAXhjYGm/0vbYcCrmUcrZswXbnd1JBgp/wAVcKbncLo5/Jqttc7j KyPToGOEbsrtPZzL9tzHKyeQI4js X-Google-Smtp-Source: APXvYqzixxqyeY1Omgo9V2GyCeO1+ilKjr1ZAqg29pzqQd5Fj9FAnxeWZrlEbwurxYM1CHKcJUqr/A== X-Received: by 2002:a5d:44ca:: with SMTP id z10mr17817602wrr.266.1579787377731; Thu, 23 Jan 2020 05:49:37 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:37 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 35/59] object: avoid extra class property key duplication Date: Thu, 23 Jan 2020 14:48:38 +0100 Message-Id: <1579787342-27146-36-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::431 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Like object properties, no need to duplicate property name, as it is owned already by ObjectProperty value. Signed-off-by: Marc-André Lureau Message-Id: <20200110153039.1379601-6-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- qom/object.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qom/object.c b/qom/object.c index dcb6863..e921363 100644 --- a/qom/object.c +++ b/qom/object.c @@ -311,7 +311,7 @@ static void type_initialize(TypeImpl *ti) memcpy(ti->class, parent->class, parent->class_size); ti->class->interfaces = NULL; ti->class->properties = g_hash_table_new_full( - g_str_hash, g_str_equal, g_free, object_property_free); + g_str_hash, g_str_equal, NULL, object_property_free); for (e = parent->class->interfaces; e; e = e->next) { InterfaceClass *iface = e->data; @@ -343,7 +343,7 @@ static void type_initialize(TypeImpl *ti) } } else { ti->class->properties = g_hash_table_new_full( - g_str_hash, g_str_equal, g_free, object_property_free); + g_str_hash, g_str_equal, NULL, object_property_free); } ti->class->type = ti; @@ -1187,7 +1187,7 @@ object_class_property_add(ObjectClass *klass, prop->release = release; prop->opaque = opaque; - g_hash_table_insert(klass->properties, g_strdup(name), prop); + g_hash_table_insert(klass->properties, prop->name, prop); return prop; } From patchwork Thu Jan 23 13:48:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228279 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=pe9UA2H8; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483SCn57fSz9sR1 for ; Fri, 24 Jan 2020 03:19:49 +1100 (AEDT) Received: from localhost ([::1]:60228 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iufCt-0000b3-0p for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 11:19:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51684) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrd-0005M9-71 for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrc-00048G-0d for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:41 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:45385) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrb-00044r-PP for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:39 -0500 Received: by mail-wr1-x433.google.com with SMTP id j42so3107241wrj.12 for ; Thu, 23 Jan 2020 05:49:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cNSBVvuhqWAGJYrIfEMAuXBTzy9mOBWpnwL0MQDgTyk=; b=pe9UA2H8guk5hFdS7uASs9SAtsFshkRhPgYBdUqodol4xMqnXLDdm5cHK3UOGsAEDI tt/ZuL3OKbHBXN83Aw2sRlyusy1rIxboBMEbnYw3trMQQoxhgW2P5LBwqKhJ09Db96N9 N8OgUYsX0hmekidvZHAG7IZ9izFuxwD/Ze2lHNchJtgMJzHl+x/0Uu3mPfCTmjswLqa3 Gd6yNIA8u7/9Hus1NCjdUb7xw8QxsBDoNqzyrPHX8g2MwX0BMPK2TYslDdvKAnBTgUeE MDCCMxSml5W7C9JO25sMj9zbZ9kCAUB2pcDkoQTae3HqEVS24BxI5RC5+SKnd+qKSqgm Rd/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=cNSBVvuhqWAGJYrIfEMAuXBTzy9mOBWpnwL0MQDgTyk=; b=PnGsN5HZNm7hIZc3lL9LfwKIGoNboo0/yOdlOGEH2aTgpBt6sBxrPEJH8holA5gsi6 faxPAG/YaAWbPeTuqmWeN3Xk4TRuw2YBdfLUBFnptmFtOjRqV68v8WeZcu9AeC5zVuce iKjRcQPZohUwZIsRNWPwSzVn3SIFNAgmHrYCFr44c9xszWUroYC1mbIWoc311j31l0iE mvdjqnC/7K9TcnVzBhDzzZdevihONeQdd/a2ZLcwdhjtFNupvopTgEfYWwUnyiYfY5m2 EkT1vw/atnE4PdZfpSgtqV2ccIkJ6f/PDjxvWjIrIJ8tSuO7+kqFJEU9XLq6/sZ3F+Ju Jycw== X-Gm-Message-State: APjAAAUgBg7H/0iYkuLgq2PeYY4FcaAjzGb4a9BHKWevCDKwtjR7xHB4 eqqxuaJBV8Jmzg9zg6mos9R7Ut8P X-Google-Smtp-Source: APXvYqyY2gEVx8pbFh5NxrSXkJ8gziTBMt2gxDgJbujJdwbhTimwcXK0Nf+bsEnrAk+D7lT1Vo4fmA== X-Received: by 2002:adf:e984:: with SMTP id h4mr18017722wrm.275.1579787378522; Thu, 23 Jan 2020 05:49:38 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:38 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 36/59] object: add class property initializer Date: Thu, 23 Jan 2020 14:48:39 +0100 Message-Id: <1579787342-27146-37-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::433 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau This callback is used to set default value in following patch "object: add object_property_set_defaut_{bool,str,int,uint}()". Signed-off-by: Marc-André Lureau Message-Id: <20200110153039.1379601-7-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- include/qom/object.h | 16 ++++++++++++++-- qom/object.c | 14 ++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index 54a5488..29f47d3 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -309,6 +309,8 @@ typedef struct InterfaceInfo InterfaceInfo; */ +typedef struct ObjectProperty ObjectProperty; + /** * ObjectPropertyAccessor: * @obj: the object that owns the property @@ -356,7 +358,16 @@ typedef void (ObjectPropertyRelease)(Object *obj, const char *name, void *opaque); -typedef struct ObjectProperty +/** + * ObjectPropertyInit: + * @obj: the object that owns the property + * @prop: the property to set + * + * Called when a property is initialized. + */ +typedef void (ObjectPropertyInit)(Object *obj, ObjectProperty *prop); + +struct ObjectProperty { gchar *name; gchar *type; @@ -365,8 +376,9 @@ typedef struct ObjectProperty ObjectPropertyAccessor *set; ObjectPropertyResolve *resolve; ObjectPropertyRelease *release; + ObjectPropertyInit *init; void *opaque; -} ObjectProperty; +}; /** * ObjectUnparent: diff --git a/qom/object.c b/qom/object.c index e921363..cd7ce81 100644 --- a/qom/object.c +++ b/qom/object.c @@ -478,6 +478,19 @@ void object_apply_compat_props(Object *obj) } } +static void object_class_property_init_all(Object *obj) +{ + ObjectPropertyIterator iter; + ObjectProperty *prop; + + object_class_property_iter_init(&iter, object_get_class(obj)); + while ((prop = object_property_iter_next(&iter))) { + if (prop->init) { + prop->init(obj, prop); + } + } +} + static void object_initialize_with_type(void *data, size_t size, TypeImpl *type) { Object *obj = data; @@ -491,6 +504,7 @@ static void object_initialize_with_type(void *data, size_t size, TypeImpl *type) memset(obj, 0, type->instance_size); obj->class = type->class; object_ref(obj); + object_class_property_init_all(obj); obj->properties = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, object_property_free); object_init_with_type(obj, type); From patchwork Thu Jan 23 13:48:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228288 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=tLqbYJqQ; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483SHt5pJrz9sP3 for ; Fri, 24 Jan 2020 03:23:22 +1100 (AEDT) Received: from localhost ([::1]:60306 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iufGJ-0006AM-Fr for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 11:23:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51695) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrd-0005NH-Tf for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrc-00049C-Nj for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:41 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:40244) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrc-000487-Hk for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:40 -0500 Received: by mail-wr1-x42e.google.com with SMTP id c14so3133361wrn.7 for ; Thu, 23 Jan 2020 05:49:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hUG/7q5hSf5ymYtbRPJKidNIIUCm54xUUBFlpg5zKq0=; b=tLqbYJqQtBfyse6rQp3S6/Ma/yd4bd+4qTqBWqo0D81u826aElxbkeXHi6vh7hrw01 0hvLqzNVqE2BR14Y0D2OvLTrFrnY/jlt3BZq251MwiyJMfTll/aFBryoaTN7TAH8yFN/ eft7v8yfhwRZdlqkTETTB4/Ay3msdDucLl8yaGefup37DSTYQmeA+UWaklfQYZR01nas 8qqmRzO60rzaBWMtdcVRpEVipZCWJpMk8iFxeBuBhOKtpOuXY9xscuEYtHEvUGHONFch PlucL6q/mh7XZiH15DQb0xNBy+JkPR73oLqvUBTbfVrrHeV4z6JwJ5TkrN5ttphWI4Lz G61A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=hUG/7q5hSf5ymYtbRPJKidNIIUCm54xUUBFlpg5zKq0=; b=R/oSMGWGTs7AJ6dZhgY1kBXiAAdDiTaKia2Sms1d44i6NkgqW6VVUl83Q4gtU5Jaim e6/GYehDNK9WcDhZgjjjDlInHZkJ5WsQ/PAs6Fts2dudcK9H7PB252BKa2coBOc+gV6/ /16VvBgMX0XsgMVw/qF9fRI6XWvCkig40iRF0jyC2uBb2yHLlkeOGECVlOz8SSsvubKB iYB5Yh54QqG82b7J6Nfeb75WKxE+GwCddeWVFkHbJi64bXsN/rTb0pjErivSSJXxJ80K VGtKKOPTrf+1pCh7vF0Kb8AmAn8fDIoDYv+2lPsKbdekoAgfYQTeYx9NsGWE39rA0jHJ laHQ== X-Gm-Message-State: APjAAAUTOF4943Sdw0B9pRVHPEAAzcaVjTSU4fkg57fzDMs5+NqvBGoi +I3xHTaYvUuXq5WjwCd3hb3HmAdh X-Google-Smtp-Source: APXvYqzLfOi2acp6yMec3AsL88IYDnNi7F7etX7r7FHDZeWzaZHC1thqmyrP08UAtkwpvDKyxNCiEw== X-Received: by 2002:adf:eb48:: with SMTP id u8mr17453068wrn.283.1579787379310; Thu, 23 Jan 2020 05:49:39 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:38 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 37/59] object: add object_property_get_defaut() Date: Thu, 23 Jan 2020 14:48:40 +0100 Message-Id: <1579787342-27146-38-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42e X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau The new callback will be used in following "object: add object_property_set_defaut_{bool,str,int,uint}()" and "vl: print default value in object help" patches. Signed-off-by: Marc-André Lureau Message-Id: <20200110153039.1379601-8-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- include/qom/object.h | 17 +++++++++++++++++ qom/object.c | 9 +++++++++ 2 files changed, 26 insertions(+) diff --git a/include/qom/object.h b/include/qom/object.h index 29f47d3..ca47308 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -367,6 +367,13 @@ typedef void (ObjectPropertyRelease)(Object *obj, */ typedef void (ObjectPropertyInit)(Object *obj, ObjectProperty *prop); +/** + * ObjectPropertyGetDefault: + * + * Get an allocated string representation of the default value. + */ +typedef char *(ObjectPropertyGetDefault)(ObjectProperty *prop); + struct ObjectProperty { gchar *name; @@ -377,6 +384,7 @@ struct ObjectProperty ObjectPropertyResolve *resolve; ObjectPropertyRelease *release; ObjectPropertyInit *init; + ObjectPropertyGetDefault *get_default; void *opaque; }; @@ -1234,6 +1242,15 @@ void object_property_set_int(Object *obj, int64_t value, const char *name, Error **errp); /** + * object_property_get_defaut: + * @prop: the property to get default value + * + * Return an allocated string that represents the default property + * value or NULL. + */ +char *object_property_get_default(ObjectProperty *prop); + +/** * object_property_get_int: * @obj: the object * @name: the name of the property diff --git a/qom/object.c b/qom/object.c index cd7ce81..49c2429 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1438,6 +1438,15 @@ int64_t object_property_get_int(Object *obj, const char *name, return retval; } +char *object_property_get_default(ObjectProperty *prop) +{ + if (!prop->get_default) { + return NULL; + } + + return prop->get_default(prop); +} + void object_property_set_uint(Object *obj, uint64_t value, const char *name, Error **errp) { From patchwork Thu Jan 23 13:48:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228192 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=f9cmQTiA; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483RbW3gMCz9sSH for ; Fri, 24 Jan 2020 02:51:51 +1100 (AEDT) Received: from localhost ([::1]:59776 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuelp-0001Z7-4M for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:51:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51736) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrf-0005PK-Ac for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrd-0004CR-JI for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:43 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:47023) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrd-00049I-Bk for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:41 -0500 Received: by mail-wr1-x432.google.com with SMTP id z7so3098748wrl.13 for ; Thu, 23 Jan 2020 05:49:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OERtFp3Q/y9ZSPI8cgyrtVoTr3IWEd9WgGvVo945KWA=; b=f9cmQTiA3WG4LxqkbQj6KMd0VeJ/E/HQehW2jkb1e9Ond5jwBP+2flEAntyQxTMU+S YMW6l2WksOkZX7lbq1sc0+lgqMtxFM9xQOQ0JOlP8hacxUVh1t21qFWJdLOuumdoIq4R 2lGy5sNkUDHSQpOGcuFXPICjih1RxE8qq3qCQ/NS9wgHwDLuP3JPPFNpDdrHPUZ/OslR h11wSAeXzqhTXYAIdBL2aRTQ/vZoWu9x2qMLzXDBJPX79UQ2UTSy47hiSzJwXHlgyWM0 juExQt4yA2bxDJDIDR0VRUj2jn/pMpaDNizhiqiGVSVIMcJiEgcXnArKPHMU1ycmgzgb /0YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=OERtFp3Q/y9ZSPI8cgyrtVoTr3IWEd9WgGvVo945KWA=; b=GSwWolEue2jo1eWHZWlwFC7bAwPaVfhxdNQbSDJPqW6rvRpJeH4gcaw3fiSqv0RboV sdddqgIEZYe/BicMzPn+F/du1mLlyhlsnGkfhaDYUrJGKHVWPaG4SQkaSg2A0K7poDLh JoSUK0ebtHatEmV8quhj4HS/VhYQkmFO3Uqd84OeR7Qf0zQvumsq6ezgprv4Ev+oZGxV eZC6sfW9DJ+AJ1GmOc4zGAfgqArDxrSiZOc3i6+DG0MZXkAYiKcVXgdfYObOHTGb4Xik l7HtLusDbgA/v4wWqvQXEXvIdFSQFF+DRiClggEkLsZoeA78Vzu/Z827ayDc9xndBY2X KCPQ== X-Gm-Message-State: APjAAAVq0wd0A5xgGPBrS/gEC9rk/Xo+GcvYfLIcmh+Lw7HWEbHUtTEf 3kTWjgAoYgL03VTJ+h1cqAarimMi X-Google-Smtp-Source: APXvYqx1oHDukj04xWlbH8PntS9uz6GMsB5JP7T4B5BTq6freQ3b3ni//hoetmoplCdk2tBSBtebxw== X-Received: by 2002:adf:eb8e:: with SMTP id t14mr17514860wrn.384.1579787380137; Thu, 23 Jan 2020 05:49:40 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:39 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 38/59] object: make object_class_property_add* return property Date: Thu, 23 Jan 2020 14:48:41 +0100 Message-Id: <1579787342-27146-39-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::432 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau This will help calling other ObjectProperty associated functions easily after. Signed-off-by: Marc-André Lureau Message-Id: <20200110153039.1379601-9-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- include/qom/object.h | 24 +++++++++++++------- qom/object.c | 64 ++++++++++++++++++++++++++++++++++++---------------- 2 files changed, 60 insertions(+), 28 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index ca47308..9f52bc3 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1556,7 +1556,8 @@ void object_property_add_str(Object *obj, const char *name, void (*set)(Object *, const char *, Error **), Error **errp); -void object_class_property_add_str(ObjectClass *klass, const char *name, +ObjectProperty *object_class_property_add_str(ObjectClass *klass, + const char *name, char *(*get)(Object *, Error **), void (*set)(Object *, const char *, Error **), @@ -1578,7 +1579,8 @@ void object_property_add_bool(Object *obj, const char *name, void (*set)(Object *, bool, Error **), Error **errp); -void object_class_property_add_bool(ObjectClass *klass, const char *name, +ObjectProperty *object_class_property_add_bool(ObjectClass *klass, + const char *name, bool (*get)(Object *, Error **), void (*set)(Object *, bool, Error **), Error **errp); @@ -1602,7 +1604,8 @@ void object_property_add_enum(Object *obj, const char *name, void (*set)(Object *, int, Error **), Error **errp); -void object_class_property_add_enum(ObjectClass *klass, const char *name, +ObjectProperty *object_class_property_add_enum(ObjectClass *klass, + const char *name, const char *typename, const QEnumLookup *lookup, int (*get)(Object *, Error **), @@ -1623,7 +1626,8 @@ void object_property_add_tm(Object *obj, const char *name, void (*get)(Object *, struct tm *, Error **), Error **errp); -void object_class_property_add_tm(ObjectClass *klass, const char *name, +ObjectProperty *object_class_property_add_tm(ObjectClass *klass, + const char *name, void (*get)(Object *, struct tm *, Error **), Error **errp); @@ -1639,7 +1643,8 @@ void object_class_property_add_tm(ObjectClass *klass, const char *name, */ void object_property_add_uint8_ptr(Object *obj, const char *name, const uint8_t *v, Error **errp); -void object_class_property_add_uint8_ptr(ObjectClass *klass, const char *name, +ObjectProperty *object_class_property_add_uint8_ptr(ObjectClass *klass, + const char *name, const uint8_t *v, Error **errp); /** @@ -1654,7 +1659,8 @@ void object_class_property_add_uint8_ptr(ObjectClass *klass, const char *name, */ void object_property_add_uint16_ptr(Object *obj, const char *name, const uint16_t *v, Error **errp); -void object_class_property_add_uint16_ptr(ObjectClass *klass, const char *name, +ObjectProperty *object_class_property_add_uint16_ptr(ObjectClass *klass, + const char *name, const uint16_t *v, Error **errp); /** @@ -1669,7 +1675,8 @@ void object_class_property_add_uint16_ptr(ObjectClass *klass, const char *name, */ void object_property_add_uint32_ptr(Object *obj, const char *name, const uint32_t *v, Error **errp); -void object_class_property_add_uint32_ptr(ObjectClass *klass, const char *name, +ObjectProperty *object_class_property_add_uint32_ptr(ObjectClass *klass, + const char *name, const uint32_t *v, Error **errp); /** @@ -1684,7 +1691,8 @@ void object_class_property_add_uint32_ptr(ObjectClass *klass, const char *name, */ void object_property_add_uint64_ptr(Object *obj, const char *name, const uint64_t *v, Error **errp); -void object_class_property_add_uint64_ptr(ObjectClass *klass, const char *name, +ObjectProperty *object_class_property_add_uint64_ptr(ObjectClass *klass, + const char *name, const uint64_t *v, Error **errp); /** diff --git a/qom/object.c b/qom/object.c index 49c2429..213a796 100644 --- a/qom/object.c +++ b/qom/object.c @@ -2074,7 +2074,8 @@ void object_property_add_str(Object *obj, const char *name, } } -void object_class_property_add_str(ObjectClass *klass, const char *name, +ObjectProperty * +object_class_property_add_str(ObjectClass *klass, const char *name, char *(*get)(Object *, Error **), void (*set)(Object *, const char *, Error **), @@ -2082,11 +2083,12 @@ void object_class_property_add_str(ObjectClass *klass, const char *name, { Error *local_err = NULL; StringProperty *prop = g_malloc0(sizeof(*prop)); + ObjectProperty *rv; prop->get = get; prop->set = set; - object_class_property_add(klass, name, "string", + rv = object_class_property_add(klass, name, "string", get ? property_get_str : NULL, set ? property_set_str : NULL, property_release_str, @@ -2095,6 +2097,8 @@ void object_class_property_add_str(ObjectClass *klass, const char *name, error_propagate(errp, local_err); g_free(prop); } + + return rv; } typedef struct BoolProperty @@ -2164,18 +2168,20 @@ void object_property_add_bool(Object *obj, const char *name, } } -void object_class_property_add_bool(ObjectClass *klass, const char *name, +ObjectProperty * +object_class_property_add_bool(ObjectClass *klass, const char *name, bool (*get)(Object *, Error **), void (*set)(Object *, bool, Error **), Error **errp) { Error *local_err = NULL; BoolProperty *prop = g_malloc0(sizeof(*prop)); + ObjectProperty *rv; prop->get = get; prop->set = set; - object_class_property_add(klass, name, "bool", + rv = object_class_property_add(klass, name, "bool", get ? property_get_bool : NULL, set ? property_set_bool : NULL, property_release_bool, @@ -2184,6 +2190,8 @@ void object_class_property_add_bool(ObjectClass *klass, const char *name, error_propagate(errp, local_err); g_free(prop); } + + return rv; } static void property_get_enum(Object *obj, Visitor *v, const char *name, @@ -2249,7 +2257,8 @@ void object_property_add_enum(Object *obj, const char *name, } } -void object_class_property_add_enum(ObjectClass *klass, const char *name, +ObjectProperty * +object_class_property_add_enum(ObjectClass *klass, const char *name, const char *typename, const QEnumLookup *lookup, int (*get)(Object *, Error **), @@ -2258,12 +2267,13 @@ void object_class_property_add_enum(ObjectClass *klass, const char *name, { Error *local_err = NULL; EnumProperty *prop = g_malloc(sizeof(*prop)); + ObjectProperty *rv; prop->lookup = lookup; prop->get = get; prop->set = set; - object_class_property_add(klass, name, typename, + rv = object_class_property_add(klass, name, typename, get ? property_get_enum : NULL, set ? property_set_enum : NULL, property_release_enum, @@ -2272,6 +2282,8 @@ void object_class_property_add_enum(ObjectClass *klass, const char *name, error_propagate(errp, local_err); g_free(prop); } + + return rv; } typedef struct TMProperty { @@ -2352,16 +2364,18 @@ void object_property_add_tm(Object *obj, const char *name, } } -void object_class_property_add_tm(ObjectClass *klass, const char *name, +ObjectProperty * +object_class_property_add_tm(ObjectClass *klass, const char *name, void (*get)(Object *, struct tm *, Error **), Error **errp) { Error *local_err = NULL; TMProperty *prop = g_malloc0(sizeof(*prop)); + ObjectProperty *rv; prop->get = get; - object_class_property_add(klass, name, "struct tm", + rv = object_class_property_add(klass, name, "struct tm", get ? property_get_tm : NULL, NULL, property_release_tm, prop, &local_err); @@ -2369,6 +2383,8 @@ void object_class_property_add_tm(ObjectClass *klass, const char *name, error_propagate(errp, local_err); g_free(prop); } + + return rv; } static char *qdev_get_type(Object *obj, Error **errp) @@ -2411,11 +2427,13 @@ void object_property_add_uint8_ptr(Object *obj, const char *name, NULL, NULL, (void *)v, errp); } -void object_class_property_add_uint8_ptr(ObjectClass *klass, const char *name, +ObjectProperty * +object_class_property_add_uint8_ptr(ObjectClass *klass, const char *name, const uint8_t *v, Error **errp) { - object_class_property_add(klass, name, "uint8", property_get_uint8_ptr, - NULL, NULL, (void *)v, errp); + return object_class_property_add(klass, name, "uint8", + property_get_uint8_ptr, + NULL, NULL, (void *)v, errp); } void object_property_add_uint16_ptr(Object *obj, const char *name, @@ -2425,11 +2443,13 @@ void object_property_add_uint16_ptr(Object *obj, const char *name, NULL, NULL, (void *)v, errp); } -void object_class_property_add_uint16_ptr(ObjectClass *klass, const char *name, +ObjectProperty * +object_class_property_add_uint16_ptr(ObjectClass *klass, const char *name, const uint16_t *v, Error **errp) { - object_class_property_add(klass, name, "uint16", property_get_uint16_ptr, - NULL, NULL, (void *)v, errp); + return object_class_property_add(klass, name, "uint16", + property_get_uint16_ptr, + NULL, NULL, (void *)v, errp); } void object_property_add_uint32_ptr(Object *obj, const char *name, @@ -2439,11 +2459,13 @@ void object_property_add_uint32_ptr(Object *obj, const char *name, NULL, NULL, (void *)v, errp); } -void object_class_property_add_uint32_ptr(ObjectClass *klass, const char *name, +ObjectProperty * +object_class_property_add_uint32_ptr(ObjectClass *klass, const char *name, const uint32_t *v, Error **errp) { - object_class_property_add(klass, name, "uint32", property_get_uint32_ptr, - NULL, NULL, (void *)v, errp); + return object_class_property_add(klass, name, "uint32", + property_get_uint32_ptr, + NULL, NULL, (void *)v, errp); } void object_property_add_uint64_ptr(Object *obj, const char *name, @@ -2453,11 +2475,13 @@ void object_property_add_uint64_ptr(Object *obj, const char *name, NULL, NULL, (void *)v, errp); } -void object_class_property_add_uint64_ptr(ObjectClass *klass, const char *name, +ObjectProperty * +object_class_property_add_uint64_ptr(ObjectClass *klass, const char *name, const uint64_t *v, Error **errp) { - object_class_property_add(klass, name, "uint64", property_get_uint64_ptr, - NULL, NULL, (void *)v, errp); + return object_class_property_add(klass, name, "uint64", + property_get_uint64_ptr, + NULL, NULL, (void *)v, errp); } typedef struct { From patchwork Thu Jan 23 13:48:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228174 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=pJxdwXLc; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483RHT1yccz9sPW for ; Fri, 24 Jan 2020 02:37:57 +1100 (AEDT) Received: from localhost ([::1]:59584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iueYM-0007jy-HI for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:37:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51733) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrf-0005PJ-BM for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucre-0004DU-7e for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:43 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:39172) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucre-0004C9-1Q for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:42 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 20so2591772wmj.4 for ; Thu, 23 Jan 2020 05:49:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NRtpysghTnIJUNFyZSG4PEwiYVfrrLID8LkUoY/p4CA=; b=pJxdwXLcMYwvGwGK+WZ4Luv2M8+omtuPsN5RomK2ZvK4SPXCJJvuPeqgGoepbB+r7D 3k7xbIhqKVZfI/UPP5NvhDDI54pdrCpgl6m+2LSCLjdX9+hPwE1AbBdAzxQrurb3D/od CjrUWDcASkp3zlNDyU7c2q+oxJ0oB8fxDlV1ySyMtovqsz5ncVY90ud5nQEVNIKCTl9O WIExG6iRe0gP2XHWVRuh4KFB8/fNnLn6PTlMCe1fsKm37JJMwwvGonktI6Oxe7L2FAIu XGHrYWYFU/CImovOMrMaiyi9padEVAYqypbhGp8F0HxVZy/NPbfNNWh5O3dgbMiKDbVo dUcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=NRtpysghTnIJUNFyZSG4PEwiYVfrrLID8LkUoY/p4CA=; b=pgQWnrDUwOXqx8kzBYaprHIQlhGfx7FyMurQF6u+S8BMieDMN62VebREzW5aVEfYBt iRCzto5Ul6gbkzLlFfkI57yYKMyMO6FeAt5xjdzavd/rXgpPn15vLMN12iGzr4RXfP7x DWDyp6WlCB31xw5t32l8PWVrorlPYGd1atMjVfMQdK0OIE7Jknn31UnZSl7sDPYuQ1dS cn73e+ushcswBZdWFCvB13neU5rmrGjfb1/6MOufpPQSj+BSxkHVKCkYLllrH3g69JQu Xvq/W4cNl6bVJSVYbGuHdsjcke3lMtesGR/C0WS/J88bCABvYyK+hzmbOD2u+ydrEgkE WQUw== X-Gm-Message-State: APjAAAUQkFpKzLuZagrqh2rUTvtWxVGaeXneoSlMAJkNiFOyPyY9Keta 67jIvTfXHPzMwD/QH/pmNaS2RnxX X-Google-Smtp-Source: APXvYqzGjKTURVyJHKhzzMNMurSQlSFHTXb6qeCiQEl5C/GBOAVSxYwm78XEsOAIEAZhWHW8s37cRQ== X-Received: by 2002:a7b:cf01:: with SMTP id l1mr4314489wmg.86.1579787380985; Thu, 23 Jan 2020 05:49:40 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:40 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 39/59] qstring: add qstring_free() Date: Thu, 23 Jan 2020 14:48:42 +0100 Message-Id: <1579787342-27146-40-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32d X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Similar to g_string_free(), optionally return the underlying char*. Signed-off-by: Marc-André Lureau Message-Id: <20200110153039.1379601-10-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- include/qapi/qmp/qstring.h | 1 + qobject/qstring.c | 27 ++++++++++++++++++++++----- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/include/qapi/qmp/qstring.h b/include/qapi/qmp/qstring.h index 3e83e3a..e2e356e 100644 --- a/include/qapi/qmp/qstring.h +++ b/include/qapi/qmp/qstring.h @@ -33,6 +33,7 @@ void qstring_append_int(QString *qstring, int64_t value); void qstring_append(QString *qstring, const char *str); void qstring_append_chr(QString *qstring, int c); bool qstring_is_equal(const QObject *x, const QObject *y); +char *qstring_free(QString *qstring, bool return_str); void qstring_destroy_obj(QObject *obj); #endif /* QSTRING_H */ diff --git a/qobject/qstring.c b/qobject/qstring.c index 1c6897d..b66a2c3 100644 --- a/qobject/qstring.c +++ b/qobject/qstring.c @@ -150,15 +150,32 @@ bool qstring_is_equal(const QObject *x, const QObject *y) } /** + * qstring_free(): Free the memory allocated by a QString object + * + * Return: if @return_str, return the underlying string, to be + * g_free(), otherwise NULL is returned. + */ +char *qstring_free(QString *qstring, bool return_str) +{ + char *rv = NULL; + + if (return_str) { + rv = qstring->string; + } else { + g_free(qstring->string); + } + + g_free(qstring); + + return rv; +} + +/** * qstring_destroy_obj(): Free all memory allocated by a QString * object */ void qstring_destroy_obj(QObject *obj) { - QString *qs; - assert(obj != NULL); - qs = qobject_to(QString, obj); - g_free(qs->string); - g_free(qs); + qstring_free(qobject_to(QString, obj), FALSE); } From patchwork Thu Jan 23 13:48:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228286 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=jlfEbDtL; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483SGS5l05z9sR1 for ; Fri, 24 Jan 2020 03:22:08 +1100 (AEDT) Received: from localhost ([::1]:60294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iufF8-0004Fh-4K for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 11:22:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51774) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrg-0005Rd-Qd for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrf-0004G2-EU for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:44 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:39489) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrf-0004EI-7R for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:43 -0500 Received: by mail-wr1-x42a.google.com with SMTP id y11so3145706wrt.6 for ; Thu, 23 Jan 2020 05:49:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PA5q0FZDEW8Y+8rLXWGciLnycgXwrVkUoj4n+I9lelQ=; b=jlfEbDtL61E1kvuMnalngLPJbWwKJsXgeFcd7t8eFNIdPH1TYx2UcsBoxFSr7Qh6/l 1V0dUVFYfJyy4H2M+f0qWKlpRpf6WL3hR59A0jxUX+sRYhHGjzIt/hPDJXunUiQ+gs4r orsHPSzQt/urm+aw46r6xC7jg9Pt8ymTE9eQNn6AeqxpjnutMTrz63DJCqdBCVTyEENR XYyJcejHr3S595PbnaCzox+G1/qgQ3ReWHBfSV8IWZTAndkxpfxVq2evG/CXHPMtqxj+ LdHQwKCWBv2wWs/5DR8ijvBWUb35v7z1jllGgiJ1QZY8U4NrCANqLEuKfSCiKUq4IGus NXow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=PA5q0FZDEW8Y+8rLXWGciLnycgXwrVkUoj4n+I9lelQ=; b=kCto0U/p2YQzbMUyi1xktF+VUZr7+/OIsZHGwZbMowj3Vpy4NAEBv6slMRM3NCYynn BdZasmwCmitipc7I7kxU/Tmo0z0pDKU9F5Cr7sOWgNpIUgU9pLoUlUnn8rsisnKYKc97 HgRGjo10IDe3Gg7HGlLFhfmalNmVLgWWMYbsdfYPll8faIRdi2lBSRcS6hV+kfQB1AuY lvYl2yKP2xFVotq+pQPeqgzv0etm6Kyc3TXOcIBPPM25rnIYZEb+JYIh2NwFlDGNStCf jPTnDOYh45OsSHqRgkX96I83cYiHWP+ar9Bwc0ceI9n1/F3oOcTqDQwS4S1byV/GzxPd m9kg== X-Gm-Message-State: APjAAAUe0gGCUvJMUed/QAqpIoWf47i+xrXFtTzMeiAsSAUXx0hKDAs6 0L/HB7vb2G6NgreNoNcuAmih0Dlh X-Google-Smtp-Source: APXvYqzFcar7e49qi2hihpWVCIY/fRmKzcM0i2KaJYxOokpmEQMpiA0vDtHPGH5U+5eTejKhwMrRIg== X-Received: by 2002:adf:ee82:: with SMTP id b2mr17038078wro.194.1579787381895; Thu, 23 Jan 2020 05:49:41 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:41 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 40/59] object: add object_property_set_defaut_{bool, str, int, uint}() Date: Thu, 23 Jan 2020 14:48:43 +0100 Message-Id: <1579787342-27146-41-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42a X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Message-Id: <20200110153039.1379601-11-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- include/qom/object.h | 37 ++++++++++++++++++++++++++++++++++ qom/object.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) diff --git a/include/qom/object.h b/include/qom/object.h index 9f52bc3..fb133d6 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -386,6 +386,7 @@ struct ObjectProperty ObjectPropertyInit *init; ObjectPropertyGetDefault *get_default; void *opaque; + QObject *defval; }; /** @@ -1064,6 +1065,42 @@ ObjectProperty *object_class_property_add(ObjectClass *klass, const char *name, void *opaque, Error **errp); /** + * object_property_set_defaut_bool: + * @prop: the property to set + * @value: the value to be written to the property + * + * Set the property default value. + */ +void object_property_set_defaut_bool(ObjectProperty *prop, bool value); + +/** + * object_property_set_defaut_str: + * @prop: the property to set + * @value: the value to be written to the property + * + * Set the property default value. + */ +void object_property_set_defaut_str(ObjectProperty *prop, const char *value); + +/** + * object_property_set_defaut_int: + * @prop: the property to set + * @value: the value to be written to the property + * + * Set the property default value. + */ +void object_property_set_defaut_int(ObjectProperty *prop, int64_t value); + +/** + * object_property_set_defaut_uint: + * @prop: the property to set + * @value: the value to be written to the property + * + * Set the property default value. + */ +void object_property_set_defaut_uint(ObjectProperty *prop, uint64_t value); + +/** * object_property_find: * @obj: the object * @name: the name of the property diff --git a/qom/object.c b/qom/object.c index 213a796..1423344 100644 --- a/qom/object.c +++ b/qom/object.c @@ -19,8 +19,10 @@ #include "qapi/visitor.h" #include "qapi/string-input-visitor.h" #include "qapi/string-output-visitor.h" +#include "qapi/qobject-input-visitor.h" #include "qapi/qapi-builtin-visit.h" #include "qapi/qmp/qerror.h" +#include "qapi/qmp/qjson.h" #include "trace.h" /* TODO: replace QObject with a simpler visitor to avoid a dependency @@ -268,6 +270,10 @@ static void object_property_free(gpointer data) { ObjectProperty *prop = data; + if (prop->defval) { + qobject_unref(prop->defval); + prop->defval = NULL; + } g_free(prop->name); g_free(prop->type); g_free(prop->description); @@ -1447,6 +1453,52 @@ char *object_property_get_default(ObjectProperty *prop) return prop->get_default(prop); } +static void object_property_init_defval(Object *obj, ObjectProperty *prop) +{ + Visitor *v = qobject_input_visitor_new(prop->defval); + + assert(prop->set != NULL); + prop->set(obj, v, prop->name, prop->opaque, &error_abort); + + visit_free(v); +} + +static char *object_property_get_defval(ObjectProperty *prop) +{ + return qstring_free(qobject_to_json(prop->defval), TRUE); +} + +static void object_property_set_defaut(ObjectProperty *prop, QObject *defval) +{ + assert(!prop->defval); + assert(!prop->init); + assert(!prop->get_default); + + prop->defval = defval; + prop->init = object_property_init_defval; + prop->get_default = object_property_get_defval; +} + +void object_property_set_defaut_bool(ObjectProperty *prop, bool value) +{ + object_property_set_defaut(prop, QOBJECT(qbool_from_bool(value))); +} + +void object_property_set_defaut_str(ObjectProperty *prop, const char *value) +{ + object_property_set_defaut(prop, QOBJECT(qstring_from_str(value))); +} + +void object_property_set_defaut_int(ObjectProperty *prop, int64_t value) +{ + object_property_set_defaut(prop, QOBJECT(qnum_from_int(value))); +} + +void object_property_set_defaut_uint(ObjectProperty *prop, uint64_t value) +{ + object_property_set_defaut(prop, QOBJECT(qnum_from_uint(value))); +} + void object_property_set_uint(Object *obj, uint64_t value, const char *name, Error **errp) { @@ -2558,6 +2610,10 @@ void object_property_add_alias(Object *obj, const char *name, goto out; } op->resolve = property_resolve_alias; + if (target_prop->get_default) { + op->get_default = target_prop->get_default; + op->defval = qobject_ref(target_prop->defval); + } object_property_set_description(obj, op->name, target_prop->description, From patchwork Thu Jan 23 13:48:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228177 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=oWemyY4A; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483RM22ky4z9sSN for ; Fri, 24 Jan 2020 02:41:02 +1100 (AEDT) Received: from localhost ([::1]:59614 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuebM-00034k-9Z for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:41:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51789) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrh-0005SX-Gl for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrg-0004J4-7l for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:45 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:43676) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrg-0004FX-19 for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:44 -0500 Received: by mail-wr1-x430.google.com with SMTP id d16so3114262wre.10 for ; Thu, 23 Jan 2020 05:49:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OEkIKTJLqtLn0CwQfnZ9UM16dUj1z1/bOKbRoffOWsI=; b=oWemyY4AgVFVMi0XwZ+H1fMp9qEDMOQJQsbfJZLA1hcLXuxhIG/o8EsrmjDQWhzHse Fa35WQHd3BtI5w8rXpQUTFzYgCTU0CbLW+So6jIi1GJKV490rAeMV+dWYXH9xPgahLCS SL8cYn4MKZEab2dhNSQW28mnaEYrfFh2EzYcFvNHuNFqtdD6YIK85edEw95v9OrYQbgv zku20sdkb3ivEpyXTWhrTh3luD1y3xKLrQx8sRFkKzpW10klTU4sH+9BF5Ibfk5luFW5 Dw86FDgbrkXdwDkUC10cVBSzSesdFCZLMzW08sBG8lp/yXdINTU0q180L4VkxFPYvy+m FGZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=OEkIKTJLqtLn0CwQfnZ9UM16dUj1z1/bOKbRoffOWsI=; b=j+dabcxOQXYkK6OSABxnl8yNH0DXZyghB72SkZ5xO0zi0N8n62bSN7zIP81vE8lurL 2x/MtikeOIWkxCkabSemj0Hl9Tn7tCkYjGyW2pjhdOUVWCXiPnMJA6lLN3w8oL2cpMK/ xMeXFmX6ZTeVAQnEWlgbqd4JMb1RxGcWf1fM4gavw+g7EQaAy/i91+eMlHBTrwI3o1ub lT0OunwqNvS7uyVgL6tOWfuyMewUsyGn3rc8pikEHZIwYclDtHj+IizZUOAQdetNYygi WE9q3o8Fo+ZPsP7cYrAKUguJJScLy+0bC+t3LwTMcgacaohZX8KRG5SDm0Gd4KLkVwzQ SXXA== X-Gm-Message-State: APjAAAU9ZKE9UEXS3Zsq0AccSMBE5Q8JEuNUe2BKKX6h7tBL7Gx2IO3t 7J082qBQDJy9fH27zL5KFF11+nG9 X-Google-Smtp-Source: APXvYqxBl/DJ0zQMzmGHkHq3Ph9hV3cJLwPEB/XsmRuUzR8eYGytXlZ0jLB2IixBHMVTIOaDCJvSuQ== X-Received: by 2002:a5d:6305:: with SMTP id i5mr18054825wru.399.1579787382736; Thu, 23 Jan 2020 05:49:42 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:42 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 41/59] object: do not free class properties Date: Thu, 23 Jan 2020 14:48:44 +0100 Message-Id: <1579787342-27146-42-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::430 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau The release callback is called during object_property_del_all(), on a live instance. But class properties are common among all instances. It is not currently called, because we don't release classes, but it would not be correct if we did. Signed-off-by: Marc-André Lureau Message-Id: <20200110153039.1379601-12-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- qom/object.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qom/object.c b/qom/object.c index 1423344..30c4f82 100644 --- a/qom/object.c +++ b/qom/object.c @@ -2143,7 +2143,7 @@ object_class_property_add_str(ObjectClass *klass, const char *name, rv = object_class_property_add(klass, name, "string", get ? property_get_str : NULL, set ? property_set_str : NULL, - property_release_str, + NULL, prop, &local_err); if (local_err) { error_propagate(errp, local_err); @@ -2236,7 +2236,7 @@ object_class_property_add_bool(ObjectClass *klass, const char *name, rv = object_class_property_add(klass, name, "bool", get ? property_get_bool : NULL, set ? property_set_bool : NULL, - property_release_bool, + NULL, prop, &local_err); if (local_err) { error_propagate(errp, local_err); @@ -2328,7 +2328,7 @@ object_class_property_add_enum(ObjectClass *klass, const char *name, rv = object_class_property_add(klass, name, typename, get ? property_get_enum : NULL, set ? property_set_enum : NULL, - property_release_enum, + NULL, prop, &local_err); if (local_err) { error_propagate(errp, local_err); @@ -2429,7 +2429,7 @@ object_class_property_add_tm(ObjectClass *klass, const char *name, rv = object_class_property_add(klass, name, "struct tm", get ? property_get_tm : NULL, NULL, - property_release_tm, + NULL, prop, &local_err); if (local_err) { error_propagate(errp, local_err); From patchwork Thu Jan 23 13:48:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228292 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Ik1UDyf+; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483SLT4LWXz9sP3 for ; Fri, 24 Jan 2020 03:25:37 +1100 (AEDT) Received: from localhost ([::1]:60346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iufIV-0001WS-0e for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 11:25:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51800) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrh-0005T3-OK for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrg-0004Je-S9 for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:45 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:44796) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrg-0004Ij-Lu for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:44 -0500 Received: by mail-wr1-x42f.google.com with SMTP id q10so3117983wrm.11 for ; Thu, 23 Jan 2020 05:49:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uOLwVK1PbKn7a23VxrQddoHkt+lkpXaQ8CGs7D10ELc=; b=Ik1UDyf+lS1zGOKwIDDAtQoKwbjVlJSOzNBvDAqky6Fj+ekqJrSogwQg23ZHiLGu61 ZbWBqxrGADwZ9bA8DWOWbiuW4VNJltrE6ndR9tg8jS5meLrSI+BfONsQWp1lpPnEB+Io F6jgdpFFMMm5kpjP7G/frFYYjSEbxWP8sgjg45VxY1pgdqA5HzUYk9iKlMddknKsyRwt gw4lE/+vZGK+RvdxMBlLd5AFf2OfyegLO7yjIXeJgd5znZtre5lNqV3JH8mwpqns7etd Ac7HVhvpg6EZLcKevEw7ZvpG3h7IX1caFP5ie+omaTWUYwrYrw1lfhc8E13Hb1amprbX lQPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=uOLwVK1PbKn7a23VxrQddoHkt+lkpXaQ8CGs7D10ELc=; b=Z5c/0EhjbD9HodsCXOKk5Ui9x6dlFp4HF3u684HQ+XOM5K/MGwHkjvRcoU0IXAXIGM gOBCCEIw9IzLzUXYAKbKFedrdLu8leX/ZHYgXxS1tccim9Hvx8EBsNieNZjZgOTmIjdA Xu3QWGS64YhzI6WKuPr4GRWKKHlrO7MwAqKBefy0PLgteJemmrz/IRnMYGbC+MSssnQE JYXZKTsRQ1E6NpemXMcMgD0iKiAvaykdUK6CO/B7pDaYy8VXxTyGNa2tA+TOeWMh3DPt L3oS3sXUrQJ++WC1E8KE5U/g7va2ZyqQku4hYsdNkbfcztdUamJMwipzhN1Pwy9VlTJk vWMQ== X-Gm-Message-State: APjAAAUMO8ojesM3fGMCmFBqRzMNJ4TAsXskylue0xpBiWxyETadXek6 V/3Iu4OEkinfbYNLBeeu3/zHNcD7 X-Google-Smtp-Source: APXvYqxzy8vp3SmSskHB9ems4kNS2XQAF4hYqiTWVQgOUzwR+ezT7Wly0QLzppxdDRpgKmTDVD5vOA== X-Received: by 2002:adf:c145:: with SMTP id w5mr18139475wre.205.1579787383581; Thu, 23 Jan 2020 05:49:43 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:43 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 42/59] object: check strong flag with & Date: Thu, 23 Jan 2020 14:48:45 +0100 Message-Id: <1579787342-27146-43-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42f X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau The following patch is going to introduce more flags. Signed-off-by: Marc-André Lureau Message-Id: <20200110153039.1379601-13-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- qom/object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qom/object.c b/qom/object.c index 30c4f82..fb80013 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1822,7 +1822,7 @@ static void object_set_link_property(Object *obj, Visitor *v, } *child = new_target; - if (prop->flags == OBJ_PROP_LINK_STRONG) { + if (prop->flags & OBJ_PROP_LINK_STRONG) { object_ref(new_target); object_unref(old_target); } From patchwork Thu Jan 23 13:48:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228180 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=sALh1Zsd; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483RP03SCQz9sSP for ; Fri, 24 Jan 2020 02:42:44 +1100 (AEDT) Received: from localhost ([::1]:59640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iued0-0005bM-8R for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:42:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51835) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrj-0005V9-49 for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrh-0004LJ-RY for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:46 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:41201) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrh-0004K3-L8 for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:45 -0500 Received: by mail-wr1-x42e.google.com with SMTP id c9so3134247wrw.8 for ; Thu, 23 Jan 2020 05:49:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oY9cSuB59xRHq3LMhdI5P/MTn902Rp70IXIZQ4mig9A=; b=sALh1ZsdtUFtAdBPa9FNgNgdrTF76RO7Is9H+D9jkvyZkDfGMR6EORVWSp+MvdFKit Cj95nPfkK2MoKbV/JAvwoAZB9g78weMohReEUXzFWjxQW4Wm09fA7FFuCJhyWVnp6Lz2 sppw7Wy2//HEgXZ7TgRSnocpWRw/PNDBTw5DFakGMC8iHWvsRU/tL84gt+l0zJEFfQ2B vx20eUI6p0DhKI43VT7sh0p29wLtUobBfs7lKBJzZaHq51pEcRi2E8m1I+QUvDCvov5y fZahS05FgSUKC5MVGvks9aslnox37iZi9RVmlYckgiDF5yuJE8XD3qYZjO6jWRtAViET brdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=oY9cSuB59xRHq3LMhdI5P/MTn902Rp70IXIZQ4mig9A=; b=W4j1SEifLwxz6z+4XGNnz9PVwH3AOjVm+khx5RqcfS08nFdyEptgOr3eCenobDi32c /kSjtbw9EZwmZbqTKaim4kAVN6dgvr9IPiWOGaGW31NkiCCVsgJrTmZbz6f9ht1Zi9vy APzdBmyPEyXIDZrvuSr+VtSSijeQ+UREMEKkZ1mkQUc8Pkq7uf6Qw8u43+D8qu4xO6LW yFOPjyL61trIkg2ADoqBakSL4/H9uClOojmlw30DxDWjChlI/fKace7Yie9MCQyIkxZj w/BoKlAXcXlfBRcHK0oaTWlLHAaBuBaT/flUqq9G/l68PFTs5mbiqarSvHOdEEmJawei 5Qvg== X-Gm-Message-State: APjAAAVamMCK+qA8Octuja4gJUXDjcKaiydkSaPET17AC8I+z6PQEF18 1CJXjvVhc9rlzrU1Cf8W2aX8jhK+ X-Google-Smtp-Source: APXvYqzLlpKinutkCKRfNg3KktApGWz+LST7ZjgFeAL1LYe6qKAg+z7UbkRr5KZyBtUWuC/Fc14pYg== X-Received: by 2002:adf:f885:: with SMTP id u5mr17880815wrp.359.1579787384391; Thu, 23 Jan 2020 05:49:44 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:43 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 43/59] object: rename link "child" to "target" Date: Thu, 23 Jan 2020 14:48:46 +0100 Message-Id: <1579787342-27146-44-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42e X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau A child property is a different kind of property. Let's use "target" for the link target. Signed-off-by: Marc-André Lureau Message-Id: <20200110153039.1379601-14-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- include/qom/object.h | 4 ++-- qom/object.c | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index fb133d6..7e66bc7 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1545,7 +1545,7 @@ void object_property_allow_set_link(const Object *, const char *, * @obj: the object to add a property to * @name: the name of the property * @type: the qobj type of the link - * @child: a pointer to where the link object reference is stored + * @targetp: a pointer to where the link object reference is stored * @check: callback to veto setting or NULL if the property is read-only * @flags: additional options for the link * @errp: if an error occurs, a pointer to an area to store the error @@ -1570,7 +1570,7 @@ void object_property_allow_set_link(const Object *, const char *, * modified. */ void object_property_add_link(Object *obj, const char *name, - const char *type, Object **child, + const char *type, Object **targetp, void (*check)(const Object *obj, const char *name, Object *val, Error **errp), ObjectPropertyLinkFlags flags, diff --git a/qom/object.c b/qom/object.c index fb80013..ced5e0b 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1729,7 +1729,7 @@ void object_property_allow_set_link(const Object *obj, const char *name, } typedef struct { - Object **child; + Object **targetp; void (*check)(const Object *, const char *, Object *, Error **); ObjectPropertyLinkFlags flags; } LinkProperty; @@ -1739,11 +1739,11 @@ static void object_get_link_property(Object *obj, Visitor *v, Error **errp) { LinkProperty *lprop = opaque; - Object **child = lprop->child; + Object **targetp = lprop->targetp; gchar *path; - if (*child) { - path = object_get_canonical_path(*child); + if (*targetp) { + path = object_get_canonical_path(*targetp); visit_type_str(v, name, &path, errp); g_free(path); } else { @@ -1798,8 +1798,8 @@ static void object_set_link_property(Object *obj, Visitor *v, { Error *local_err = NULL; LinkProperty *prop = opaque; - Object **child = prop->child; - Object *old_target = *child; + Object **targetp = prop->targetp; + Object *old_target = *targetp; Object *new_target = NULL; char *path = NULL; @@ -1821,7 +1821,7 @@ static void object_set_link_property(Object *obj, Visitor *v, return; } - *child = new_target; + *targetp = new_target; if (prop->flags & OBJ_PROP_LINK_STRONG) { object_ref(new_target); object_unref(old_target); @@ -1832,7 +1832,7 @@ static Object *object_resolve_link_property(Object *parent, void *opaque, const { LinkProperty *lprop = opaque; - return *lprop->child; + return *lprop->targetp; } static void object_release_link_property(Object *obj, const char *name, @@ -1840,14 +1840,14 @@ static void object_release_link_property(Object *obj, const char *name, { LinkProperty *prop = opaque; - if ((prop->flags & OBJ_PROP_LINK_STRONG) && *prop->child) { - object_unref(*prop->child); + if ((prop->flags & OBJ_PROP_LINK_STRONG) && *prop->targetp) { + object_unref(*prop->targetp); } g_free(prop); } void object_property_add_link(Object *obj, const char *name, - const char *type, Object **child, + const char *type, Object **targetp, void (*check)(const Object *, const char *, Object *, Error **), ObjectPropertyLinkFlags flags, @@ -1858,7 +1858,7 @@ void object_property_add_link(Object *obj, const char *name, gchar *full_type; ObjectProperty *op; - prop->child = child; + prop->targetp = targetp; prop->check = check; prop->flags = flags; From patchwork Thu Jan 23 13:48:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228295 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Md/tOE2Y; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483SPb1GvLz9sP3 for ; Fri, 24 Jan 2020 03:28:19 +1100 (AEDT) Received: from localhost ([::1]:60398 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iufL6-000575-Pe for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 11:28:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51847) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrj-0005W9-UO for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucri-0004NM-OG for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:47 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:33988) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucri-0004LP-HF for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:46 -0500 Received: by mail-wr1-x436.google.com with SMTP id t2so3186079wrr.1 for ; Thu, 23 Jan 2020 05:49:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NKQefvh4U78BlEUri4dbdA4PBZUpYRKEAzo+PNIiyOU=; b=Md/tOE2YZwQVkSXXYiFxlNyLgzOaGdqxmNMXqPSwP9HdoPEODuHnolNbIutFLGmDQh IyeSIUVHEeGUOiy1GVmfEU5cdztZtPSmGFs4+pE50ybum3q54Cd7zKF4ROkFqS4ia5/l YaQqyD6XweqP7TJTor63jOc/iI9J3XqA2bJEhkfdVWk6iaZItBxuXeqqCXdw9ttR5cbn 6qY6ypxw6HpVYGNScu+xTK5lxGxoPm2MSlbpRIdsDrd55QfMj6Bs57NoZuoN4czMaqER 77+JC5ODZdSYfV9w7wNXN6t/018rPfO/9CpbQDKumjbFabt7mGoU4uAFCgIItQay/Zzi hoUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=NKQefvh4U78BlEUri4dbdA4PBZUpYRKEAzo+PNIiyOU=; b=uMwH2j7z64LI9t10QbRXuHO4ugjCWX75sKrT1nAhmmuVyjU3gjuvPvi+Bg21lMiwVd PYHQuoBpRfM9+GFxFB8Q9R8tmQMV70czoIOEsat1bFL5LrK2MNI4bhlrzLPlzjNxuKxN AGu4q6+j5hSU1LfY6I1uy12vw2ezEmwQVKxjuovGbD0dqd3wzSkspNxiRlYScj5CB0oA B0wno2jsP6+hAQwwwEuttjvyL5OrU2ssnm8KuQYba2rJq8W0CyFmrPc40+TcrR4m4ThX LKv0tqJHHUPCtPop/CF7UIGsYS/MN1gadr9Ef+hTblYRT0HbDfOXXnWlHPKwFyOznnoL jBEg== X-Gm-Message-State: APjAAAXiCjgjN3iOsZeZJmqQq1mjZ6HluS6DQhEKWaYQd0msGzRocpbB eArk/HxuUXF6+snCw9MGeR6MZh2d X-Google-Smtp-Source: APXvYqzk3N9W9Mna8U59ycNM+RLUi6njsjsa84+7ywowBwA3I49csIISfYGZ+wCvb2PkWaUCEHhNyQ== X-Received: by 2002:adf:e692:: with SMTP id r18mr17886336wrm.413.1579787385277; Thu, 23 Jan 2020 05:49:45 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:44 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 44/59] object: add direct link flag Date: Thu, 23 Jan 2020 14:48:47 +0100 Message-Id: <1579787342-27146-45-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::436 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Allow the link property to hold the pointer to the target, instead of indirectly through another variable. Signed-off-by: Marc-André Lureau Message-Id: <20200110153039.1379601-15-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- include/qom/object.h | 3 +++ qom/object.c | 26 ++++++++++++++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index 7e66bc7..5b02be6 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1528,6 +1528,9 @@ void object_property_add_child(Object *obj, const char *name, typedef enum { /* Unref the link pointer when the property is deleted */ OBJ_PROP_LINK_STRONG = 0x1, + + /* private */ + OBJ_PROP_LINK_DIRECT = 0x2, } ObjectPropertyLinkFlags; /** diff --git a/qom/object.c b/qom/object.c index ced5e0b..dff16da 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1729,17 +1729,30 @@ void object_property_allow_set_link(const Object *obj, const char *name, } typedef struct { - Object **targetp; + union { + Object **targetp; + Object *target; /* if OBJ_PROP_LINK_DIRECT, when holding the pointer */ + }; void (*check)(const Object *, const char *, Object *, Error **); ObjectPropertyLinkFlags flags; } LinkProperty; +static Object ** +object_link_get_targetp(Object *obj, LinkProperty *lprop) +{ + if (lprop->flags & OBJ_PROP_LINK_DIRECT) { + return &lprop->target; + } else { + return lprop->targetp; + } +} + static void object_get_link_property(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { LinkProperty *lprop = opaque; - Object **targetp = lprop->targetp; + Object **targetp = object_link_get_targetp(obj, lprop); gchar *path; if (*targetp) { @@ -1798,7 +1811,7 @@ static void object_set_link_property(Object *obj, Visitor *v, { Error *local_err = NULL; LinkProperty *prop = opaque; - Object **targetp = prop->targetp; + Object **targetp = object_link_get_targetp(obj, prop); Object *old_target = *targetp; Object *new_target = NULL; char *path = NULL; @@ -1832,16 +1845,17 @@ static Object *object_resolve_link_property(Object *parent, void *opaque, const { LinkProperty *lprop = opaque; - return *lprop->targetp; + return *object_link_get_targetp(parent, lprop); } static void object_release_link_property(Object *obj, const char *name, void *opaque) { LinkProperty *prop = opaque; + Object **targetp = object_link_get_targetp(obj, prop); - if ((prop->flags & OBJ_PROP_LINK_STRONG) && *prop->targetp) { - object_unref(*prop->targetp); + if ((prop->flags & OBJ_PROP_LINK_STRONG) && *targetp) { + object_unref(*targetp); } g_free(prop); } From patchwork Thu Jan 23 13:48:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228182 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=q8lXCI+P; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483RQw1SJZz9sSN for ; Fri, 24 Jan 2020 02:44:24 +1100 (AEDT) Received: from localhost ([::1]:59656 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iueec-00080N-3z for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:44:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51862) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrk-0005XJ-NJ for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrj-0004Q8-FI for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:48 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:44801) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrj-0004NB-8Z for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:47 -0500 Received: by mail-wr1-x434.google.com with SMTP id q10so3118222wrm.11 for ; Thu, 23 Jan 2020 05:49:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=awVtpnL9oZaP3rpg/kqMTiM2s2IPaZQzWstJTlLEN4g=; b=q8lXCI+PV7XGMvxyjCGHQEWtkcrtPuyTvJ0oA0xRTITdag3oNGNusZ/J++znp3zYcW y/9p2YeJ2EJa7cJN2oZg5op/mukYrfRZigFy9aDggCNNzoqyN6Zbw2Ig5QQzm2a6cWtD 9przIj+vene6hs+CxTFoMauNFMFVZp2S1tiVolk18SKYJO6rYFVajcVaGECsOE4M3k11 Hx1HwUZeOAStfjv6dQQdGXGQpmTXv0RwFmjQd8/roPfpGBRA2BGex38hcYt1lvztghAt EbIzUubiJ+Vc5+flmtn9RtDrgXal1F95KB9IjK+4vER4xKpwGY7hePwMP7NOfzNL+l4h VRhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=awVtpnL9oZaP3rpg/kqMTiM2s2IPaZQzWstJTlLEN4g=; b=DI+SCZG/ESUcEzQB7dSHxjPmcTxTmg5fF3ChPug7doRdZrh0qOQU15PjXa1uI/30dz BqM6qjaxY8L1rLG+YUGvPwy0CcqY4uQAqYtESy2lFVaf7wm8/Bpplgf61eQvSrr9F4P6 OLPspa07qdeIeUUs3VEhTLe20r+59W7AIVLmBRjUDOzkqoKLFd7d1/n8d2KX1TLHYWK2 GQ+/6LB6YSirKHXUzxPQky0ohcc4tZ9znbD0eOEub/RSly9VzYRImrcx6jTT/P78Y37X ti4mKWK+Shp+aMc4FpGnxI1tii9S+Aqs1nGDlT+uy3anKInWKPJQBcd1tz2zeRs/LtF2 RuKw== X-Gm-Message-State: APjAAAVgg6jEqWajnq1DSk+l8Sg9KOva7IZp+FohXynSENqu1ASPLALq wDTiwjh8sblo7rw28rNh5MczihAi X-Google-Smtp-Source: APXvYqzve2MTsqCnFxlxICNo/jk4iat5ibpG962voyuGw8AoueHQO24WyGKUfUpfAhWenVbKFWyuVQ== X-Received: by 2002:adf:f581:: with SMTP id f1mr17817310wro.264.1579787386138; Thu, 23 Jan 2020 05:49:46 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:45 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 45/59] object: express const link with link property Date: Thu, 23 Jan 2020 14:48:48 +0100 Message-Id: <1579787342-27146-46-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::434 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Let's not mix child property and link property callbacks, as this is confusing, use LinkProperty with DIRECT flag to hold the target pointer. Signed-off-by: Marc-André Lureau Message-Id: <20200110153039.1379601-16-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- qom/object.c | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/qom/object.c b/qom/object.c index dff16da..e6617c2 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1860,19 +1860,23 @@ static void object_release_link_property(Object *obj, const char *name, g_free(prop); } -void object_property_add_link(Object *obj, const char *name, - const char *type, Object **targetp, - void (*check)(const Object *, const char *, - Object *, Error **), - ObjectPropertyLinkFlags flags, - Error **errp) +static void object_add_link_prop(Object *obj, const char *name, + const char *type, void *ptr, + void (*check)(const Object *, const char *, + Object *, Error **), + ObjectPropertyLinkFlags flags, + Error **errp) { Error *local_err = NULL; LinkProperty *prop = g_malloc(sizeof(*prop)); gchar *full_type; ObjectProperty *op; - prop->targetp = targetp; + if (flags & OBJ_PROP_LINK_DIRECT) { + prop->target = ptr; + } else { + prop->targetp = ptr; + } prop->check = check; prop->flags = flags; @@ -1896,20 +1900,21 @@ out: g_free(full_type); } +void object_property_add_link(Object *obj, const char *name, + const char *type, Object **targetp, + void (*check)(const Object *, const char *, + Object *, Error **), + ObjectPropertyLinkFlags flags, + Error **errp) +{ + object_add_link_prop(obj, name, type, targetp, check, flags, errp); +} + void object_property_add_const_link(Object *obj, const char *name, Object *target, Error **errp) { - char *link_type; - ObjectProperty *op; - - link_type = g_strdup_printf("link<%s>", object_get_typename(target)); - op = object_property_add(obj, name, link_type, - object_get_child_property, NULL, - NULL, target, errp); - if (op != NULL) { - op->resolve = object_resolve_child_property; - } - g_free(link_type); + object_add_link_prop(obj, name, object_get_typename(target), target, + NULL, OBJ_PROP_LINK_DIRECT, errp); } gchar *object_get_canonical_path_component(Object *obj) From patchwork Thu Jan 23 13:48:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228303 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=fY5gi3b+; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483STB6FS8z9sP3 for ; Fri, 24 Jan 2020 03:31:26 +1100 (AEDT) Received: from localhost ([::1]:60437 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iufO7-0000H7-3U for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 11:31:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51873) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrl-0005YP-9Y for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrk-0004Qo-40 for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:49 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:35780) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrj-0004Pt-U6 for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:48 -0500 Received: by mail-wm1-x32a.google.com with SMTP id p17so2627021wmb.0 for ; Thu, 23 Jan 2020 05:49:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cd+8u3Y9MnihrkwTGy/lli6q5rm4tiEDd8ttjlcyi+Y=; b=fY5gi3b+R/Q7Y5xcOLoFItIkBhJhfFs34vhQXuPdWE9iPIKzleSFiM0PCOBAiObV0L xWJaW2u6zEuI8yNJ6wx0zlg+OVEs7gaI1NMiVqWSWIvWdYELS6zgHTB9jJPt23rge7vJ M7eCOG0knkh3rFmACPVORZdCtc41DABpbK8DG4Wr0fhEJInjqG2XRpdsy2WrSxM+T+Xm V7XMbDbZJSOMzZOI64wEwMPCGYeN5trSMZynZVTySfHZ7a0ZnIqLxnTWa4Y6HhR1xwVD Ss0wdQm2g+bOeLIbXLb8w9TKUWr99L7d+rw1S6bYuFmffo316/mfBumFWAlNr4xExNue Fy2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=cd+8u3Y9MnihrkwTGy/lli6q5rm4tiEDd8ttjlcyi+Y=; b=mXP1ksujRHc+kEmiLxCweVRn3ym+R6TyrUWsIFog/HeHwIRvE0iQAJxZVWWT4sR+3j pPa11AkvL79Xz2J8RnN0bKwekh0ZwDajJyijeSCphjeCst7jjgRA74i166Fv3zYnweMB KQ20RAldFavwkR0tdyqd6c9pU6NbJ82UUQRwLMdfp9Kgyu86G0tI74FjyvQUHdAtsHCi z/kHUqCQwhHlx8rjsR6thwn0KG8FfNPxN3O5g6HdcX/4HZvQZXOjqlkkN92O8W56bo6x 2GqDtV7caCSGLblpaMe4/H5udLLWqaYwIZ8GMG7AjwlgNRYkrMp+fN90ylqncHBOnnRa okcQ== X-Gm-Message-State: APjAAAUtfvOnjcp27QW7zraRks7oyuhTn+ETvZAiyzztyCCM+5ft4+PP GMHbcXV5GJtUzpFk674Lh8ncO1Z7 X-Google-Smtp-Source: APXvYqx2PDnXFhMA/Tsr13uvWIGvpsVKECzYy3SETcNwBjVH2Rqf/nfbpj5nKAZ8pVDwpJtQwwT7wQ== X-Received: by 2002:a7b:cae9:: with SMTP id t9mr4281454wml.186.1579787386872; Thu, 23 Jan 2020 05:49:46 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:46 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 46/59] object: add object_class_property_add_link() Date: Thu, 23 Jan 2020 14:48:49 +0100 Message-Id: <1579787342-27146-47-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32a X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Message-Id: <20200110153039.1379601-17-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- include/qom/object.h | 9 +++++++++ qom/object.c | 46 +++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/include/qom/object.h b/include/qom/object.h index 5b02be6..ead9129 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1531,6 +1531,7 @@ typedef enum { /* private */ OBJ_PROP_LINK_DIRECT = 0x2, + OBJ_PROP_LINK_CLASS = 0x4, } ObjectPropertyLinkFlags; /** @@ -1579,6 +1580,14 @@ void object_property_add_link(Object *obj, const char *name, ObjectPropertyLinkFlags flags, Error **errp); +ObjectProperty *object_class_property_add_link(ObjectClass *oc, + const char *name, + const char *type, ptrdiff_t offset, + void (*check)(const Object *obj, const char *name, + Object *val, Error **errp), + ObjectPropertyLinkFlags flags, + Error **errp); + /** * object_property_add_str: * @obj: the object to add a property to diff --git a/qom/object.c b/qom/object.c index e6617c2..202d576 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1732,6 +1732,7 @@ typedef struct { union { Object **targetp; Object *target; /* if OBJ_PROP_LINK_DIRECT, when holding the pointer */ + ptrdiff_t offset; /* if OBJ_PROP_LINK_CLASS */ }; void (*check)(const Object *, const char *, Object *, Error **); ObjectPropertyLinkFlags flags; @@ -1742,6 +1743,8 @@ object_link_get_targetp(Object *obj, LinkProperty *lprop) { if (lprop->flags & OBJ_PROP_LINK_DIRECT) { return &lprop->target; + } else if (lprop->flags & OBJ_PROP_LINK_CLASS) { + return (void *)obj + lprop->offset; } else { return lprop->targetp; } @@ -1857,7 +1860,9 @@ static void object_release_link_property(Object *obj, const char *name, if ((prop->flags & OBJ_PROP_LINK_STRONG) && *targetp) { object_unref(*targetp); } - g_free(prop); + if (!(prop->flags & OBJ_PROP_LINK_CLASS)) { + g_free(prop); + } } static void object_add_link_prop(Object *obj, const char *name, @@ -1910,6 +1915,45 @@ void object_property_add_link(Object *obj, const char *name, object_add_link_prop(obj, name, type, targetp, check, flags, errp); } +ObjectProperty * +object_class_property_add_link(ObjectClass *oc, + const char *name, + const char *type, ptrdiff_t offset, + void (*check)(const Object *obj, const char *name, + Object *val, Error **errp), + ObjectPropertyLinkFlags flags, + Error **errp) +{ + Error *local_err = NULL; + LinkProperty *prop = g_new0(LinkProperty, 1); + gchar *full_type; + ObjectProperty *op; + + prop->offset = offset; + prop->check = check; + prop->flags = flags | OBJ_PROP_LINK_CLASS; + + full_type = g_strdup_printf("link<%s>", type); + + op = object_class_property_add(oc, name, full_type, + object_get_link_property, + check ? object_set_link_property : NULL, + object_release_link_property, + prop, + &local_err); + if (local_err) { + error_propagate(errp, local_err); + g_free(prop); + goto out; + } + + op->resolve = object_resolve_link_property; + +out: + g_free(full_type); + return op; +} + void object_property_add_const_link(Object *obj, const char *name, Object *target, Error **errp) { From patchwork Thu Jan 23 13:48:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228185 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Bvqam1BT; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483RTY701jz9sSN for ; Fri, 24 Jan 2020 02:46:41 +1100 (AEDT) Received: from localhost ([::1]:59700 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuegp-0002uK-45 for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:46:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51885) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrl-0005ZT-Vk for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrk-0004SN-Ua for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:49 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:40809) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrk-0004Qs-O5 for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:48 -0500 Received: by mail-wm1-x329.google.com with SMTP id t14so2595748wmi.5 for ; Thu, 23 Jan 2020 05:49:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6W21RtF4MhsJPffhnX5gfH1aakhUYnRTEcxuzNxGkrI=; b=Bvqam1BTeYAY8Q9IFxflI6GOooT7M8E4BXoPA6YiaS2i/bdUjm0fA4VFVMwTvCAt52 XVkIRVKgsSe/hUGguukjLKuJk4H6wfl+rFBRRaRtVhgXuIYqOxfJkPFYHk6nHIlvgXLl XDGJ55R6zaHSIqQpJK1uO5aeLjXtYT0bfMmbPxVCRhbMVZVccl+QRfKhGp4ec1ZYWzsE ORh/i7TqtLqPlgZvMKDs0ZEa+0bOrnhD0oqlNA5donLXQxrmb6VPs1oAvmAdX3suf4Hm BTL2UmYjlkKSB1JK8725h6thrhK/wQ3N7527AjVjttoutcl/WU2XhSARu1F5eN5MEiRv hUgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=6W21RtF4MhsJPffhnX5gfH1aakhUYnRTEcxuzNxGkrI=; b=LT0f6uOUmV0pibkLXJXJ18R3z8mMWIx89rqGqOtxOfl/5ERAQSFwDjfoT+Vme8GW80 gZGGs6/1oj1DymY6xgBSoaX/3fMrFB0EfMwPltalPU33xWqB95HIV7GDPlYX51fjtP9I MQ8guDLGTCL9sckGcFwCPOUcuzNEt08VX1N8RYsF2QmOYpw42rtcNzBj69Dpn+ejNrvK X4A24ul75w6/6IF6pSbrZgHO6c8XuinA9osLyxNvgqP9dcVfLXZ1P1YRGFplMatsmqss tRUTBYP+Va4UnA3gEaJrXSVkYCfFC+sFSwaWX2Oex3McwX6Sqdum9pu2zvT9Zjz7E0R9 H/1A== X-Gm-Message-State: APjAAAULBq86ieOYJj5ytkLLURiUn4zb+zv2v81CveYZUKlj4Lxdbp2K PvVnopU6tshNpr4iNUAszByU7ra0 X-Google-Smtp-Source: APXvYqynm/nCI1LJsNISgpTFGkd7OSMtzbSQRhDwbypMjZ7B5LgP/HpWDXTPDk+3id5qJOoYvE7O4g== X-Received: by 2002:a1c:9602:: with SMTP id y2mr4284529wmd.23.1579787387607; Thu, 23 Jan 2020 05:49:47 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:47 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 47/59] object: release all props Date: Thu, 23 Jan 2020 14:48:50 +0100 Message-Id: <1579787342-27146-48-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::329 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Class properties may have to release resources when the object is destroyed. Let's use the existing release() callback for that, but class properties must not release ObjectProperty, as it can be shared by various instances. Signed-off-by: Marc-André Lureau Message-Id: <20200110153039.1379601-18-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- qom/object.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/qom/object.c b/qom/object.c index 202d576..84d234d 100644 --- a/qom/object.c +++ b/qom/object.c @@ -592,23 +592,22 @@ static inline bool object_property_is_child(ObjectProperty *prop) static void object_property_del_all(Object *obj) { + g_autoptr(GHashTable) done = g_hash_table_new(NULL, NULL); ObjectProperty *prop; - GHashTableIter iter; - gpointer key, value; + ObjectPropertyIterator iter; bool released; do { released = false; - g_hash_table_iter_init(&iter, obj->properties); - while (g_hash_table_iter_next(&iter, &key, &value)) { - prop = value; - if (prop->release) { - prop->release(obj, prop->name, prop->opaque); - prop->release = NULL; - released = true; - break; + object_property_iter_init(&iter, obj); + while ((prop = object_property_iter_next(&iter)) != NULL) { + if (g_hash_table_add(done, prop)) { + if (prop->release) { + prop->release(obj, prop->name, prop->opaque); + released = true; + break; + } } - g_hash_table_iter_remove(&iter); } } while (released); From patchwork Thu Jan 23 13:48:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228196 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=lIySqjIG; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483RfZ02Mhz9sPW for ; Fri, 24 Jan 2020 02:54:30 +1100 (AEDT) Received: from localhost ([::1]:59820 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iueoN-0005Ns-Ib for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:54:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51897) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrm-0005ad-TQ for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrl-0004VT-Qg for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:50 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:35787) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrl-0004Si-Jz for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:49 -0500 Received: by mail-wm1-x331.google.com with SMTP id p17so2627119wmb.0 for ; Thu, 23 Jan 2020 05:49:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MIVPt6AfB7Si2oRFoeO2RPXJ/HSxWbOijJs6IvacXC4=; b=lIySqjIGpijZ4dJsytu6VCMwAxKpQ5v2GVAVUZbn+bW3fkWMrtSfx9kuRu3XMDaZ92 s5NfXcJX9lMjUcmKEj4DRN/V29TD8Ttn3nQUs/o7SlIeeRDxdKNjdgydOmIhyX7jOeVw i3G0VFA6rMjtBa50l7OxsjT0Ct3yMUau3Lkpvx0sRfEo8eb07gtjMfXXc+BW8n5DnX+3 5PQ9xzbEN8oDGTs8iKUmmAHaQW3ZH6OCOnQ0k9TxH1kuKXfEv+YZvWPIOJAWNY9QwAFU WBgZqL4c1e+dvwj41SkHFg49Jd/1G8W1d3q5KI9Pr/7gGn1UjzR30xrE18sq0//fEOzT uthQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=MIVPt6AfB7Si2oRFoeO2RPXJ/HSxWbOijJs6IvacXC4=; b=V3y5EFQ0WB4mqpuf8TmuNizxFcjYx/qD6sj7X7UfXnml8aKZU1JADoYLFPt0BKIxJg /p2bM8ftJ3eI9b0lVfld1ue/tO3h2SwZybwG7r2cwsjy/Cxzr0UFgdsY/pgJj51ah72p Pavi3uVZwoNFE9WcoiP/9erHMgr+ISH0XkC2gras5cnuK985HjM1QILy0qt4Muqd4m3W hI9rlYJPSafqcMOXzaLBzW6NLbSlfTmMyE5poEbOPiKRvnR9XgmrXrnBxr3AjliMtAjC BXSiwxosOEWhHyUgrClcYTtYqMrYbV8KsS6ydig8dJ736AH/WM0cRNF3lKx07LKxasV4 gC/Q== X-Gm-Message-State: APjAAAVHmMkS8mh4hAZ3EBTLHK3J92x9mDVzQ/tTshhsht19c4TC8Pes WEOZVil4RRw6M1edloHEzXBE5NY8 X-Google-Smtp-Source: APXvYqze5kc9ykXYM8BnoZ3clWESdXoRjAOe6WhscklrehcuAJ78m2JToo+E0pbKDefkz1n+urrw/w== X-Received: by 2002:a7b:cc98:: with SMTP id p24mr4384055wma.139.1579787388489; Thu, 23 Jan 2020 05:49:48 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:47 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 48/59] object: return self in object_ref() Date: Thu, 23 Jan 2020 14:48:51 +0100 Message-Id: <1579787342-27146-49-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::331 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau This allow for simpler assignment with ref: foo = object_ref(bar) Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20200110153039.1379601-19-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- include/qom/object.h | 3 ++- qom/object.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index ead9129..933e5c6 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1013,8 +1013,9 @@ GSList *object_class_get_list_sorted(const char *implements_type, * * Increase the reference count of a object. A object cannot be freed as long * as its reference count is greater than zero. + * Returns: @obj */ -void object_ref(Object *obj); +Object *object_ref(Object *obj); /** * object_unref: diff --git a/qom/object.c b/qom/object.c index 84d234d..b774507 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1107,12 +1107,13 @@ GSList *object_class_get_list_sorted(const char *implements_type, object_class_cmp); } -void object_ref(Object *obj) +Object *object_ref(Object *obj) { if (!obj) { - return; + return NULL; } atomic_inc(&obj->ref); + return obj; } void object_unref(Object *obj) From patchwork Thu Jan 23 13:48:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228307 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=YshZpqrB; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483SYh2v1fz9sSH for ; Fri, 24 Jan 2020 03:35:20 +1100 (AEDT) Received: from localhost ([::1]:60508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iufRt-00043e-Oj for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 11:35:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51967) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucs0-0005yW-HO for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:50:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucrq-0004fy-6N for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:50:04 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:52982) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrp-0004dc-B8 for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:54 -0500 Received: by mail-wm1-x32b.google.com with SMTP id p9so2646254wmc.2 for ; Thu, 23 Jan 2020 05:49:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4jPXnQmwELiNj9kqW2n0AlsjIfg6aTN6AfZpHbt1gi4=; b=YshZpqrB9cFeHskOikdm5mnuxb4+P7ggPNok5YF7h5SbpZ/PhFYitjMARhFuFZ2TAq ejYDQBc18YXkeuSwfl73dFv11ajIVwR02XivDvTzkze95p6hDaNnTyHndDPxTw7dD30C pxdz7alm9aqOoj/8q0MXOtv20oyPRnWQlrWqau+aBIV6Q4YCZ996Mh73yzmRXGwNnTyy I3jAl2ETipEt7wdp+hGMZWcoiEscwRwyEQm3ynquoddqLUPAxm50SYzvsj3Wqy6jig0K S0zZ23U0cshvkvCBYTTMEpZniu3NfpkUMnbJoXJa6H6ywB50UfkBfRWTbXyiLSuA2rKs DtNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=4jPXnQmwELiNj9kqW2n0AlsjIfg6aTN6AfZpHbt1gi4=; b=BV8WwSBPqQZ52MJQSJG8wSIR1oBhrSH7uOmK+iDekenxgaOqtGIC7uMJ5yes2itJtD wNoqYxFexlhFJkk50F9lsREFSkW4jWQOXjVXLhGrib8GBUH4dEoG9JoKjECvDLudt0dL 0wZxK5q6iZ6hNvRMGHVEf4NTX21UlegVsgqf/NpudnKAfqCvHeYKrEJb60L6pi0o4Msf QJ9YUkkLnHjqJKiJSSbfY+szEggqhk0ZflqHnGm/fl2bgmr43wROAbkNLpMUP7Ch6A6i U5JmI2EksPrW1GSALsNdh1amZHkgXAL+BeRvyQHdkXvdUZVyfGTYKWg4Ut3dqQLloYFU BnAg== X-Gm-Message-State: APjAAAW24uwh8u0N6pZWCp+r80kQtf8zLF8ivTm+1vzCKnhStcToqxbQ 8YBQD4cvvMc2g0ztCynQxYLhRn7s X-Google-Smtp-Source: APXvYqxXpiDU6SPj5Y3wceoBrcRFq6PuomRcqsjf45Np3+B7vVjpEhwJew1qM6pM0lUm8Yl8GzlsJQ== X-Received: by 2002:a05:600c:2318:: with SMTP id 24mr4457561wmo.48.1579787389879; Thu, 23 Jan 2020 05:49:49 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:48 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 49/59] qdev: set properties with device_class_set_props() Date: Thu, 23 Jan 2020 14:48:52 +0100 Message-Id: <1579787342-27146-50-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32b X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau The following patch will need to handle properties registration during class_init time. Let's use a device_class_set_props() setter. spatch --macro-file scripts/cocci-macro-file.h --sp-file ./scripts/coccinelle/qdev-set-props.cocci --keep-comments --in-place --dir . @@ typedef DeviceClass; DeviceClass *d; expression val; @@ - d->props = val + device_class_set_props(d, val) Signed-off-by: Marc-André Lureau Message-Id: <20200110153039.1379601-20-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- hw/9pfs/virtio-9p-device.c | 2 +- hw/acpi/generic_event_device.c | 2 +- hw/acpi/piix4.c | 2 +- hw/acpi/vmgenid.c | 2 +- hw/arm/armsse.c | 2 +- hw/arm/armv7m.c | 4 ++-- hw/arm/aspeed_soc.c | 2 +- hw/arm/bcm2836.c | 2 +- hw/arm/integratorcp.c | 2 +- hw/arm/msf2-soc.c | 2 +- hw/arm/musicpal.c | 2 +- hw/arm/nrf51_soc.c | 2 +- hw/arm/pxa2xx.c | 4 ++-- hw/arm/pxa2xx_gpio.c | 2 +- hw/arm/smmu-common.c | 2 +- hw/arm/spitz.c | 2 +- hw/arm/stm32f205_soc.c | 2 +- hw/arm/strongarm.c | 2 +- hw/arm/xlnx-versal.c | 2 +- hw/arm/xlnx-zynqmp.c | 2 +- hw/audio/ac97.c | 2 +- hw/audio/adlib.c | 2 +- hw/audio/cs4231.c | 2 +- hw/audio/cs4231a.c | 2 +- hw/audio/es1370.c | 2 +- hw/audio/gus.c | 2 +- hw/audio/hda-codec.c | 2 +- hw/audio/intel-hda.c | 4 ++-- hw/audio/milkymist-ac97.c | 2 +- hw/audio/pcspk.c | 2 +- hw/audio/pl041.c | 2 +- hw/audio/sb16.c | 2 +- hw/audio/wm8750.c | 2 +- hw/block/fdc.c | 8 ++++---- hw/block/m25p80.c | 2 +- hw/block/nand.c | 2 +- hw/block/nvme.c | 2 +- hw/block/onenand.c | 2 +- hw/block/pflash_cfi01.c | 2 +- hw/block/pflash_cfi02.c | 2 +- hw/block/swim.c | 2 +- hw/block/vhost-user-blk.c | 2 +- hw/block/virtio-blk.c | 2 +- hw/block/xen-block.c | 2 +- hw/char/bcm2835_aux.c | 2 +- hw/char/cadence_uart.c | 2 +- hw/char/cmsdk-apb-uart.c | 2 +- hw/char/debugcon.c | 2 +- hw/char/digic-uart.c | 2 +- hw/char/escc.c | 2 +- hw/char/etraxfs_ser.c | 2 +- hw/char/exynos4210_uart.c | 2 +- hw/char/grlib_apbuart.c | 2 +- hw/char/imx_serial.c | 2 +- hw/char/ipoctal232.c | 2 +- hw/char/lm32_juart.c | 2 +- hw/char/lm32_uart.c | 2 +- hw/char/mcf_uart.c | 2 +- hw/char/milkymist-uart.c | 2 +- hw/char/nrf51_uart.c | 2 +- hw/char/parallel.c | 2 +- hw/char/pl011.c | 2 +- hw/char/sclpconsole-lm.c | 2 +- hw/char/sclpconsole.c | 2 +- hw/char/serial-isa.c | 2 +- hw/char/serial-pci-multi.c | 4 ++-- hw/char/serial-pci.c | 2 +- hw/char/serial.c | 4 ++-- hw/char/spapr_vty.c | 2 +- hw/char/stm32f2xx_usart.c | 2 +- hw/char/terminal3270.c | 2 +- hw/char/virtio-console.c | 2 +- hw/char/virtio-serial-bus.c | 4 ++-- hw/char/xilinx_uartlite.c | 2 +- hw/core/cpu.c | 2 +- hw/core/generic-loader.c | 2 +- hw/core/or-irq.c | 2 +- hw/core/platform-bus.c | 2 +- hw/core/qdev.c | 5 +++++ hw/core/split-irq.c | 2 +- hw/cpu/a15mpcore.c | 2 +- hw/cpu/a9mpcore.c | 2 +- hw/cpu/arm11mpcore.c | 2 +- hw/cpu/cluster.c | 2 +- hw/cpu/realview_mpcore.c | 2 +- hw/display/ati.c | 2 +- hw/display/bcm2835_fb.c | 2 +- hw/display/bochs-display.c | 2 +- hw/display/cg3.c | 2 +- hw/display/cirrus_vga.c | 2 +- hw/display/cirrus_vga_isa.c | 2 +- hw/display/g364fb.c | 2 +- hw/display/i2c-ddc.c | 2 +- hw/display/macfb.c | 4 ++-- hw/display/milkymist-vgafb.c | 2 +- hw/display/qxl.c | 2 +- hw/display/ramfb-standalone.c | 2 +- hw/display/sm501.c | 4 ++-- hw/display/tcx.c | 2 +- hw/display/vga-isa.c | 2 +- hw/display/vga-pci.c | 4 ++-- hw/display/vhost-user-gpu.c | 2 +- hw/display/virtio-gpu-pci.c | 2 +- hw/display/virtio-gpu.c | 2 +- hw/display/virtio-vga.c | 2 +- hw/display/vmware_vga.c | 2 +- hw/dma/i82374.c | 2 +- hw/dma/i8257.c | 2 +- hw/dma/pl080.c | 2 +- hw/dma/pl330.c | 2 +- hw/dma/pxa2xx_dma.c | 2 +- hw/dma/xilinx_axidma.c | 2 +- hw/dma/xlnx-zdma.c | 2 +- hw/gpio/imx_gpio.c | 2 +- hw/gpio/omap_gpio.c | 4 ++-- hw/i2c/aspeed_i2c.c | 2 +- hw/i2c/core.c | 2 +- hw/i2c/omap_i2c.c | 2 +- hw/i386/intel_iommu.c | 2 +- hw/i386/kvm/clock.c | 2 +- hw/i386/kvm/i8254.c | 2 +- hw/i386/kvm/ioapic.c | 2 +- hw/i386/vmmouse.c | 2 +- hw/i386/x86-iommu.c | 2 +- hw/i386/xen/xen_pvdevice.c | 2 +- hw/ide/ahci.c | 2 +- hw/ide/cmd646.c | 2 +- hw/ide/isa.c | 2 +- hw/ide/macio.c | 2 +- hw/ide/mmio.c | 2 +- hw/ide/qdev.c | 8 ++++---- hw/input/adb.c | 2 +- hw/input/milkymist-softusb.c | 2 +- hw/input/virtio-input-hid.c | 6 +++--- hw/input/virtio-input-host.c | 2 +- hw/input/virtio-input.c | 2 +- hw/intc/apic_common.c | 2 +- hw/intc/arm_gic_common.c | 2 +- hw/intc/arm_gicv2m.c | 2 +- hw/intc/arm_gicv3_common.c | 2 +- hw/intc/arm_gicv3_its_kvm.c | 2 +- hw/intc/armv7m_nvic.c | 2 +- hw/intc/exynos4210_combiner.c | 2 +- hw/intc/exynos4210_gic.c | 4 ++-- hw/intc/i8259_common.c | 2 +- hw/intc/ioapic.c | 2 +- hw/intc/mips_gic.c | 2 +- hw/intc/omap_intc.c | 4 ++-- hw/intc/ompic.c | 2 +- hw/intc/openpic.c | 2 +- hw/intc/openpic_kvm.c | 2 +- hw/intc/pnv_xive.c | 2 +- hw/intc/s390_flic.c | 2 +- hw/intc/spapr_xive.c | 2 +- hw/intc/xics.c | 4 ++-- hw/intc/xilinx_intc.c | 2 +- hw/intc/xive.c | 6 +++--- hw/intc/xlnx-pmu-iomod-intc.c | 2 +- hw/ipack/ipack.c | 2 +- hw/ipmi/ipmi.c | 2 +- hw/ipmi/ipmi_bmc_extern.c | 2 +- hw/ipmi/ipmi_bmc_sim.c | 2 +- hw/ipmi/isa_ipmi_bt.c | 2 +- hw/ipmi/isa_ipmi_kcs.c | 2 +- hw/isa/lpc_ich9.c | 2 +- hw/isa/pc87312.c | 2 +- hw/isa/vt82c686.c | 2 +- hw/mem/nvdimm.c | 2 +- hw/mem/pc-dimm.c | 2 +- hw/mips/cps.c | 2 +- hw/misc/a9scu.c | 2 +- hw/misc/applesmc.c | 2 +- hw/misc/arm11scu.c | 2 +- hw/misc/arm_l2x0.c | 2 +- hw/misc/arm_sysctl.c | 2 +- hw/misc/armsse-cpuid.c | 2 +- hw/misc/aspeed_scu.c | 2 +- hw/misc/aspeed_sdmc.c | 2 +- hw/misc/bcm2835_property.c | 2 +- hw/misc/debugexit.c | 2 +- hw/misc/eccmemctl.c | 2 +- hw/misc/iotkit-sysctl.c | 2 +- hw/misc/iotkit-sysinfo.c | 2 +- hw/misc/ivshmem.c | 4 ++-- hw/misc/mac_via.c | 2 +- hw/misc/macio/cuda.c | 2 +- hw/misc/macio/macio.c | 4 ++-- hw/misc/macio/pmu.c | 2 +- hw/misc/mips_cmgcr.c | 2 +- hw/misc/mips_cpc.c | 2 +- hw/misc/mips_itu.c | 2 +- hw/misc/mos6522.c | 2 +- hw/misc/mps2-fpgaio.c | 2 +- hw/misc/mps2-scc.c | 2 +- hw/misc/msf2-sysreg.c | 2 +- hw/misc/nrf51_rng.c | 2 +- hw/misc/pci-testdev.c | 2 +- hw/misc/pvpanic.c | 2 +- hw/misc/tz-mpc.c | 2 +- hw/misc/tz-msc.c | 2 +- hw/misc/tz-ppc.c | 2 +- hw/misc/unimp.c | 2 +- hw/net/allwinner_emac.c | 2 +- hw/net/cadence_gem.c | 2 +- hw/net/dp8393x.c | 2 +- hw/net/e1000.c | 2 +- hw/net/e1000e.c | 2 +- hw/net/eepro100.c | 2 +- hw/net/etraxfs_eth.c | 2 +- hw/net/fsl_etsec/etsec.c | 2 +- hw/net/ftgmac100.c | 4 ++-- hw/net/imx_fec.c | 2 +- hw/net/lan9118.c | 2 +- hw/net/lance.c | 2 +- hw/net/mcf_fec.c | 2 +- hw/net/milkymist-minimac2.c | 2 +- hw/net/mipsnet.c | 2 +- hw/net/ne2000-isa.c | 2 +- hw/net/ne2000-pci.c | 2 +- hw/net/opencores_eth.c | 2 +- hw/net/pcnet-pci.c | 2 +- hw/net/rocker/rocker.c | 2 +- hw/net/rtl8139.c | 2 +- hw/net/smc91c111.c | 2 +- hw/net/spapr_llan.c | 2 +- hw/net/stellaris_enet.c | 2 +- hw/net/sungem.c | 2 +- hw/net/sunhme.c | 2 +- hw/net/tulip.c | 2 +- hw/net/virtio-net.c | 2 +- hw/net/vmxnet3.c | 2 +- hw/net/xgmac.c | 2 +- hw/net/xilinx_axienet.c | 2 +- hw/net/xilinx_ethlite.c | 2 +- hw/nvram/ds1225y.c | 2 +- hw/nvram/eeprom_at24c.c | 2 +- hw/nvram/fw_cfg.c | 4 ++-- hw/nvram/mac_nvram.c | 2 +- hw/nvram/nrf51_nvm.c | 2 +- hw/nvram/spapr_nvram.c | 2 +- hw/pci-bridge/gen_pcie_root_port.c | 2 +- hw/pci-bridge/pci_bridge_dev.c | 2 +- hw/pci-bridge/pci_expander_bridge.c | 4 ++-- hw/pci-bridge/pcie_pci_bridge.c | 2 +- hw/pci-bridge/pcie_root_port.c | 2 +- hw/pci-bridge/xio3130_downstream.c | 2 +- hw/pci-host/grackle.c | 2 +- hw/pci-host/i440fx.c | 2 +- hw/pci-host/ppce500.c | 2 +- hw/pci-host/prep.c | 2 +- hw/pci-host/q35.c | 4 ++-- hw/pci-host/sabre.c | 2 +- hw/pci-host/uninorth.c | 2 +- hw/pci-host/versatile.c | 2 +- hw/pci-host/xilinx-pcie.c | 2 +- hw/pci/pci.c | 2 +- hw/pci/pcie_port.c | 4 ++-- hw/ppc/pnv.c | 2 +- hw/ppc/pnv_core.c | 4 ++-- hw/ppc/pnv_homer.c | 2 +- hw/ppc/pnv_lpc.c | 2 +- hw/ppc/pnv_occ.c | 2 +- hw/ppc/pnv_pnor.c | 2 +- hw/ppc/pnv_psi.c | 2 +- hw/ppc/ppc440_uc.c | 2 +- hw/ppc/prep_systemio.c | 2 +- hw/ppc/rs6000_mc.c | 2 +- hw/ppc/spapr_cpu_core.c | 2 +- hw/ppc/spapr_pci.c | 2 +- hw/ppc/spapr_rng.c | 2 +- hw/ppc/spapr_tpm_proxy.c | 2 +- hw/rdma/vmw/pvrdma_main.c | 2 +- hw/riscv/riscv_hart.c | 2 +- hw/riscv/sifive_clint.c | 2 +- hw/riscv/sifive_plic.c | 2 +- hw/riscv/sifive_u_otp.c | 2 +- hw/rtc/m48t59-isa.c | 2 +- hw/rtc/m48t59.c | 2 +- hw/rtc/mc146818rtc.c | 2 +- hw/rtc/pl031.c | 2 +- hw/s390x/3270-ccw.c | 2 +- hw/s390x/ccw-device.c | 2 +- hw/s390x/css-bridge.c | 2 +- hw/s390x/ipl.c | 2 +- hw/s390x/s390-pci-bus.c | 2 +- hw/s390x/vhost-vsock-ccw.c | 2 +- hw/s390x/virtio-ccw-9p.c | 2 +- hw/s390x/virtio-ccw-balloon.c | 2 +- hw/s390x/virtio-ccw-blk.c | 2 +- hw/s390x/virtio-ccw-crypto.c | 2 +- hw/s390x/virtio-ccw-gpu.c | 2 +- hw/s390x/virtio-ccw-input.c | 2 +- hw/s390x/virtio-ccw-net.c | 2 +- hw/s390x/virtio-ccw-rng.c | 2 +- hw/s390x/virtio-ccw-scsi.c | 4 ++-- hw/s390x/virtio-ccw-serial.c | 2 +- hw/scsi/megasas.c | 2 +- hw/scsi/mptsas.c | 2 +- hw/scsi/scsi-bus.c | 2 +- hw/scsi/scsi-disk.c | 8 ++++---- hw/scsi/scsi-generic.c | 2 +- hw/scsi/spapr_vscsi.c | 2 +- hw/scsi/vhost-scsi.c | 2 +- hw/scsi/vhost-user-scsi.c | 2 +- hw/scsi/virtio-scsi.c | 2 +- hw/scsi/vmw_pvscsi.c | 2 +- hw/sd/sd.c | 2 +- hw/sd/sdhci-pci.c | 2 +- hw/sd/sdhci.c | 2 +- hw/sparc/sun4m.c | 4 ++-- hw/sparc/sun4m_iommu.c | 2 +- hw/sparc64/sun4u.c | 6 +++--- hw/ssi/aspeed_smc.c | 2 +- hw/ssi/xilinx_spi.c | 2 +- hw/ssi/xilinx_spips.c | 4 ++-- hw/timer/a9gtimer.c | 2 +- hw/timer/allwinner-a10-pit.c | 2 +- hw/timer/altera_timer.c | 2 +- hw/timer/arm_mptimer.c | 2 +- hw/timer/arm_timer.c | 2 +- hw/timer/aspeed_timer.c | 2 +- hw/timer/cmsdk-apb-dualtimer.c | 2 +- hw/timer/cmsdk-apb-timer.c | 2 +- hw/timer/grlib_gptimer.c | 2 +- hw/timer/hpet.c | 2 +- hw/timer/i8254.c | 2 +- hw/timer/lm32_timer.c | 2 +- hw/timer/milkymist-sysctl.c | 2 +- hw/timer/mss-timer.c | 2 +- hw/timer/pxa2xx_timer.c | 4 ++-- hw/timer/slavio_timer.c | 2 +- hw/timer/stm32f2xx_timer.c | 2 +- hw/timer/xilinx_timer.c | 2 +- hw/tpm/tpm_crb.c | 2 +- hw/tpm/tpm_tis.c | 2 +- hw/usb/bus.c | 2 +- hw/usb/ccid-card-emulated.c | 2 +- hw/usb/ccid-card-passthru.c | 2 +- hw/usb/dev-audio.c | 2 +- hw/usb/dev-hid.c | 6 +++--- hw/usb/dev-hub.c | 2 +- hw/usb/dev-mtp.c | 2 +- hw/usb/dev-network.c | 2 +- hw/usb/dev-serial.c | 4 ++-- hw/usb/dev-smartcard-reader.c | 4 ++-- hw/usb/dev-storage.c | 2 +- hw/usb/dev-uas.c | 2 +- hw/usb/hcd-ehci-pci.c | 2 +- hw/usb/hcd-ehci-sysbus.c | 2 +- hw/usb/hcd-ohci-pci.c | 2 +- hw/usb/hcd-ohci.c | 2 +- hw/usb/hcd-uhci.c | 4 ++-- hw/usb/hcd-xhci-nec.c | 2 +- hw/usb/hcd-xhci.c | 2 +- hw/usb/host-libusb.c | 2 +- hw/usb/redirect.c | 2 +- hw/vfio/ap.c | 2 +- hw/vfio/ccw.c | 2 +- hw/vfio/pci.c | 4 ++-- hw/vfio/platform.c | 2 +- hw/virtio/vhost-scsi-pci.c | 2 +- hw/virtio/vhost-user-blk-pci.c | 2 +- hw/virtio/vhost-user-fs-pci.c | 2 +- hw/virtio/vhost-user-fs.c | 2 +- hw/virtio/vhost-user-scsi-pci.c | 2 +- hw/virtio/vhost-vsock-pci.c | 2 +- hw/virtio/vhost-vsock.c | 2 +- hw/virtio/virtio-9p-pci.c | 2 +- hw/virtio/virtio-balloon-pci.c | 2 +- hw/virtio/virtio-balloon.c | 2 +- hw/virtio/virtio-blk-pci.c | 2 +- hw/virtio/virtio-crypto-pci.c | 2 +- hw/virtio/virtio-crypto.c | 2 +- hw/virtio/virtio-input-pci.c | 2 +- hw/virtio/virtio-mmio.c | 2 +- hw/virtio/virtio-net-pci.c | 2 +- hw/virtio/virtio-pci.c | 4 ++-- hw/virtio/virtio-pmem.c | 2 +- hw/virtio/virtio-rng.c | 2 +- hw/virtio/virtio-scsi-pci.c | 2 +- hw/virtio/virtio-serial-pci.c | 2 +- hw/virtio/virtio.c | 2 +- hw/watchdog/cmsdk-apb-watchdog.c | 2 +- hw/watchdog/wdt_aspeed.c | 2 +- hw/xen/xen-bus.c | 2 +- hw/xen/xen-legacy-backend.c | 4 ++-- hw/xen/xen_pt.c | 2 +- include/hw/qdev-core.h | 2 ++ migration/migration.c | 2 +- target/i386/cpu.c | 4 ++-- target/microblaze/cpu.c | 2 +- target/nios2/cpu.c | 2 +- target/ppc/translate_init.inc.c | 10 +++++----- target/riscv/cpu.c | 2 +- target/s390x/cpu.c | 2 +- target/sparc/cpu.c | 2 +- tests/test-qdev-global-props.c | 2 +- 397 files changed, 455 insertions(+), 448 deletions(-) diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c index 991e175..963a58c 100644 --- a/hw/9pfs/virtio-9p-device.c +++ b/hw/9pfs/virtio-9p-device.c @@ -245,7 +245,7 @@ static void virtio_9p_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); - dc->props = virtio_9p_properties; + device_class_set_props(dc, virtio_9p_properties); dc->vmsd = &vmstate_virtio_9p; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); vdc->realize = virtio_9p_device_realize; diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c index 9cee90c..375272e 100644 --- a/hw/acpi/generic_event_device.c +++ b/hw/acpi/generic_event_device.c @@ -282,7 +282,7 @@ static void acpi_ged_class_init(ObjectClass *class, void *data) AcpiDeviceIfClass *adevc = ACPI_DEVICE_IF_CLASS(class); dc->desc = "ACPI Generic Event Device"; - dc->props = acpi_ged_properties; + device_class_set_props(dc, acpi_ged_properties); dc->vmsd = &vmstate_acpi_ged; hc->plug = acpi_ged_device_plug_cb; diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 93aec2d..6d621c3 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -653,7 +653,7 @@ static void piix4_pm_class_init(ObjectClass *klass, void *data) dc->reset = piix4_pm_reset; dc->desc = "PM"; dc->vmsd = &vmstate_acpi; - dc->props = piix4_pm_properties; + device_class_set_props(dc, piix4_pm_properties); /* * Reason: part of PIIX4 southbridge, needs to be wired up, * e.g. by mips_malta_init() diff --git a/hw/acpi/vmgenid.c b/hw/acpi/vmgenid.c index 6e11b0f..2df7623 100644 --- a/hw/acpi/vmgenid.c +++ b/hw/acpi/vmgenid.c @@ -226,7 +226,7 @@ static void vmgenid_device_class_init(ObjectClass *klass, void *data) dc->vmsd = &vmstate_vmgenid; dc->realize = vmgenid_realize; - dc->props = vmgenid_device_properties; + device_class_set_props(dc, vmgenid_device_properties); dc->hotpluggable = false; set_bit(DEVICE_CATEGORY_MISC, dc->categories); } diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c index e5263aa..174ca7e 100644 --- a/hw/arm/armsse.c +++ b/hw/arm/armsse.c @@ -1283,7 +1283,7 @@ static void armsse_class_init(ObjectClass *klass, void *data) dc->realize = armsse_realize; dc->vmsd = &armsse_vmstate; - dc->props = info->props; + device_class_set_props(dc, info->props); dc->reset = armsse_reset; iic->check = armsse_idau_check; asc->info = info; diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index 7a3c48f..5d4a581 100644 --- a/hw/arm/armv7m.c +++ b/hw/arm/armv7m.c @@ -288,7 +288,7 @@ static void armv7m_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = armv7m_realize; - dc->props = armv7m_properties; + device_class_set_props(dc, armv7m_properties); } static const TypeInfo armv7m_info = { @@ -367,7 +367,7 @@ static void bitband_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = bitband_realize; - dc->props = bitband_properties; + device_class_set_props(dc, bitband_properties); } static const TypeInfo bitband_info = { diff --git a/hw/arm/aspeed_soc.c b/hw/arm/aspeed_soc.c index a6237e5..99892cb 100644 --- a/hw/arm/aspeed_soc.c +++ b/hw/arm/aspeed_soc.c @@ -449,7 +449,7 @@ static void aspeed_soc_class_init(ObjectClass *oc, void *data) dc->realize = aspeed_soc_realize; /* Reason: Uses serial_hds and nd_table in realize() directly */ dc->user_creatable = false; - dc->props = aspeed_soc_properties; + device_class_set_props(dc, aspeed_soc_properties); } static const TypeInfo aspeed_soc_type_info = { diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c index 221ff06..38e2941 100644 --- a/hw/arm/bcm2836.c +++ b/hw/arm/bcm2836.c @@ -180,7 +180,7 @@ static void bcm283x_class_init(ObjectClass *oc, void *data) bc->info = data; dc->realize = bcm2836_realize; - dc->props = bcm2836_props; + device_class_set_props(dc, bcm2836_props); /* Reason: Must be wired up in code (see raspi_init() function) */ dc->user_creatable = false; } diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c index 5249708..0cd94d9 100644 --- a/hw/arm/integratorcp.c +++ b/hw/arm/integratorcp.c @@ -673,7 +673,7 @@ static void core_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = core_properties; + device_class_set_props(dc, core_properties); dc->realize = integratorcm_realize; dc->vmsd = &vmstate_integratorcm; } diff --git a/hw/arm/msf2-soc.c b/hw/arm/msf2-soc.c index 008fd93..8f84692 100644 --- a/hw/arm/msf2-soc.c +++ b/hw/arm/msf2-soc.c @@ -229,7 +229,7 @@ static void m2sxxx_soc_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = m2sxxx_soc_realize; - dc->props = m2sxxx_soc_properties; + device_class_set_props(dc, m2sxxx_soc_properties); } static const TypeInfo m2sxxx_soc_info = { diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c index f68a399..dc551bb 100644 --- a/hw/arm/musicpal.c +++ b/hw/arm/musicpal.c @@ -435,7 +435,7 @@ static void mv88w8618_eth_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->vmsd = &mv88w8618_eth_vmsd; - dc->props = mv88w8618_eth_properties; + device_class_set_props(dc, mv88w8618_eth_properties); dc->realize = mv88w8618_eth_realize; } diff --git a/hw/arm/nrf51_soc.c b/hw/arm/nrf51_soc.c index 7402916..4817a76 100644 --- a/hw/arm/nrf51_soc.c +++ b/hw/arm/nrf51_soc.c @@ -224,7 +224,7 @@ static void nrf51_soc_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = nrf51_soc_realize; - dc->props = nrf51_soc_properties; + device_class_set_props(dc, nrf51_soc_properties); } static const TypeInfo nrf51_soc_info = { diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c index 950ff42..b33f8f1 100644 --- a/hw/arm/pxa2xx.c +++ b/hw/arm/pxa2xx.c @@ -1531,7 +1531,7 @@ static void pxa2xx_i2c_class_init(ObjectClass *klass, void *data) dc->desc = "PXA2xx I2C Bus Controller"; dc->vmsd = &vmstate_pxa2xx_i2c; - dc->props = pxa2xx_i2c_properties; + device_class_set_props(dc, pxa2xx_i2c_properties); } static const TypeInfo pxa2xx_i2c_info = { @@ -2015,7 +2015,7 @@ static void pxa2xx_fir_class_init(ObjectClass *klass, void *data) dc->realize = pxa2xx_fir_realize; dc->vmsd = &pxa2xx_fir_vmsd; - dc->props = pxa2xx_fir_properties; + device_class_set_props(dc, pxa2xx_fir_properties); dc->reset = pxa2xx_fir_reset; } diff --git a/hw/arm/pxa2xx_gpio.c b/hw/arm/pxa2xx_gpio.c index 86a0e86..f8df3cc 100644 --- a/hw/arm/pxa2xx_gpio.c +++ b/hw/arm/pxa2xx_gpio.c @@ -347,7 +347,7 @@ static void pxa2xx_gpio_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->desc = "PXA2xx GPIO controller"; - dc->props = pxa2xx_gpio_properties; + device_class_set_props(dc, pxa2xx_gpio_properties); dc->vmsd = &vmstate_pxa2xx_gpio_regs; dc->realize = pxa2xx_gpio_realize; } diff --git a/hw/arm/smmu-common.c b/hw/arm/smmu-common.c index 245817d..23eb117 100644 --- a/hw/arm/smmu-common.c +++ b/hw/arm/smmu-common.c @@ -461,7 +461,7 @@ static void smmu_base_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); SMMUBaseClass *sbc = ARM_SMMU_CLASS(klass); - dc->props = smmu_dev_properties; + device_class_set_props(dc, smmu_dev_properties); device_class_set_parent_realize(dc, smmu_base_realize, &sbc->parent_realize); dc->reset = smmu_base_reset; diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c index 25bd0f5..e001088 100644 --- a/hw/arm/spitz.c +++ b/hw/arm/spitz.c @@ -1083,7 +1083,7 @@ static void sl_nand_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->vmsd = &vmstate_sl_nand_info; - dc->props = sl_nand_properties; + device_class_set_props(dc, sl_nand_properties); dc->realize = sl_nand_realize; /* Reason: init() method uses drive_get() */ dc->user_creatable = false; diff --git a/hw/arm/stm32f205_soc.c b/hw/arm/stm32f205_soc.c index f5a5c2d..627fd44 100644 --- a/hw/arm/stm32f205_soc.c +++ b/hw/arm/stm32f205_soc.c @@ -207,7 +207,7 @@ static void stm32f205_soc_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = stm32f205_soc_realize; - dc->props = stm32f205_soc_properties; + device_class_set_props(dc, stm32f205_soc_properties); } static const TypeInfo stm32f205_soc_info = { diff --git a/hw/arm/strongarm.c b/hw/arm/strongarm.c index c6776e8..cd8a99a 100644 --- a/hw/arm/strongarm.c +++ b/hw/arm/strongarm.c @@ -1327,7 +1327,7 @@ static void strongarm_uart_class_init(ObjectClass *klass, void *data) dc->desc = "StrongARM UART controller"; dc->reset = strongarm_uart_reset; dc->vmsd = &vmstate_strongarm_uart_regs; - dc->props = strongarm_uart_properties; + device_class_set_props(dc, strongarm_uart_properties); dc->realize = strongarm_uart_realize; } diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c index 8b3d8d8..1cf3daa 100644 --- a/hw/arm/xlnx-versal.c +++ b/hw/arm/xlnx-versal.c @@ -305,7 +305,7 @@ static void versal_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = versal_realize; - dc->props = versal_properties; + device_class_set_props(dc, versal_properties); /* No VMSD since we haven't got any top-level SoC state to save. */ } diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c index fb03c60..cab0160 100644 --- a/hw/arm/xlnx-zynqmp.c +++ b/hw/arm/xlnx-zynqmp.c @@ -657,7 +657,7 @@ static void xlnx_zynqmp_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); - dc->props = xlnx_zynqmp_props; + device_class_set_props(dc, xlnx_zynqmp_props); dc->realize = xlnx_zynqmp_realize; /* Reason: Uses serial_hds in realize function, thus can't be used twice */ dc->user_creatable = false; diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c index 78cda88..1ec87fe 100644 --- a/hw/audio/ac97.c +++ b/hw/audio/ac97.c @@ -1420,7 +1420,7 @@ static void ac97_class_init (ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_SOUND, dc->categories); dc->desc = "Intel 82801AA AC97 Audio"; dc->vmsd = &vmstate_ac97; - dc->props = ac97_properties; + device_class_set_props(dc, ac97_properties); dc->reset = ac97_on_reset; } diff --git a/hw/audio/adlib.c b/hw/audio/adlib.c index cb4178d..d6c1fb0 100644 --- a/hw/audio/adlib.c +++ b/hw/audio/adlib.c @@ -312,7 +312,7 @@ static void adlib_class_initfn (ObjectClass *klass, void *data) dc->realize = adlib_realizefn; set_bit(DEVICE_CATEGORY_SOUND, dc->categories); dc->desc = ADLIB_DESC; - dc->props = adlib_properties; + device_class_set_props(dc, adlib_properties); } static const TypeInfo adlib_info = { diff --git a/hw/audio/cs4231.c b/hw/audio/cs4231.c index b5d3e89..11a6328 100644 --- a/hw/audio/cs4231.c +++ b/hw/audio/cs4231.c @@ -168,7 +168,7 @@ static void cs4231_class_init(ObjectClass *klass, void *data) dc->reset = cs_reset; dc->vmsd = &vmstate_cs4231; - dc->props = cs4231_properties; + device_class_set_props(dc, cs4231_properties); } static const TypeInfo cs4231_info = { diff --git a/hw/audio/cs4231a.c b/hw/audio/cs4231a.c index c7b8067..ffdbb58 100644 --- a/hw/audio/cs4231a.c +++ b/hw/audio/cs4231a.c @@ -706,7 +706,7 @@ static void cs4231a_class_initfn (ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_SOUND, dc->categories); dc->desc = "Crystal Semiconductor CS4231A"; dc->vmsd = &vmstate_cs4231a; - dc->props = cs4231a_properties; + device_class_set_props(dc, cs4231a_properties); } static const TypeInfo cs4231a_info = { diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c index f9e9f2a..89c4dab 100644 --- a/hw/audio/es1370.c +++ b/hw/audio/es1370.c @@ -908,7 +908,7 @@ static void es1370_class_init (ObjectClass *klass, void *data) dc->desc = "ENSONIQ AudioPCI ES1370"; dc->vmsd = &vmstate_es1370; dc->reset = es1370_on_reset; - dc->props = es1370_properties; + device_class_set_props(dc, es1370_properties); } static const TypeInfo es1370_info = { diff --git a/hw/audio/gus.c b/hw/audio/gus.c index 2b6b7c4..eb4a803 100644 --- a/hw/audio/gus.c +++ b/hw/audio/gus.c @@ -315,7 +315,7 @@ static void gus_class_initfn (ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_SOUND, dc->categories); dc->desc = "Gravis Ultrasound GF1"; dc->vmsd = &vmstate_gus; - dc->props = gus_properties; + device_class_set_props(dc, gus_properties); } static const TypeInfo gus_info = { diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c index e711a99..cbd92b7 100644 --- a/hw/audio/hda-codec.c +++ b/hw/audio/hda-codec.c @@ -892,7 +892,7 @@ static void hda_audio_base_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_SOUND, dc->categories); dc->reset = hda_audio_reset; dc->vmsd = &vmstate_hda_audio; - dc->props = hda_audio_properties; + device_class_set_props(dc, hda_audio_properties); } static const TypeInfo hda_audio_info = { diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index 6ecd383..e96a707 100644 --- a/hw/audio/intel-hda.c +++ b/hw/audio/intel-hda.c @@ -1233,7 +1233,7 @@ static void intel_hda_class_init(ObjectClass *klass, void *data) k->class_id = PCI_CLASS_MULTIMEDIA_HD_AUDIO; dc->reset = intel_hda_reset; dc->vmsd = &vmstate_intel_hda; - dc->props = intel_hda_properties; + device_class_set_props(dc, intel_hda_properties); } static void intel_hda_class_init_ich6(ObjectClass *klass, void *data) @@ -1289,7 +1289,7 @@ static void hda_codec_device_class_init(ObjectClass *klass, void *data) k->unrealize = hda_codec_dev_unrealize; set_bit(DEVICE_CATEGORY_SOUND, k->categories); k->bus_type = TYPE_HDA_BUS; - k->props = hda_props; + device_class_set_props(k, hda_props); } static const TypeInfo hda_codec_device_type_info = { diff --git a/hw/audio/milkymist-ac97.c b/hw/audio/milkymist-ac97.c index 6d409ef..0fa38ad 100644 --- a/hw/audio/milkymist-ac97.c +++ b/hw/audio/milkymist-ac97.c @@ -342,7 +342,7 @@ static void milkymist_ac97_class_init(ObjectClass *klass, void *data) dc->realize = milkymist_ac97_realize; dc->reset = milkymist_ac97_reset; dc->vmsd = &vmstate_milkymist_ac97; - dc->props = milkymist_ac97_properties; + device_class_set_props(dc, milkymist_ac97_properties); } static const TypeInfo milkymist_ac97_info = { diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c index d773eb8..29dc00b 100644 --- a/hw/audio/pcspk.c +++ b/hw/audio/pcspk.c @@ -222,7 +222,7 @@ static void pcspk_class_initfn(ObjectClass *klass, void *data) dc->realize = pcspk_realizefn; set_bit(DEVICE_CATEGORY_SOUND, dc->categories); dc->vmsd = &vmstate_spk; - dc->props = pcspk_properties; + device_class_set_props(dc, pcspk_properties); /* Reason: realize sets global pcspk_state */ /* Reason: pit object link */ dc->user_creatable = false; diff --git a/hw/audio/pl041.c b/hw/audio/pl041.c index c30417d..c3d3eab 100644 --- a/hw/audio/pl041.c +++ b/hw/audio/pl041.c @@ -640,7 +640,7 @@ static void pl041_device_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_SOUND, dc->categories); dc->reset = pl041_device_reset; dc->vmsd = &vmstate_pl041; - dc->props = pl041_device_properties; + device_class_set_props(dc, pl041_device_properties); } static const TypeInfo pl041_device_info = { diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c index a354f94..df6f755 100644 --- a/hw/audio/sb16.c +++ b/hw/audio/sb16.c @@ -1439,7 +1439,7 @@ static void sb16_class_initfn (ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_SOUND, dc->categories); dc->desc = "Creative Sound Blaster 16"; dc->vmsd = &vmstate_sb16; - dc->props = sb16_properties; + device_class_set_props(dc, sb16_properties); } static const TypeInfo sb16_info = { diff --git a/hw/audio/wm8750.c b/hw/audio/wm8750.c index 601ed04..92b2902 100644 --- a/hw/audio/wm8750.c +++ b/hw/audio/wm8750.c @@ -717,7 +717,7 @@ static void wm8750_class_init(ObjectClass *klass, void *data) sc->recv = wm8750_rx; sc->send = wm8750_tx; dc->vmsd = &vmstate_wm8750; - dc->props = wm8750_properties; + device_class_set_props(dc, wm8750_properties); } static const TypeInfo wm8750_info = { diff --git a/hw/block/fdc.c b/hw/block/fdc.c index ac5d31e..22e954e 100644 --- a/hw/block/fdc.c +++ b/hw/block/fdc.c @@ -606,7 +606,7 @@ static void floppy_drive_class_init(ObjectClass *klass, void *data) k->realize = floppy_drive_realize; set_bit(DEVICE_CATEGORY_STORAGE, k->categories); k->bus_type = TYPE_FLOPPY_BUS; - k->props = floppy_drive_properties; + device_class_set_props(k, floppy_drive_properties); k->desc = "virtual floppy drive"; } @@ -2827,7 +2827,7 @@ static void isabus_fdc_class_init(ObjectClass *klass, void *data) dc->fw_name = "fdc"; dc->reset = fdctrl_external_reset_isa; dc->vmsd = &vmstate_isa_fdc; - dc->props = isa_fdc_properties; + device_class_set_props(dc, isa_fdc_properties); set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); } @@ -2880,7 +2880,7 @@ static void sysbus_fdc_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = sysbus_fdc_properties; + device_class_set_props(dc, sysbus_fdc_properties); set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); } @@ -2906,7 +2906,7 @@ static void sun4m_fdc_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = sun4m_fdc_properties; + device_class_set_props(dc, sun4m_fdc_properties); set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); } diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c index 11ff5b9..61f2fb8 100644 --- a/hw/block/m25p80.c +++ b/hw/block/m25p80.c @@ -1391,7 +1391,7 @@ static void m25p80_class_init(ObjectClass *klass, void *data) k->set_cs = m25p80_cs; k->cs_polarity = SSI_CS_LOW; dc->vmsd = &vmstate_m25p80; - dc->props = m25p80_properties; + device_class_set_props(dc, m25p80_properties); dc->reset = m25p80_reset; mc->pi = data; } diff --git a/hw/block/nand.c b/hw/block/nand.c index e396004..bba8968 100644 --- a/hw/block/nand.c +++ b/hw/block/nand.c @@ -448,7 +448,7 @@ static void nand_class_init(ObjectClass *klass, void *data) dc->realize = nand_realize; dc->reset = nand_reset; dc->vmsd = &vmstate_nand; - dc->props = nand_properties; + device_class_set_props(dc, nand_properties); } static const TypeInfo nand_info = { diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 12d8254..d28335c 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -1475,7 +1475,7 @@ static void nvme_class_init(ObjectClass *oc, void *data) set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); dc->desc = "Non-Volatile Memory Express"; - dc->props = nvme_props; + device_class_set_props(dc, nvme_props); dc->vmsd = &nvme_vmstate; } diff --git a/hw/block/onenand.c b/hw/block/onenand.c index 9c233c1..898ac56 100644 --- a/hw/block/onenand.c +++ b/hw/block/onenand.c @@ -845,7 +845,7 @@ static void onenand_class_init(ObjectClass *klass, void *data) dc->realize = onenand_realize; dc->reset = onenand_system_reset; - dc->props = onenand_properties; + device_class_set_props(dc, onenand_properties); } static const TypeInfo onenand_info = { diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c index 54e6ebd..24f3bce 100644 --- a/hw/block/pflash_cfi01.c +++ b/hw/block/pflash_cfi01.c @@ -930,7 +930,7 @@ static void pflash_cfi01_class_init(ObjectClass *klass, void *data) dc->reset = pflash_cfi01_system_reset; dc->realize = pflash_cfi01_realize; - dc->props = pflash_cfi01_properties; + device_class_set_props(dc, pflash_cfi01_properties); dc->vmsd = &vmstate_pflash; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); } diff --git a/hw/block/pflash_cfi02.c b/hw/block/pflash_cfi02.c index c7d92c3..7c4744c 100644 --- a/hw/block/pflash_cfi02.c +++ b/hw/block/pflash_cfi02.c @@ -963,7 +963,7 @@ static void pflash_cfi02_class_init(ObjectClass *klass, void *data) dc->realize = pflash_cfi02_realize; dc->unrealize = pflash_cfi02_unrealize; - dc->props = pflash_cfi02_properties; + device_class_set_props(dc, pflash_cfi02_properties); set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); } diff --git a/hw/block/swim.c b/hw/block/swim.c index c6d117e..8f12478 100644 --- a/hw/block/swim.c +++ b/hw/block/swim.c @@ -239,7 +239,7 @@ static void swim_drive_class_init(ObjectClass *klass, void *data) k->realize = swim_drive_realize; set_bit(DEVICE_CATEGORY_STORAGE, k->categories); k->bus_type = TYPE_SWIM_BUS; - k->props = swim_drive_properties; + device_class_set_props(k, swim_drive_properties); k->desc = "virtual SWIM drive"; } diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c index 98b383f..d8c459c 100644 --- a/hw/block/vhost-user-blk.c +++ b/hw/block/vhost-user-blk.c @@ -511,7 +511,7 @@ static void vhost_user_blk_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); - dc->props = vhost_user_blk_properties; + device_class_set_props(dc, vhost_user_blk_properties); dc->vmsd = &vmstate_vhost_user_blk; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); vdc->realize = vhost_user_blk_device_realize; diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 9bee514..09f46ed 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -1294,7 +1294,7 @@ static void virtio_blk_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); - dc->props = virtio_blk_properties; + device_class_set_props(dc, virtio_blk_properties); dc->vmsd = &vmstate_virtio_blk; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); vdc->realize = virtio_blk_device_realize; diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c index 879fc31..686bbc3 100644 --- a/hw/block/xen-block.c +++ b/hw/block/xen-block.c @@ -554,7 +554,7 @@ static void xen_block_class_init(ObjectClass *class, void *data) xendev_class->frontend_changed = xen_block_frontend_changed; xendev_class->unrealize = xen_block_unrealize; - dev_class->props = xen_block_props; + device_class_set_props(dev_class, xen_block_props); } static const TypeInfo xen_block_type_info = { diff --git a/hw/char/bcm2835_aux.c b/hw/char/bcm2835_aux.c index a6fc1bf..ee3dd40 100644 --- a/hw/char/bcm2835_aux.c +++ b/hw/char/bcm2835_aux.c @@ -299,7 +299,7 @@ static void bcm2835_aux_class_init(ObjectClass *oc, void *data) dc->realize = bcm2835_aux_realize; dc->vmsd = &vmstate_bcm2835_aux; set_bit(DEVICE_CATEGORY_INPUT, dc->categories); - dc->props = bcm2835_aux_props; + device_class_set_props(dc, bcm2835_aux_props); } static const TypeInfo bcm2835_aux_info = { diff --git a/hw/char/cadence_uart.c b/hw/char/cadence_uart.c index 51791bd..22e4797 100644 --- a/hw/char/cadence_uart.c +++ b/hw/char/cadence_uart.c @@ -550,7 +550,7 @@ static void cadence_uart_class_init(ObjectClass *klass, void *data) dc->realize = cadence_uart_realize; dc->vmsd = &vmstate_cadence_uart; dc->reset = cadence_uart_reset; - dc->props = cadence_uart_properties; + device_class_set_props(dc, cadence_uart_properties); } static const TypeInfo cadence_uart_info = { diff --git a/hw/char/cmsdk-apb-uart.c b/hw/char/cmsdk-apb-uart.c index 9e1aa43..626b68f 100644 --- a/hw/char/cmsdk-apb-uart.c +++ b/hw/char/cmsdk-apb-uart.c @@ -389,7 +389,7 @@ static void cmsdk_apb_uart_class_init(ObjectClass *klass, void *data) dc->realize = cmsdk_apb_uart_realize; dc->vmsd = &cmsdk_apb_uart_vmstate; dc->reset = cmsdk_apb_uart_reset; - dc->props = cmsdk_apb_uart_properties; + device_class_set_props(dc, cmsdk_apb_uart_properties); } static const TypeInfo cmsdk_apb_uart_info = { diff --git a/hw/char/debugcon.c b/hw/char/debugcon.c index 5c592e0..c8d938e 100644 --- a/hw/char/debugcon.c +++ b/hw/char/debugcon.c @@ -125,7 +125,7 @@ static void debugcon_isa_class_initfn(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = debugcon_isa_realizefn; - dc->props = debugcon_isa_properties; + device_class_set_props(dc, debugcon_isa_properties); set_bit(DEVICE_CATEGORY_MISC, dc->categories); } diff --git a/hw/char/digic-uart.c b/hw/char/digic-uart.c index 033eba0..e130cb4 100644 --- a/hw/char/digic-uart.c +++ b/hw/char/digic-uart.c @@ -183,7 +183,7 @@ static void digic_uart_class_init(ObjectClass *klass, void *data) dc->realize = digic_uart_realize; dc->reset = digic_uart_reset; dc->vmsd = &vmstate_digic_uart; - dc->props = digic_uart_properties; + device_class_set_props(dc, digic_uart_properties); } static const TypeInfo digic_uart_info = { diff --git a/hw/char/escc.c b/hw/char/escc.c index c40c1d2..7d16ee8 100644 --- a/hw/char/escc.c +++ b/hw/char/escc.c @@ -865,7 +865,7 @@ static void escc_class_init(ObjectClass *klass, void *data) dc->reset = escc_reset; dc->realize = escc_realize; dc->vmsd = &vmstate_escc; - dc->props = escc_properties; + device_class_set_props(dc, escc_properties); set_bit(DEVICE_CATEGORY_INPUT, dc->categories); } diff --git a/hw/char/etraxfs_ser.c b/hw/char/etraxfs_ser.c index f34f767..947bdb6 100644 --- a/hw/char/etraxfs_ser.c +++ b/hw/char/etraxfs_ser.c @@ -244,7 +244,7 @@ static void etraxfs_ser_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->reset = etraxfs_ser_reset; - dc->props = etraxfs_ser_properties; + device_class_set_props(dc, etraxfs_ser_properties); dc->realize = etraxfs_ser_realize; } diff --git a/hw/char/exynos4210_uart.c b/hw/char/exynos4210_uart.c index 7e5c5ce..238aa0a 100644 --- a/hw/char/exynos4210_uart.c +++ b/hw/char/exynos4210_uart.c @@ -645,7 +645,7 @@ static void exynos4210_uart_class_init(ObjectClass *klass, void *data) dc->realize = exynos4210_uart_realize; dc->reset = exynos4210_uart_reset; - dc->props = exynos4210_uart_properties; + device_class_set_props(dc, exynos4210_uart_properties); dc->vmsd = &vmstate_exynos4210_uart; } diff --git a/hw/char/grlib_apbuart.c b/hw/char/grlib_apbuart.c index 8e59c3b..16d0fea 100644 --- a/hw/char/grlib_apbuart.c +++ b/hw/char/grlib_apbuart.c @@ -285,7 +285,7 @@ static void grlib_apbuart_class_init(ObjectClass *klass, void *data) dc->realize = grlib_apbuart_realize; dc->reset = grlib_apbuart_reset; - dc->props = grlib_apbuart_properties; + device_class_set_props(dc, grlib_apbuart_properties); } static const TypeInfo grlib_apbuart_info = { diff --git a/hw/char/imx_serial.c b/hw/char/imx_serial.c index d09c210..731b8fc 100644 --- a/hw/char/imx_serial.c +++ b/hw/char/imx_serial.c @@ -372,7 +372,7 @@ static void imx_serial_class_init(ObjectClass *klass, void *data) dc->reset = imx_serial_reset_at_boot; set_bit(DEVICE_CATEGORY_INPUT, dc->categories); dc->desc = "i.MX series UART"; - dc->props = imx_serial_properties; + device_class_set_props(dc, imx_serial_properties); } static const TypeInfo imx_serial_info = { diff --git a/hw/char/ipoctal232.c b/hw/char/ipoctal232.c index 80e9dff..d7c497b 100644 --- a/hw/char/ipoctal232.c +++ b/hw/char/ipoctal232.c @@ -588,7 +588,7 @@ static void ipoctal_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_INPUT, dc->categories); dc->desc = "GE IP-Octal 232 8-channel RS-232 IndustryPack"; - dc->props = ipoctal_properties; + device_class_set_props(dc, ipoctal_properties); dc->vmsd = &vmstate_ipoctal; } diff --git a/hw/char/lm32_juart.c b/hw/char/lm32_juart.c index da9dd56..3f34861 100644 --- a/hw/char/lm32_juart.c +++ b/hw/char/lm32_juart.c @@ -146,7 +146,7 @@ static void lm32_juart_class_init(ObjectClass *klass, void *data) dc->reset = juart_reset; dc->vmsd = &vmstate_lm32_juart; - dc->props = lm32_juart_properties; + device_class_set_props(dc, lm32_juart_properties); dc->realize = lm32_juart_realize; } diff --git a/hw/char/lm32_uart.c b/hw/char/lm32_uart.c index 8d7a475..b0b1092 100644 --- a/hw/char/lm32_uart.c +++ b/hw/char/lm32_uart.c @@ -293,7 +293,7 @@ static void lm32_uart_class_init(ObjectClass *klass, void *data) dc->reset = uart_reset; dc->vmsd = &vmstate_lm32_uart; - dc->props = lm32_uart_properties; + device_class_set_props(dc, lm32_uart_properties); dc->realize = lm32_uart_realize; } diff --git a/hw/char/mcf_uart.c b/hw/char/mcf_uart.c index 2de3680..97e4bbc 100644 --- a/hw/char/mcf_uart.c +++ b/hw/char/mcf_uart.c @@ -320,7 +320,7 @@ static void mcf_uart_class_init(ObjectClass *oc, void *data) dc->realize = mcf_uart_realize; dc->reset = mcf_uart_reset; - dc->props = mcf_uart_properties; + device_class_set_props(dc, mcf_uart_properties); set_bit(DEVICE_CATEGORY_INPUT, dc->categories); } diff --git a/hw/char/milkymist-uart.c b/hw/char/milkymist-uart.c index 1c7b614..1439efb 100644 --- a/hw/char/milkymist-uart.c +++ b/hw/char/milkymist-uart.c @@ -239,7 +239,7 @@ static void milkymist_uart_class_init(ObjectClass *klass, void *data) dc->realize = milkymist_uart_realize; dc->reset = milkymist_uart_reset; dc->vmsd = &vmstate_milkymist_uart; - dc->props = milkymist_uart_properties; + device_class_set_props(dc, milkymist_uart_properties); } static const TypeInfo milkymist_uart_info = { diff --git a/hw/char/nrf51_uart.c b/hw/char/nrf51_uart.c index b67fd21..d1fef77 100644 --- a/hw/char/nrf51_uart.c +++ b/hw/char/nrf51_uart.c @@ -314,7 +314,7 @@ static void nrf51_uart_class_init(ObjectClass *klass, void *data) dc->reset = nrf51_uart_reset; dc->realize = nrf51_uart_realize; - dc->props = nrf51_uart_properties; + device_class_set_props(dc, nrf51_uart_properties); dc->vmsd = &nrf51_uart_vmstate; } diff --git a/hw/char/parallel.c b/hw/char/parallel.c index 40174ee..8dd67d1 100644 --- a/hw/char/parallel.c +++ b/hw/char/parallel.c @@ -627,7 +627,7 @@ static void parallel_isa_class_initfn(ObjectClass *klass, void *data) dc->realize = parallel_isa_realizefn; dc->vmsd = &vmstate_parallel_isa; - dc->props = parallel_isa_properties; + device_class_set_props(dc, parallel_isa_properties); set_bit(DEVICE_CATEGORY_INPUT, dc->categories); } diff --git a/hw/char/pl011.c b/hw/char/pl011.c index 23cd544..13e784f 100644 --- a/hw/char/pl011.c +++ b/hw/char/pl011.c @@ -356,7 +356,7 @@ static void pl011_class_init(ObjectClass *oc, void *data) dc->realize = pl011_realize; dc->vmsd = &vmstate_pl011; - dc->props = pl011_properties; + device_class_set_props(dc, pl011_properties); } static const TypeInfo pl011_arm_info = { diff --git a/hw/char/sclpconsole-lm.c b/hw/char/sclpconsole-lm.c index 3926062..c420dc0 100644 --- a/hw/char/sclpconsole-lm.c +++ b/hw/char/sclpconsole-lm.c @@ -342,7 +342,7 @@ static void console_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); SCLPEventClass *ec = SCLP_EVENT_CLASS(klass); - dc->props = console_properties; + device_class_set_props(dc, console_properties); dc->reset = console_reset; dc->vmsd = &vmstate_sclplmconsole; ec->init = console_init; diff --git a/hw/char/sclpconsole.c b/hw/char/sclpconsole.c index da126f0..1fa124d 100644 --- a/hw/char/sclpconsole.c +++ b/hw/char/sclpconsole.c @@ -258,7 +258,7 @@ static void console_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); SCLPEventClass *ec = SCLP_EVENT_CLASS(klass); - dc->props = console_properties; + device_class_set_props(dc, console_properties); dc->reset = console_reset; dc->vmsd = &vmstate_sclpconsole; ec->init = console_init; diff --git a/hw/char/serial-isa.c b/hw/char/serial-isa.c index db86445..f9b6eed 100644 --- a/hw/char/serial-isa.c +++ b/hw/char/serial-isa.c @@ -106,7 +106,7 @@ static void serial_isa_class_initfn(ObjectClass *klass, void *data) dc->realize = serial_isa_realizefn; dc->vmsd = &vmstate_isa_serial; - dc->props = serial_isa_properties; + device_class_set_props(dc, serial_isa_properties); set_bit(DEVICE_CATEGORY_INPUT, dc->categories); } diff --git a/hw/char/serial-pci-multi.c b/hw/char/serial-pci-multi.c index e343a12..1742cb7 100644 --- a/hw/char/serial-pci-multi.c +++ b/hw/char/serial-pci-multi.c @@ -161,7 +161,7 @@ static void multi_2x_serial_pci_class_initfn(ObjectClass *klass, void *data) pc->revision = 1; pc->class_id = PCI_CLASS_COMMUNICATION_SERIAL; dc->vmsd = &vmstate_pci_multi_serial; - dc->props = multi_2x_serial_pci_properties; + device_class_set_props(dc, multi_2x_serial_pci_properties); set_bit(DEVICE_CATEGORY_INPUT, dc->categories); } @@ -176,7 +176,7 @@ static void multi_4x_serial_pci_class_initfn(ObjectClass *klass, void *data) pc->revision = 1; pc->class_id = PCI_CLASS_COMMUNICATION_SERIAL; dc->vmsd = &vmstate_pci_multi_serial; - dc->props = multi_4x_serial_pci_properties; + device_class_set_props(dc, multi_4x_serial_pci_properties); set_bit(DEVICE_CATEGORY_INPUT, dc->categories); } diff --git a/hw/char/serial-pci.c b/hw/char/serial-pci.c index b6a73c6..743552c 100644 --- a/hw/char/serial-pci.c +++ b/hw/char/serial-pci.c @@ -100,7 +100,7 @@ static void serial_pci_class_initfn(ObjectClass *klass, void *data) pc->revision = 1; pc->class_id = PCI_CLASS_COMMUNICATION_SERIAL; dc->vmsd = &vmstate_pci_serial; - dc->props = serial_pci_properties; + device_class_set_props(dc, serial_pci_properties); set_bit(DEVICE_CATEGORY_INPUT, dc->categories); } diff --git a/hw/char/serial.c b/hw/char/serial.c index d167c43..9298881 100644 --- a/hw/char/serial.c +++ b/hw/char/serial.c @@ -1044,7 +1044,7 @@ static void serial_class_init(ObjectClass *klass, void* data) dc->realize = serial_realize; dc->unrealize = serial_unrealize; dc->vmsd = &vmstate_serial; - dc->props = serial_properties; + device_class_set_props(dc, serial_properties); } static const TypeInfo serial_info = { @@ -1159,7 +1159,7 @@ static void serial_mm_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); - dc->props = serial_mm_properties; + device_class_set_props(dc, serial_mm_properties); dc->realize = serial_mm_realize; } diff --git a/hw/char/spapr_vty.c b/hw/char/spapr_vty.c index 8f4d9fe..ecb94f5 100644 --- a/hw/char/spapr_vty.c +++ b/hw/char/spapr_vty.c @@ -193,7 +193,7 @@ static void spapr_vty_class_init(ObjectClass *klass, void *data) k->dt_type = "serial"; k->dt_compatible = "hvterm1"; set_bit(DEVICE_CATEGORY_INPUT, dc->categories); - dc->props = spapr_vty_properties; + device_class_set_props(dc, spapr_vty_properties); dc->vmsd = &vmstate_spapr_vty; } diff --git a/hw/char/stm32f2xx_usart.c b/hw/char/stm32f2xx_usart.c index 4ec843d..0d661be 100644 --- a/hw/char/stm32f2xx_usart.c +++ b/hw/char/stm32f2xx_usart.c @@ -222,7 +222,7 @@ static void stm32f2xx_usart_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->reset = stm32f2xx_usart_reset; - dc->props = stm32f2xx_usart_properties; + device_class_set_props(dc, stm32f2xx_usart_properties); dc->realize = stm32f2xx_usart_realize; } diff --git a/hw/char/terminal3270.c b/hw/char/terminal3270.c index f7aba12..2c47ebf 100644 --- a/hw/char/terminal3270.c +++ b/hw/char/terminal3270.c @@ -288,7 +288,7 @@ static void terminal_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); EmulatedCcw3270Class *ck = EMULATED_CCW_3270_CLASS(klass); - dc->props = terminal_properties; + device_class_set_props(dc, terminal_properties); dc->vmsd = &terminal3270_vmstate; ck->init = terminal_init; ck->read_payload_3270 = read_payload_3270; diff --git a/hw/char/virtio-console.c b/hw/char/virtio-console.c index a7d34fe..b010c21 100644 --- a/hw/char/virtio-console.c +++ b/hw/char/virtio-console.c @@ -287,7 +287,7 @@ static void virtserialport_class_init(ObjectClass *klass, void *data) k->set_guest_connected = set_guest_connected; k->enable_backend = virtconsole_enable_backend; k->guest_writable = guest_writable; - dc->props = virtserialport_properties; + device_class_set_props(dc, virtserialport_properties); } static const TypeInfo virtserialport_info = { diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c index e1cbce3..941ed5a 100644 --- a/hw/char/virtio-serial-bus.c +++ b/hw/char/virtio-serial-bus.c @@ -1110,7 +1110,7 @@ static void virtio_serial_port_class_init(ObjectClass *klass, void *data) k->bus_type = TYPE_VIRTIO_SERIAL_BUS; k->realize = virtser_port_device_realize; k->unrealize = virtser_port_device_unrealize; - k->props = virtser_props; + device_class_set_props(k, virtser_props); } static const TypeInfo virtio_serial_port_type_info = { @@ -1179,7 +1179,7 @@ static void virtio_serial_class_init(ObjectClass *klass, void *data) QLIST_INIT(&vserdevices.devices); - dc->props = virtio_serial_properties; + device_class_set_props(dc, virtio_serial_properties); dc->vmsd = &vmstate_virtio_console; set_bit(DEVICE_CATEGORY_INPUT, dc->categories); vdc->realize = virtio_serial_device_realize; diff --git a/hw/char/xilinx_uartlite.c b/hw/char/xilinx_uartlite.c index aa6bf02..c651228 100644 --- a/hw/char/xilinx_uartlite.c +++ b/hw/char/xilinx_uartlite.c @@ -236,7 +236,7 @@ static void xilinx_uartlite_class_init(ObjectClass *klass, void *data) dc->reset = xilinx_uartlite_reset; dc->realize = xilinx_uartlite_realize; - dc->props = xilinx_uartlite_properties; + device_class_set_props(dc, xilinx_uartlite_properties); } static const TypeInfo xilinx_uartlite_info = { diff --git a/hw/core/cpu.c b/hw/core/cpu.c index fde5fd3..fe65ca6 100644 --- a/hw/core/cpu.c +++ b/hw/core/cpu.c @@ -440,7 +440,7 @@ static void cpu_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_CPU, dc->categories); dc->realize = cpu_common_realizefn; dc->unrealize = cpu_common_unrealizefn; - dc->props = cpu_common_props; + device_class_set_props(dc, cpu_common_props); /* * Reason: CPUs still need special care by board code: wiring up * IRQs, adding reset handlers, halting non-first CPUs, ... diff --git a/hw/core/generic-loader.c b/hw/core/generic-loader.c index 4b1fc86..e7eb57e 100644 --- a/hw/core/generic-loader.c +++ b/hw/core/generic-loader.c @@ -201,7 +201,7 @@ static void generic_loader_class_init(ObjectClass *klass, void *data) */ dc->realize = generic_loader_realize; dc->unrealize = generic_loader_unrealize; - dc->props = generic_loader_props; + device_class_set_props(dc, generic_loader_props); dc->desc = "Generic Loader"; set_bit(DEVICE_CATEGORY_MISC, dc->categories); } diff --git a/hw/core/or-irq.c b/hw/core/or-irq.c index 18d6383..4bbdbcb 100644 --- a/hw/core/or-irq.c +++ b/hw/core/or-irq.c @@ -125,7 +125,7 @@ static void or_irq_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->reset = or_irq_reset; - dc->props = or_irq_properties; + device_class_set_props(dc, or_irq_properties); dc->realize = or_irq_realize; dc->vmsd = &vmstate_or_irq; diff --git a/hw/core/platform-bus.c b/hw/core/platform-bus.c index edb0da1..22c5f76 100644 --- a/hw/core/platform-bus.c +++ b/hw/core/platform-bus.c @@ -211,7 +211,7 @@ static void platform_bus_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = platform_bus_realize; - dc->props = platform_bus_properties; + device_class_set_props(dc, platform_bus_properties); } static const TypeInfo platform_bus_info = { diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 8708605..8047ac9 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -1061,6 +1061,11 @@ static void device_class_init(ObjectClass *class, void *data) vc->get_id = device_vmstate_if_get_id; } +void device_class_set_props(DeviceClass *dc, Property *props) +{ + dc->props = props; +} + void device_class_set_parent_reset(DeviceClass *dc, DeviceReset dev_reset, DeviceReset *parent_reset) diff --git a/hw/core/split-irq.c b/hw/core/split-irq.c index b5acc66..3b90af2 100644 --- a/hw/core/split-irq.c +++ b/hw/core/split-irq.c @@ -69,7 +69,7 @@ static void split_irq_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); /* No state to reset or migrate */ - dc->props = split_irq_properties; + device_class_set_props(dc, split_irq_properties); dc->realize = split_irq_realize; /* Reason: Needs to be wired up to work */ diff --git a/hw/cpu/a15mpcore.c b/hw/cpu/a15mpcore.c index 7e9983a..4f65911 100644 --- a/hw/cpu/a15mpcore.c +++ b/hw/cpu/a15mpcore.c @@ -164,7 +164,7 @@ static void a15mp_priv_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = a15mp_priv_realize; - dc->props = a15mp_priv_properties; + device_class_set_props(dc, a15mp_priv_properties); /* We currently have no savable state */ } diff --git a/hw/cpu/a9mpcore.c b/hw/cpu/a9mpcore.c index 6872a3a..1f8bc8a 100644 --- a/hw/cpu/a9mpcore.c +++ b/hw/cpu/a9mpcore.c @@ -175,7 +175,7 @@ static void a9mp_priv_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = a9mp_priv_realize; - dc->props = a9mp_priv_properties; + device_class_set_props(dc, a9mp_priv_properties); } static const TypeInfo a9mp_priv_info = { diff --git a/hw/cpu/arm11mpcore.c b/hw/cpu/arm11mpcore.c index e78f5d0..2e3e87c 100644 --- a/hw/cpu/arm11mpcore.c +++ b/hw/cpu/arm11mpcore.c @@ -156,7 +156,7 @@ static void mpcore_priv_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = mpcore_priv_realize; - dc->props = mpcore_priv_properties; + device_class_set_props(dc, mpcore_priv_properties); } static const TypeInfo mpcore_priv_info = { diff --git a/hw/cpu/cluster.c b/hw/cpu/cluster.c index 349a883..e444b7c 100644 --- a/hw/cpu/cluster.c +++ b/hw/cpu/cluster.c @@ -78,7 +78,7 @@ static void cpu_cluster_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = cpu_cluster_properties; + device_class_set_props(dc, cpu_cluster_properties); dc->realize = cpu_cluster_realize; /* This is not directly for users, CPU children must be attached by code */ diff --git a/hw/cpu/realview_mpcore.c b/hw/cpu/realview_mpcore.c index ae2c991..cc2767c 100644 --- a/hw/cpu/realview_mpcore.c +++ b/hw/cpu/realview_mpcore.c @@ -125,7 +125,7 @@ static void mpcore_rirq_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = realview_mpcore_realize; - dc->props = mpcore_rirq_properties; + device_class_set_props(dc, mpcore_rirq_properties); } static const TypeInfo mpcore_rirq_info = { diff --git a/hw/display/ati.c b/hw/display/ati.c index db3b254..58ec829 100644 --- a/hw/display/ati.c +++ b/hw/display/ati.c @@ -980,7 +980,7 @@ static void ati_vga_class_init(ObjectClass *klass, void *data) PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); dc->reset = ati_vga_reset; - dc->props = ati_vga_properties; + device_class_set_props(dc, ati_vga_properties); dc->hotpluggable = false; set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); diff --git a/hw/display/bcm2835_fb.c b/hw/display/bcm2835_fb.c index 85aaa54..d6bf337 100644 --- a/hw/display/bcm2835_fb.c +++ b/hw/display/bcm2835_fb.c @@ -451,7 +451,7 @@ static void bcm2835_fb_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = bcm2835_fb_props; + device_class_set_props(dc, bcm2835_fb_props); dc->realize = bcm2835_fb_realize; dc->reset = bcm2835_fb_reset; dc->vmsd = &vmstate_bcm2835_fb; diff --git a/hw/display/bochs-display.c b/hw/display/bochs-display.c index 215db9a..62085f9 100644 --- a/hw/display/bochs-display.c +++ b/hw/display/bochs-display.c @@ -364,7 +364,7 @@ static void bochs_display_class_init(ObjectClass *klass, void *data) k->romfile = "vgabios-bochs-display.bin"; k->exit = bochs_display_exit; dc->vmsd = &vmstate_bochs_display; - dc->props = bochs_display_properties; + device_class_set_props(dc, bochs_display_properties); set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); } diff --git a/hw/display/cg3.c b/hw/display/cg3.c index f90baae..4fb67c6 100644 --- a/hw/display/cg3.c +++ b/hw/display/cg3.c @@ -382,7 +382,7 @@ static void cg3_class_init(ObjectClass *klass, void *data) dc->realize = cg3_realizefn; dc->reset = cg3_reset; dc->vmsd = &vmstate_cg3; - dc->props = cg3_properties; + device_class_set_props(dc, cg3_properties); } static const TypeInfo cg3_info = { diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c index cd283e5..0d391e1 100644 --- a/hw/display/cirrus_vga.c +++ b/hw/display/cirrus_vga.c @@ -3031,7 +3031,7 @@ static void cirrus_vga_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); dc->desc = "Cirrus CLGD 54xx VGA"; dc->vmsd = &vmstate_pci_cirrus_vga; - dc->props = pci_vga_cirrus_properties; + device_class_set_props(dc, pci_vga_cirrus_properties); dc->hotpluggable = false; } diff --git a/hw/display/cirrus_vga_isa.c b/hw/display/cirrus_vga_isa.c index 7ef8e59..825ba57 100644 --- a/hw/display/cirrus_vga_isa.c +++ b/hw/display/cirrus_vga_isa.c @@ -80,7 +80,7 @@ static void isa_cirrus_vga_class_init(ObjectClass *klass, void *data) dc->vmsd = &vmstate_cirrus_vga; dc->realize = isa_cirrus_vga_realizefn; - dc->props = isa_cirrus_vga_properties; + device_class_set_props(dc, isa_cirrus_vga_properties); set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); } diff --git a/hw/display/g364fb.c b/hw/display/g364fb.c index 839d26e..55185c9 100644 --- a/hw/display/g364fb.c +++ b/hw/display/g364fb.c @@ -526,7 +526,7 @@ static void g364fb_sysbus_class_init(ObjectClass *klass, void *data) dc->desc = "G364 framebuffer"; dc->reset = g364fb_sysbus_reset; dc->vmsd = &vmstate_g364fb; - dc->props = g364fb_sysbus_properties; + device_class_set_props(dc, g364fb_sysbus_properties); } static const TypeInfo g364fb_sysbus_info = { diff --git a/hw/display/i2c-ddc.c b/hw/display/i2c-ddc.c index fc70b79..13eb529 100644 --- a/hw/display/i2c-ddc.c +++ b/hw/display/i2c-ddc.c @@ -107,7 +107,7 @@ static void i2c_ddc_class_init(ObjectClass *oc, void *data) dc->reset = i2c_ddc_reset; dc->vmsd = &vmstate_i2c_ddc; - dc->props = i2c_ddc_properties; + device_class_set_props(dc, i2c_ddc_properties); isc->event = i2c_ddc_event; isc->recv = i2c_ddc_rx; isc->send = i2c_ddc_tx; diff --git a/hw/display/macfb.c b/hw/display/macfb.c index f4fa8e3..8bff16d 100644 --- a/hw/display/macfb.c +++ b/hw/display/macfb.c @@ -437,7 +437,7 @@ static void macfb_sysbus_class_init(ObjectClass *klass, void *data) dc->desc = "SysBus Macintosh framebuffer"; dc->reset = macfb_sysbus_reset; dc->vmsd = &vmstate_macfb; - dc->props = macfb_sysbus_properties; + device_class_set_props(dc, macfb_sysbus_properties); } static void macfb_nubus_class_init(ObjectClass *klass, void *data) @@ -450,7 +450,7 @@ static void macfb_nubus_class_init(ObjectClass *klass, void *data) dc->desc = "Nubus Macintosh framebuffer"; dc->reset = macfb_nubus_reset; dc->vmsd = &vmstate_macfb; - dc->props = macfb_nubus_properties; + device_class_set_props(dc, macfb_nubus_properties); } static TypeInfo macfb_sysbus_info = { diff --git a/hw/display/milkymist-vgafb.c b/hw/display/milkymist-vgafb.c index 8b0da46..6a6441e 100644 --- a/hw/display/milkymist-vgafb.c +++ b/hw/display/milkymist-vgafb.c @@ -341,7 +341,7 @@ static void milkymist_vgafb_class_init(ObjectClass *klass, void *data) dc->reset = milkymist_vgafb_reset; dc->vmsd = &vmstate_milkymist_vgafb; - dc->props = milkymist_vgafb_properties; + device_class_set_props(dc, milkymist_vgafb_properties); dc->realize = milkymist_vgafb_realize; } diff --git a/hw/display/qxl.c b/hw/display/qxl.c index 6d43b74..944c02c 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -2478,7 +2478,7 @@ static void qxl_pci_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); dc->reset = qxl_reset_handler; dc->vmsd = &qxl_vmstate; - dc->props = qxl_properties; + device_class_set_props(dc, qxl_properties); } static const TypeInfo qxl_pci_type_info = { diff --git a/hw/display/ramfb-standalone.c b/hw/display/ramfb-standalone.c index 1f72450..d76a9d0 100644 --- a/hw/display/ramfb-standalone.c +++ b/hw/display/ramfb-standalone.c @@ -52,7 +52,7 @@ static void ramfb_class_initfn(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); dc->realize = ramfb_realizefn; - dc->props = ramfb_properties; + device_class_set_props(dc, ramfb_properties); dc->desc = "ram framebuffer standalone device"; dc->user_creatable = true; } diff --git a/hw/display/sm501.c b/hw/display/sm501.c index 66a1bfb..de0ab9d 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -1995,7 +1995,7 @@ static void sm501_sysbus_class_init(ObjectClass *klass, void *data) dc->realize = sm501_realize_sysbus; set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); dc->desc = "SM501 Multimedia Companion"; - dc->props = sm501_sysbus_properties; + device_class_set_props(dc, sm501_sysbus_properties); dc->reset = sm501_reset_sysbus; dc->vmsd = &vmstate_sm501_sysbus; } @@ -2085,7 +2085,7 @@ static void sm501_pci_class_init(ObjectClass *klass, void *data) k->class_id = PCI_CLASS_DISPLAY_OTHER; set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); dc->desc = "SM501 Display Controller"; - dc->props = sm501_pci_properties; + device_class_set_props(dc, sm501_pci_properties); dc->reset = sm501_reset_pci; dc->hotpluggable = false; dc->vmsd = &vmstate_sm501_pci; diff --git a/hw/display/tcx.c b/hw/display/tcx.c index abbeb30..ca458f9 100644 --- a/hw/display/tcx.c +++ b/hw/display/tcx.c @@ -893,7 +893,7 @@ static void tcx_class_init(ObjectClass *klass, void *data) dc->realize = tcx_realizefn; dc->reset = tcx_reset; dc->vmsd = &vmstate_tcx; - dc->props = tcx_properties; + device_class_set_props(dc, tcx_properties); } static const TypeInfo tcx_info = { diff --git a/hw/display/vga-isa.c b/hw/display/vga-isa.c index 08a2730..0633ed3 100644 --- a/hw/display/vga-isa.c +++ b/hw/display/vga-isa.c @@ -95,7 +95,7 @@ static void vga_isa_class_initfn(ObjectClass *klass, void *data) dc->realize = vga_isa_realizefn; dc->reset = vga_isa_reset; dc->vmsd = &vmstate_vga_common; - dc->props = vga_isa_properties; + device_class_set_props(dc, vga_isa_properties); set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); } diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c index cfe0957..b346324 100644 --- a/hw/display/vga-pci.c +++ b/hw/display/vga-pci.c @@ -383,7 +383,7 @@ static void vga_class_init(ObjectClass *klass, void *data) k->realize = pci_std_vga_realize; k->romfile = "vgabios-stdvga.bin"; k->class_id = PCI_CLASS_DISPLAY_VGA; - dc->props = vga_pci_properties; + device_class_set_props(dc, vga_pci_properties); dc->hotpluggable = false; } @@ -395,7 +395,7 @@ static void secondary_class_init(ObjectClass *klass, void *data) k->realize = pci_secondary_vga_realize; k->exit = pci_secondary_vga_exit; k->class_id = PCI_CLASS_DISPLAY_OTHER; - dc->props = secondary_pci_properties; + device_class_set_props(dc, secondary_pci_properties); dc->reset = pci_secondary_vga_reset; } diff --git a/hw/display/vhost-user-gpu.c b/hw/display/vhost-user-gpu.c index 2798778..f0c7c6f 100644 --- a/hw/display/vhost-user-gpu.c +++ b/hw/display/vhost-user-gpu.c @@ -588,7 +588,7 @@ vhost_user_gpu_class_init(ObjectClass *klass, void *data) vdc->get_config = vhost_user_gpu_get_config; vdc->set_config = vhost_user_gpu_set_config; - dc->props = vhost_user_gpu_properties; + device_class_set_props(dc, vhost_user_gpu_properties); } static const TypeInfo vhost_user_gpu_info = { diff --git a/hw/display/virtio-gpu-pci.c b/hw/display/virtio-gpu-pci.c index 25e4038..3d152ff 100644 --- a/hw/display/virtio-gpu-pci.c +++ b/hw/display/virtio-gpu-pci.c @@ -56,7 +56,7 @@ static void virtio_gpu_pci_base_class_init(ObjectClass *klass, void *data) PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass); set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); - dc->props = virtio_gpu_pci_base_properties; + device_class_set_props(dc, virtio_gpu_pci_base_properties); dc->hotpluggable = false; k->realize = virtio_gpu_pci_base_realize; pcidev_k->class_id = PCI_CLASS_DISPLAY_OTHER; diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index 28e868c..5f0dd7c 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -1254,7 +1254,7 @@ static void virtio_gpu_class_init(ObjectClass *klass, void *data) vdc->set_config = virtio_gpu_set_config; dc->vmsd = &vmstate_virtio_gpu; - dc->props = virtio_gpu_properties; + device_class_set_props(dc, virtio_gpu_properties); } static const TypeInfo virtio_gpu_info = { diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c index cc6e66e..2b4c2aa 100644 --- a/hw/display/virtio-vga.c +++ b/hw/display/virtio-vga.c @@ -184,7 +184,7 @@ static void virtio_vga_base_class_init(ObjectClass *klass, void *data) PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass); set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); - dc->props = virtio_vga_base_properties; + device_class_set_props(dc, virtio_vga_base_properties); dc->vmsd = &vmstate_virtio_vga_base; dc->hotpluggable = false; device_class_set_parent_reset(dc, virtio_vga_base_reset, diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c index ead754e..58ea82e 100644 --- a/hw/display/vmware_vga.c +++ b/hw/display/vmware_vga.c @@ -1336,7 +1336,7 @@ static void vmsvga_class_init(ObjectClass *klass, void *data) k->subsystem_id = SVGA_PCI_DEVICE_ID; dc->reset = vmsvga_reset; dc->vmsd = &vmstate_vmware_vga; - dc->props = vga_vmware_properties; + device_class_set_props(dc, vga_vmware_properties); dc->hotpluggable = false; set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); } diff --git a/hw/dma/i82374.c b/hw/dma/i82374.c index b788b36..6977d85 100644 --- a/hw/dma/i82374.c +++ b/hw/dma/i82374.c @@ -149,7 +149,7 @@ static void i82374_class_init(ObjectClass *klass, void *data) dc->realize = i82374_realize; dc->vmsd = &vmstate_i82374; - dc->props = i82374_properties; + device_class_set_props(dc, i82374_properties); } static const TypeInfo i82374_info = { diff --git a/hw/dma/i8257.c b/hw/dma/i8257.c index 792f617..bad8deb 100644 --- a/hw/dma/i8257.c +++ b/hw/dma/i8257.c @@ -595,7 +595,7 @@ static void i8257_class_init(ObjectClass *klass, void *data) dc->realize = i8257_realize; dc->reset = i8257_reset; dc->vmsd = &vmstate_i8257; - dc->props = i8257_properties; + device_class_set_props(dc, i8257_properties); idc->get_transfer_mode = i8257_dma_get_transfer_mode; idc->has_autoinitialization = i8257_dma_has_autoinitialization; diff --git a/hw/dma/pl080.c b/hw/dma/pl080.c index 52ba23f..f1a586b 100644 --- a/hw/dma/pl080.c +++ b/hw/dma/pl080.c @@ -421,7 +421,7 @@ static void pl080_class_init(ObjectClass *oc, void *data) dc->vmsd = &vmstate_pl080; dc->realize = pl080_realize; - dc->props = pl080_properties; + device_class_set_props(dc, pl080_properties); dc->reset = pl080_reset; } diff --git a/hw/dma/pl330.c b/hw/dma/pl330.c index f2bb2d9..8c9625c 100644 --- a/hw/dma/pl330.c +++ b/hw/dma/pl330.c @@ -1656,7 +1656,7 @@ static void pl330_class_init(ObjectClass *klass, void *data) dc->realize = pl330_realize; dc->reset = pl330_reset; - dc->props = pl330_properties; + device_class_set_props(dc, pl330_properties); dc->vmsd = &vmstate_pl330; } diff --git a/hw/dma/pxa2xx_dma.c b/hw/dma/pxa2xx_dma.c index 18e7a0b..88ed4b6 100644 --- a/hw/dma/pxa2xx_dma.c +++ b/hw/dma/pxa2xx_dma.c @@ -566,7 +566,7 @@ static void pxa2xx_dma_class_init(ObjectClass *klass, void *data) dc->desc = "PXA2xx DMA controller"; dc->vmsd = &vmstate_pxa2xx_dma; - dc->props = pxa2xx_dma_properties; + device_class_set_props(dc, pxa2xx_dma_properties); dc->realize = pxa2xx_dma_realize; } diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c index fb3a978..018f369 100644 --- a/hw/dma/xilinx_axidma.c +++ b/hw/dma/xilinx_axidma.c @@ -599,7 +599,7 @@ static void axidma_class_init(ObjectClass *klass, void *data) dc->realize = xilinx_axidma_realize, dc->reset = xilinx_axidma_reset; - dc->props = axidma_properties; + device_class_set_props(dc, axidma_properties); } static StreamSlaveClass xilinx_axidma_data_stream_class = { diff --git a/hw/dma/xlnx-zdma.c b/hw/dma/xlnx-zdma.c index 75b6609..8fb83f5 100644 --- a/hw/dma/xlnx-zdma.c +++ b/hw/dma/xlnx-zdma.c @@ -820,7 +820,7 @@ static void zdma_class_init(ObjectClass *klass, void *data) dc->reset = zdma_reset; dc->realize = zdma_realize; - dc->props = zdma_props; + device_class_set_props(dc, zdma_props); dc->vmsd = &vmstate_zdma; } diff --git a/hw/gpio/imx_gpio.c b/hw/gpio/imx_gpio.c index ac8304e..7a59180 100644 --- a/hw/gpio/imx_gpio.c +++ b/hw/gpio/imx_gpio.c @@ -335,7 +335,7 @@ static void imx_gpio_class_init(ObjectClass *klass, void *data) dc->realize = imx_gpio_realize; dc->reset = imx_gpio_reset; - dc->props = imx_gpio_properties; + device_class_set_props(dc, imx_gpio_properties); dc->vmsd = &vmstate_imx_gpio; dc->desc = "i.MX GPIO controller"; } diff --git a/hw/gpio/omap_gpio.c b/hw/gpio/omap_gpio.c index 85c1689..f662c4c 100644 --- a/hw/gpio/omap_gpio.c +++ b/hw/gpio/omap_gpio.c @@ -755,7 +755,7 @@ static void omap_gpio_class_init(ObjectClass *klass, void *data) dc->realize = omap_gpio_realize; dc->reset = omap_gpif_reset; - dc->props = omap_gpio_properties; + device_class_set_props(dc, omap_gpio_properties); /* Reason: pointer property "clk" */ dc->user_creatable = false; } @@ -790,7 +790,7 @@ static void omap2_gpio_class_init(ObjectClass *klass, void *data) dc->realize = omap2_gpio_realize; dc->reset = omap2_gpif_reset; - dc->props = omap2_gpio_properties; + device_class_set_props(dc, omap2_gpio_properties); /* Reason: pointer properties "iclk", "fclk0", ..., "fclk5" */ dc->user_creatable = false; } diff --git a/hw/i2c/aspeed_i2c.c b/hw/i2c/aspeed_i2c.c index 2da04a4..9cda968 100644 --- a/hw/i2c/aspeed_i2c.c +++ b/hw/i2c/aspeed_i2c.c @@ -832,7 +832,7 @@ static void aspeed_i2c_class_init(ObjectClass *klass, void *data) dc->vmsd = &aspeed_i2c_vmstate; dc->reset = aspeed_i2c_reset; - dc->props = aspeed_i2c_properties; + device_class_set_props(dc, aspeed_i2c_properties); dc->realize = aspeed_i2c_realize; dc->desc = "Aspeed I2C Controller"; } diff --git a/hw/i2c/core.c b/hw/i2c/core.c index d770035..d413a19 100644 --- a/hw/i2c/core.c +++ b/hw/i2c/core.c @@ -281,7 +281,7 @@ static void i2c_slave_class_init(ObjectClass *klass, void *data) DeviceClass *k = DEVICE_CLASS(klass); set_bit(DEVICE_CATEGORY_MISC, k->categories); k->bus_type = TYPE_I2C_BUS; - k->props = i2c_props; + device_class_set_props(k, i2c_props); } static const TypeInfo i2c_slave_type_info = { diff --git a/hw/i2c/omap_i2c.c b/hw/i2c/omap_i2c.c index 3ccbd5c..e5d205d 100644 --- a/hw/i2c/omap_i2c.c +++ b/hw/i2c/omap_i2c.c @@ -520,7 +520,7 @@ static void omap_i2c_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = omap_i2c_properties; + device_class_set_props(dc, omap_i2c_properties); dc->reset = omap_i2c_reset; /* Reason: pointer properties "iclk", "fclk" */ dc->user_creatable = false; diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index a523ef0..6258c58 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -3845,7 +3845,7 @@ static void vtd_class_init(ObjectClass *klass, void *data) dc->reset = vtd_reset; dc->vmsd = &vtd_vmstate; - dc->props = vtd_properties; + device_class_set_props(dc, vtd_properties); dc->hotpluggable = false; x86_class->realize = vtd_realize; x86_class->int_remap = vtd_int_remap; diff --git a/hw/i386/kvm/clock.c b/hw/i386/kvm/clock.c index 2c59b68..6428335 100644 --- a/hw/i386/kvm/clock.c +++ b/hw/i386/kvm/clock.c @@ -317,7 +317,7 @@ static void kvmclock_class_init(ObjectClass *klass, void *data) dc->realize = kvmclock_realize; dc->vmsd = &kvmclock_vmsd; - dc->props = kvmclock_properties; + device_class_set_props(dc, kvmclock_properties); } static const TypeInfo kvmclock_info = { diff --git a/hw/i386/kvm/i8254.c b/hw/i386/kvm/i8254.c index 6a911e2..876f5aa6 100644 --- a/hw/i386/kvm/i8254.c +++ b/hw/i386/kvm/i8254.c @@ -322,7 +322,7 @@ static void kvm_pit_class_init(ObjectClass *klass, void *data) k->set_channel_gate = kvm_pit_set_gate; k->get_channel_info = kvm_pit_get_channel_info; dc->reset = kvm_pit_reset; - dc->props = kvm_pit_properties; + device_class_set_props(dc, kvm_pit_properties); } static const TypeInfo kvm_pit_info = { diff --git a/hw/i386/kvm/ioapic.c b/hw/i386/kvm/ioapic.c index 973e2b2..4ba8e47 100644 --- a/hw/i386/kvm/ioapic.c +++ b/hw/i386/kvm/ioapic.c @@ -149,7 +149,7 @@ static void kvm_ioapic_class_init(ObjectClass *klass, void *data) k->pre_save = kvm_ioapic_get; k->post_load = kvm_ioapic_put; dc->reset = kvm_ioapic_reset; - dc->props = kvm_ioapic_properties; + device_class_set_props(dc, kvm_ioapic_properties); } static const TypeInfo kvm_ioapic_info = { diff --git a/hw/i386/vmmouse.c b/hw/i386/vmmouse.c index c0c329f..7c2a375 100644 --- a/hw/i386/vmmouse.c +++ b/hw/i386/vmmouse.c @@ -286,7 +286,7 @@ static void vmmouse_class_initfn(ObjectClass *klass, void *data) dc->realize = vmmouse_realizefn; dc->reset = vmmouse_reset; dc->vmsd = &vmstate_vmmouse; - dc->props = vmmouse_properties; + device_class_set_props(dc, vmmouse_properties); } static const TypeInfo vmmouse_info = { diff --git a/hw/i386/x86-iommu.c b/hw/i386/x86-iommu.c index 1eaf2dd..4104060 100644 --- a/hw/i386/x86-iommu.c +++ b/hw/i386/x86-iommu.c @@ -153,7 +153,7 @@ static void x86_iommu_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = x86_iommu_realize; - dc->props = x86_iommu_properties; + device_class_set_props(dc, x86_iommu_properties); } bool x86_iommu_ir_supported(X86IOMMUState *s) diff --git a/hw/i386/xen/xen_pvdevice.c b/hw/i386/xen/xen_pvdevice.c index 27f646d..ee2610c 100644 --- a/hw/i386/xen/xen_pvdevice.c +++ b/hw/i386/xen/xen_pvdevice.c @@ -131,7 +131,7 @@ static void xen_pv_class_init(ObjectClass *klass, void *data) k->realize = xen_pv_realize; k->class_id = PCI_CLASS_SYSTEM_OTHER; dc->desc = "Xen PV Device"; - dc->props = xen_pv_props; + device_class_set_props(dc, xen_pv_props); dc->vmsd = &vmstate_xen_pvdevice; } diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index d45393c..68264a2 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -1795,7 +1795,7 @@ static void sysbus_ahci_class_init(ObjectClass *klass, void *data) dc->realize = sysbus_ahci_realize; dc->vmsd = &vmstate_sysbus_ahci; - dc->props = sysbus_ahci_properties; + device_class_set_props(dc, sysbus_ahci_properties); dc->reset = sysbus_ahci_reset; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); } diff --git a/hw/ide/cmd646.c b/hw/ide/cmd646.c index 3f9be96..335c060 100644 --- a/hw/ide/cmd646.c +++ b/hw/ide/cmd646.c @@ -347,7 +347,7 @@ static void cmd646_ide_class_init(ObjectClass *klass, void *data) k->class_id = PCI_CLASS_STORAGE_IDE; k->config_read = cmd646_pci_config_read; k->config_write = cmd646_pci_config_write; - dc->props = cmd646_ide_properties; + device_class_set_props(dc, cmd646_ide_properties); set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); } diff --git a/hw/ide/isa.c b/hw/ide/isa.c index 9c7f88b..8395807 100644 --- a/hw/ide/isa.c +++ b/hw/ide/isa.c @@ -117,7 +117,7 @@ static void isa_ide_class_initfn(ObjectClass *klass, void *data) dc->realize = isa_ide_realizefn; dc->fw_name = "ide"; dc->reset = isa_ide_reset; - dc->props = isa_ide_properties; + device_class_set_props(dc, isa_ide_properties); set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); } diff --git a/hw/ide/macio.c b/hw/ide/macio.c index 79f787c..7a8470e 100644 --- a/hw/ide/macio.c +++ b/hw/ide/macio.c @@ -474,7 +474,7 @@ static void macio_ide_class_init(ObjectClass *oc, void *data) dc->realize = macio_ide_realizefn; dc->reset = macio_ide_reset; - dc->props = macio_ide_properties; + device_class_set_props(dc, macio_ide_properties); dc->vmsd = &vmstate_pmac; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); } diff --git a/hw/ide/mmio.c b/hw/ide/mmio.c index 7149a9c..d233bd8 100644 --- a/hw/ide/mmio.c +++ b/hw/ide/mmio.c @@ -154,7 +154,7 @@ static void mmio_ide_class_init(ObjectClass *oc, void *data) dc->realize = mmio_ide_realizefn; dc->reset = mmio_ide_reset; - dc->props = mmio_ide_properties; + device_class_set_props(dc, mmio_ide_properties); dc->vmsd = &vmstate_ide_mmio; } diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c index 374a791..c22afdb 100644 --- a/hw/ide/qdev.c +++ b/hw/ide/qdev.c @@ -319,7 +319,7 @@ static void ide_hd_class_init(ObjectClass *klass, void *data) k->realize = ide_hd_realize; dc->fw_name = "drive"; dc->desc = "virtual IDE disk"; - dc->props = ide_hd_properties; + device_class_set_props(dc, ide_hd_properties); } static const TypeInfo ide_hd_info = { @@ -342,7 +342,7 @@ static void ide_cd_class_init(ObjectClass *klass, void *data) k->realize = ide_cd_realize; dc->fw_name = "drive"; dc->desc = "virtual IDE CD-ROM"; - dc->props = ide_cd_properties; + device_class_set_props(dc, ide_cd_properties); } static const TypeInfo ide_cd_info = { @@ -365,7 +365,7 @@ static void ide_drive_class_init(ObjectClass *klass, void *data) k->realize = ide_drive_realize; dc->fw_name = "drive"; dc->desc = "virtual IDE disk or CD-ROM (legacy)"; - dc->props = ide_drive_properties; + device_class_set_props(dc, ide_drive_properties); } static const TypeInfo ide_drive_info = { @@ -381,7 +381,7 @@ static void ide_device_class_init(ObjectClass *klass, void *data) k->realize = ide_qdev_realize; set_bit(DEVICE_CATEGORY_STORAGE, k->categories); k->bus_type = TYPE_IDE_BUS; - k->props = ide_props; + device_class_set_props(k, ide_props); } static const TypeInfo ide_device_type_info = { diff --git a/hw/input/adb.c b/hw/input/adb.c index 478a90f..b1ac4a3 100644 --- a/hw/input/adb.c +++ b/hw/input/adb.c @@ -128,7 +128,7 @@ static void adb_device_class_init(ObjectClass *oc, void *data) DeviceClass *dc = DEVICE_CLASS(oc); dc->realize = adb_device_realizefn; - dc->props = adb_device_properties; + device_class_set_props(dc, adb_device_properties); dc->bus_type = TYPE_ADB_BUS; } diff --git a/hw/input/milkymist-softusb.c b/hw/input/milkymist-softusb.c index 67fcb35..3e0a7eb 100644 --- a/hw/input/milkymist-softusb.c +++ b/hw/input/milkymist-softusb.c @@ -302,7 +302,7 @@ static void milkymist_softusb_class_init(ObjectClass *klass, void *data) dc->realize = milkymist_softusb_realize; dc->reset = milkymist_softusb_reset; dc->vmsd = &vmstate_milkymist_softusb; - dc->props = milkymist_softusb_properties; + device_class_set_props(dc, milkymist_softusb_properties); } static const TypeInfo milkymist_softusb_info = { diff --git a/hw/input/virtio-input-hid.c b/hw/input/virtio-input-hid.c index 386a363..e8ae6c1 100644 --- a/hw/input/virtio-input-hid.c +++ b/hw/input/virtio-input-hid.c @@ -222,7 +222,7 @@ static void virtio_input_hid_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); VirtIOInputClass *vic = VIRTIO_INPUT_CLASS(klass); - dc->props = virtio_input_hid_properties; + device_class_set_props(dc, virtio_input_hid_properties); vic->realize = virtio_input_hid_realize; vic->unrealize = virtio_input_hid_unrealize; vic->change_active = virtio_input_hid_change_active; @@ -362,7 +362,7 @@ static void virtio_mouse_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = virtio_mouse_properties; + device_class_set_props(dc, virtio_mouse_properties); } static void virtio_mouse_init(Object *obj) @@ -486,7 +486,7 @@ static void virtio_tablet_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = virtio_tablet_properties; + device_class_set_props(dc, virtio_tablet_properties); } static void virtio_tablet_init(Object *obj) diff --git a/hw/input/virtio-input-host.c b/hw/input/virtio-input-host.c index 1c3b12b..f2ab6df 100644 --- a/hw/input/virtio-input-host.c +++ b/hw/input/virtio-input-host.c @@ -226,7 +226,7 @@ static void virtio_input_host_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->vmsd = &vmstate_virtio_input_host; - dc->props = virtio_input_host_properties; + device_class_set_props(dc, virtio_input_host_properties); vic->realize = virtio_input_host_realize; vic->unrealize = virtio_input_host_unrealize; vic->handle_status = virtio_input_host_handle_status; diff --git a/hw/input/virtio-input.c b/hw/input/virtio-input.c index 9c013af..4d49790 100644 --- a/hw/input/virtio-input.c +++ b/hw/input/virtio-input.c @@ -316,7 +316,7 @@ static void virtio_input_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); - dc->props = virtio_input_properties; + device_class_set_props(dc, virtio_input_properties); dc->vmsd = &vmstate_virtio_input; set_bit(DEVICE_CATEGORY_INPUT, dc->categories); vdc->realize = virtio_input_device_realize; diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c index b5dbeb6..9ec0f2d 100644 --- a/hw/intc/apic_common.c +++ b/hw/intc/apic_common.c @@ -453,7 +453,7 @@ static void apic_common_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->reset = apic_reset_common; - dc->props = apic_properties_common; + device_class_set_props(dc, apic_properties_common); dc->realize = apic_common_realize; dc->unrealize = apic_common_unrealize; /* diff --git a/hw/intc/arm_gic_common.c b/hw/intc/arm_gic_common.c index f0d0d7c..e6c4fe7 100644 --- a/hw/intc/arm_gic_common.c +++ b/hw/intc/arm_gic_common.c @@ -367,7 +367,7 @@ static void arm_gic_common_class_init(ObjectClass *klass, void *data) dc->reset = arm_gic_common_reset; dc->realize = arm_gic_common_realize; - dc->props = arm_gic_common_properties; + device_class_set_props(dc, arm_gic_common_properties); dc->vmsd = &vmstate_gic; albifc->arm_linux_init = arm_gic_common_linux_init; } diff --git a/hw/intc/arm_gicv2m.c b/hw/intc/arm_gicv2m.c index 6e45f4f..0b7e2b4 100644 --- a/hw/intc/arm_gicv2m.c +++ b/hw/intc/arm_gicv2m.c @@ -179,7 +179,7 @@ static void gicv2m_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = gicv2m_properties; + device_class_set_props(dc, gicv2m_properties); dc->realize = gicv2m_realize; } diff --git a/hw/intc/arm_gicv3_common.c b/hw/intc/arm_gicv3_common.c index f0c551d..58ef65f 100644 --- a/hw/intc/arm_gicv3_common.c +++ b/hw/intc/arm_gicv3_common.c @@ -507,7 +507,7 @@ static void arm_gicv3_common_class_init(ObjectClass *klass, void *data) dc->reset = arm_gicv3_common_reset; dc->realize = arm_gicv3_common_realize; - dc->props = arm_gicv3_common_properties; + device_class_set_props(dc, arm_gicv3_common_properties); dc->vmsd = &vmstate_gicv3; albifc->arm_linux_init = arm_gic_common_linux_init; } diff --git a/hw/intc/arm_gicv3_its_kvm.c b/hw/intc/arm_gicv3_its_kvm.c index d66f243..ad0ebab 100644 --- a/hw/intc/arm_gicv3_its_kvm.c +++ b/hw/intc/arm_gicv3_its_kvm.c @@ -246,7 +246,7 @@ static void kvm_arm_its_class_init(ObjectClass *klass, void *data) KVMARMITSClass *ic = KVM_ARM_ITS_CLASS(klass); dc->realize = kvm_arm_its_realize; - dc->props = kvm_arm_its_props; + device_class_set_props(dc, kvm_arm_its_props); device_class_set_parent_reset(dc, kvm_arm_its_reset, &ic->parent_reset); icc->send_msi = kvm_its_send_msi; icc->pre_save = kvm_arm_its_pre_save; diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c index e8c74f9..f9e0eea 100644 --- a/hw/intc/armv7m_nvic.c +++ b/hw/intc/armv7m_nvic.c @@ -2749,7 +2749,7 @@ static void armv7m_nvic_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->vmsd = &vmstate_nvic; - dc->props = props_nvic; + device_class_set_props(dc, props_nvic); dc->reset = armv7m_nvic_reset; dc->realize = armv7m_nvic_realize; } diff --git a/hw/intc/exynos4210_combiner.c b/hw/intc/exynos4210_combiner.c index 5b33ca6..b8561e4 100644 --- a/hw/intc/exynos4210_combiner.c +++ b/hw/intc/exynos4210_combiner.c @@ -442,7 +442,7 @@ static void exynos4210_combiner_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->reset = exynos4210_combiner_reset; - dc->props = exynos4210_combiner_properties; + device_class_set_props(dc, exynos4210_combiner_properties); dc->vmsd = &vmstate_exynos4210_combiner; } diff --git a/hw/intc/exynos4210_gic.c b/hw/intc/exynos4210_gic.c index 9a84d85..82c8f41 100644 --- a/hw/intc/exynos4210_gic.c +++ b/hw/intc/exynos4210_gic.c @@ -355,7 +355,7 @@ static void exynos4210_gic_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = exynos4210_gic_properties; + device_class_set_props(dc, exynos4210_gic_properties); dc->realize = exynos4210_gic_realize; } @@ -462,7 +462,7 @@ static void exynos4210_irq_gate_class_init(ObjectClass *klass, void *data) dc->reset = exynos4210_irq_gate_reset; dc->vmsd = &vmstate_exynos4210_irq_gate; - dc->props = exynos4210_irq_gate_properties; + device_class_set_props(dc, exynos4210_irq_gate_properties); dc->realize = exynos4210_irq_gate_realize; } diff --git a/hw/intc/i8259_common.c b/hw/intc/i8259_common.c index e7b1a10..99f8f6a 100644 --- a/hw/intc/i8259_common.c +++ b/hw/intc/i8259_common.c @@ -184,7 +184,7 @@ static void pic_common_class_init(ObjectClass *klass, void *data) InterruptStatsProviderClass *ic = INTERRUPT_STATS_PROVIDER_CLASS(klass); dc->vmsd = &vmstate_pic_common; - dc->props = pic_properties_common; + device_class_set_props(dc, pic_properties_common); dc->realize = pic_common_realize; /* * Reason: unlike ordinary ISA devices, the PICs need additional diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c index 4f55776..15747fe 100644 --- a/hw/intc/ioapic.c +++ b/hw/intc/ioapic.c @@ -477,7 +477,7 @@ static void ioapic_class_init(ObjectClass *klass, void *data) */ k->post_load = ioapic_update_kvm_routes; dc->reset = ioapic_reset_common; - dc->props = ioapic_properties; + device_class_set_props(dc, ioapic_properties); } static const TypeInfo ioapic_info = { diff --git a/hw/intc/mips_gic.c b/hw/intc/mips_gic.c index 54b3059..bda4549 100644 --- a/hw/intc/mips_gic.c +++ b/hw/intc/mips_gic.c @@ -448,7 +448,7 @@ static void mips_gic_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = mips_gic_properties; + device_class_set_props(dc, mips_gic_properties); dc->realize = mips_gic_realize; } diff --git a/hw/intc/omap_intc.c b/hw/intc/omap_intc.c index 73bb1c2..b8a1d1f 100644 --- a/hw/intc/omap_intc.c +++ b/hw/intc/omap_intc.c @@ -407,7 +407,7 @@ static void omap_intc_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->reset = omap_inth_reset; - dc->props = omap_intc_properties; + device_class_set_props(dc, omap_intc_properties); /* Reason: pointer property "clk" */ dc->user_creatable = false; dc->realize = omap_intc_realize; @@ -660,7 +660,7 @@ static void omap2_intc_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->reset = omap_inth_reset; - dc->props = omap2_intc_properties; + device_class_set_props(dc, omap2_intc_properties); /* Reason: pointer property "iclk", "fclk" */ dc->user_creatable = false; dc->realize = omap2_intc_realize; diff --git a/hw/intc/ompic.c b/hw/intc/ompic.c index ca9614f..c354427 100644 --- a/hw/intc/ompic.c +++ b/hw/intc/ompic.c @@ -161,7 +161,7 @@ static void or1k_ompic_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = or1k_ompic_properties; + device_class_set_props(dc, or1k_ompic_properties); dc->realize = or1k_ompic_realize; dc->vmsd = &vmstate_or1k_ompic; } diff --git a/hw/intc/openpic.c b/hw/intc/openpic.c index c797ba7..65970e1 100644 --- a/hw/intc/openpic.c +++ b/hw/intc/openpic.c @@ -1628,7 +1628,7 @@ static void openpic_class_init(ObjectClass *oc, void *data) DeviceClass *dc = DEVICE_CLASS(oc); dc->realize = openpic_realize; - dc->props = openpic_properties; + device_class_set_props(dc, openpic_properties); dc->reset = openpic_reset; dc->vmsd = &vmstate_openpic; set_bit(DEVICE_CATEGORY_MISC, dc->categories); diff --git a/hw/intc/openpic_kvm.c b/hw/intc/openpic_kvm.c index c09bebe..e4bf47d 100644 --- a/hw/intc/openpic_kvm.c +++ b/hw/intc/openpic_kvm.c @@ -274,7 +274,7 @@ static void kvm_openpic_class_init(ObjectClass *oc, void *data) DeviceClass *dc = DEVICE_CLASS(oc); dc->realize = kvm_openpic_realize; - dc->props = kvm_openpic_properties; + device_class_set_props(dc, kvm_openpic_properties); dc->reset = kvm_openpic_reset; set_bit(DEVICE_CATEGORY_MISC, dc->categories); } diff --git a/hw/intc/pnv_xive.c b/hw/intc/pnv_xive.c index 715fca6..aeda488 100644 --- a/hw/intc/pnv_xive.c +++ b/hw/intc/pnv_xive.c @@ -1957,7 +1957,7 @@ static void pnv_xive_class_init(ObjectClass *klass, void *data) dc->desc = "PowerNV XIVE Interrupt Controller"; device_class_set_parent_realize(dc, pnv_xive_realize, &pxc->parent_realize); dc->realize = pnv_xive_realize; - dc->props = pnv_xive_properties; + device_class_set_props(dc, pnv_xive_properties); xrc->get_eas = pnv_xive_get_eas; xrc->get_end = pnv_xive_get_end; diff --git a/hw/intc/s390_flic.c b/hw/intc/s390_flic.c index a159c0c..5f290f5 100644 --- a/hw/intc/s390_flic.c +++ b/hw/intc/s390_flic.c @@ -427,7 +427,7 @@ static void s390_flic_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); - dc->props = s390_flic_common_properties; + device_class_set_props(dc, s390_flic_common_properties); dc->realize = s390_flic_common_realize; } diff --git a/hw/intc/spapr_xive.c b/hw/intc/spapr_xive.c index 7663123..024b8ce 100644 --- a/hw/intc/spapr_xive.c +++ b/hw/intc/spapr_xive.c @@ -770,7 +770,7 @@ static void spapr_xive_class_init(ObjectClass *klass, void *data) SpaprXiveClass *sxc = SPAPR_XIVE_CLASS(klass); dc->desc = "sPAPR XIVE Interrupt Controller"; - dc->props = spapr_xive_properties; + device_class_set_props(dc, spapr_xive_properties); device_class_set_parent_realize(dc, spapr_xive_realize, &sxc->parent_realize); dc->vmsd = &vmstate_spapr_xive; diff --git a/hw/intc/xics.c b/hw/intc/xics.c index 1952009..785b607 100644 --- a/hw/intc/xics.c +++ b/hw/intc/xics.c @@ -358,7 +358,7 @@ static void icp_class_init(ObjectClass *klass, void *data) dc->realize = icp_realize; dc->unrealize = icp_unrealize; - dc->props = icp_properties; + device_class_set_props(dc, icp_properties); /* * Reason: part of XICS interrupt controller, needs to be wired up * by icp_create(). @@ -680,7 +680,7 @@ static void ics_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = ics_realize; - dc->props = ics_properties; + device_class_set_props(dc, ics_properties); dc->reset = ics_reset; dc->vmsd = &vmstate_ics; /* diff --git a/hw/intc/xilinx_intc.c b/hw/intc/xilinx_intc.c index e15cb42..3e65e68 100644 --- a/hw/intc/xilinx_intc.c +++ b/hw/intc/xilinx_intc.c @@ -185,7 +185,7 @@ static void xilinx_intc_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = xilinx_intc_properties; + device_class_set_props(dc, xilinx_intc_properties); } static const TypeInfo xilinx_intc_info = { diff --git a/hw/intc/xive.c b/hw/intc/xive.c index bc8019c..7fb29a4 100644 --- a/hw/intc/xive.c +++ b/hw/intc/xive.c @@ -740,7 +740,7 @@ static void xive_tctx_class_init(ObjectClass *klass, void *data) dc->desc = "XIVE Interrupt Thread Context"; dc->realize = xive_tctx_realize; dc->vmsd = &vmstate_xive_tctx; - dc->props = xive_tctx_properties; + device_class_set_props(dc, xive_tctx_properties); /* * Reason: part of XIVE interrupt controller, needs to be wired up * by xive_tctx_create(). @@ -1192,7 +1192,7 @@ static void xive_source_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->desc = "XIVE Interrupt Source"; - dc->props = xive_source_properties; + device_class_set_props(dc, xive_source_properties); dc->realize = xive_source_realize; dc->vmsd = &vmstate_xive_source; /* @@ -1899,7 +1899,7 @@ static void xive_end_source_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->desc = "XIVE END Source"; - dc->props = xive_end_source_properties; + device_class_set_props(dc, xive_end_source_properties); dc->realize = xive_end_source_realize; /* * Reason: part of XIVE interrupt controller, needs to be wired up, diff --git a/hw/intc/xlnx-pmu-iomod-intc.c b/hw/intc/xlnx-pmu-iomod-intc.c index f9a1401..acaa1c3 100644 --- a/hw/intc/xlnx-pmu-iomod-intc.c +++ b/hw/intc/xlnx-pmu-iomod-intc.c @@ -539,7 +539,7 @@ static void xlnx_pmu_io_intc_class_init(ObjectClass *klass, void *data) dc->reset = xlnx_pmu_io_intc_reset; dc->realize = xlnx_pmu_io_intc_realize; dc->vmsd = &vmstate_xlnx_pmu_io_intc; - dc->props = xlnx_pmu_io_intc_properties; + device_class_set_props(dc, xlnx_pmu_io_intc_properties); } static const TypeInfo xlnx_pmu_io_intc_info = { diff --git a/hw/ipack/ipack.c b/hw/ipack/ipack.c index 30e1669..49787a1 100644 --- a/hw/ipack/ipack.c +++ b/hw/ipack/ipack.c @@ -88,7 +88,7 @@ static void ipack_device_class_init(ObjectClass *klass, void *data) k->bus_type = TYPE_IPACK_BUS; k->realize = ipack_device_realize; k->unrealize = ipack_device_unrealize; - k->props = ipack_device_props; + device_class_set_props(k, ipack_device_props); } const VMStateDescription vmstate_ipack_device = { diff --git a/hw/ipmi/ipmi.c b/hw/ipmi/ipmi.c index cbe158f..46c6a79 100644 --- a/hw/ipmi/ipmi.c +++ b/hw/ipmi/ipmi.c @@ -118,7 +118,7 @@ static void bmc_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); - dc->props = ipmi_bmc_properties; + device_class_set_props(dc, ipmi_bmc_properties); } static TypeInfo ipmi_bmc_type_info = { diff --git a/hw/ipmi/ipmi_bmc_extern.c b/hw/ipmi/ipmi_bmc_extern.c index 16a4117..f9a13e0 100644 --- a/hw/ipmi/ipmi_bmc_extern.c +++ b/hw/ipmi/ipmi_bmc_extern.c @@ -528,7 +528,7 @@ static void ipmi_bmc_extern_class_init(ObjectClass *oc, void *data) bk->handle_reset = ipmi_bmc_extern_handle_reset; dc->hotpluggable = false; dc->realize = ipmi_bmc_extern_realize; - dc->props = ipmi_bmc_extern_properties; + device_class_set_props(dc, ipmi_bmc_extern_properties); } static const TypeInfo ipmi_bmc_extern_type = { diff --git a/hw/ipmi/ipmi_bmc_sim.c b/hw/ipmi/ipmi_bmc_sim.c index 6670cf0..0b97e04 100644 --- a/hw/ipmi/ipmi_bmc_sim.c +++ b/hw/ipmi/ipmi_bmc_sim.c @@ -1989,7 +1989,7 @@ static void ipmi_sim_class_init(ObjectClass *oc, void *data) dc->hotpluggable = false; dc->realize = ipmi_sim_realize; - dc->props = ipmi_sim_properties; + device_class_set_props(dc, ipmi_sim_properties); bk->handle_command = ipmi_sim_handle_command; } diff --git a/hw/ipmi/isa_ipmi_bt.c b/hw/ipmi/isa_ipmi_bt.c index 9fba5ed..c8dc0a0 100644 --- a/hw/ipmi/isa_ipmi_bt.c +++ b/hw/ipmi/isa_ipmi_bt.c @@ -147,7 +147,7 @@ static void isa_ipmi_bt_class_init(ObjectClass *oc, void *data) IPMIInterfaceClass *iic = IPMI_INTERFACE_CLASS(oc); dc->realize = isa_ipmi_bt_realize; - dc->props = ipmi_isa_properties; + device_class_set_props(dc, ipmi_isa_properties); iic->get_backend_data = isa_ipmi_bt_get_backend_data; ipmi_bt_class_init(iic); diff --git a/hw/ipmi/isa_ipmi_kcs.c b/hw/ipmi/isa_ipmi_kcs.c index cc6bd81..4b421c3 100644 --- a/hw/ipmi/isa_ipmi_kcs.c +++ b/hw/ipmi/isa_ipmi_kcs.c @@ -154,7 +154,7 @@ static void isa_ipmi_kcs_class_init(ObjectClass *oc, void *data) IPMIInterfaceClass *iic = IPMI_INTERFACE_CLASS(oc); dc->realize = ipmi_isa_realize; - dc->props = ipmi_isa_properties; + device_class_set_props(dc, ipmi_isa_properties); iic->get_backend_data = isa_ipmi_kcs_get_backend_data; ipmi_kcs_class_init(iic); diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index 170792a..f85b484 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -784,7 +784,7 @@ static void ich9_lpc_class_init(ObjectClass *klass, void *data) dc->reset = ich9_lpc_reset; k->realize = ich9_lpc_realize; dc->vmsd = &vmstate_ich9_lpc; - dc->props = ich9_lpc_properties; + device_class_set_props(dc, ich9_lpc_properties); k->config_write = ich9_lpc_config_write; dc->desc = "ICH9 LPC bridge"; k->vendor_id = PCI_VENDOR_ID_INTEL; diff --git a/hw/isa/pc87312.c b/hw/isa/pc87312.c index b9bd574..0cacbbc 100644 --- a/hw/isa/pc87312.c +++ b/hw/isa/pc87312.c @@ -342,7 +342,7 @@ static void pc87312_class_init(ObjectClass *klass, void *data) dc->realize = pc87312_realize; dc->reset = pc87312_reset; dc->vmsd = &vmstate_pc87312; - dc->props = pc87312_properties; + device_class_set_props(dc, pc87312_properties); sc->parallel = (ISASuperIOFuncs){ .count = 1, diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index f828708..d9b51fc 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -417,7 +417,7 @@ static void via_pm_class_init(ObjectClass *klass, void *data) dc->desc = "PM"; dc->vmsd = &vmstate_acpi; set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); - dc->props = via_pm_properties; + device_class_set_props(dc, via_pm_properties); } static const TypeInfo via_pm_info = { diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c index 375f9a5..39f1426 100644 --- a/hw/mem/nvdimm.c +++ b/hw/mem/nvdimm.c @@ -202,7 +202,7 @@ static void nvdimm_class_init(ObjectClass *oc, void *data) ddc->realize = nvdimm_realize; mdc->get_memory_region = nvdimm_md_get_memory_region; - dc->props = nvdimm_properties; + device_class_set_props(dc, nvdimm_properties); nvc->read_label_data = nvdimm_read_label_data; nvc->write_label_data = nvdimm_write_label_data; diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c index 99e2faf..8f50b8a 100644 --- a/hw/mem/pc-dimm.c +++ b/hw/mem/pc-dimm.c @@ -271,7 +271,7 @@ static void pc_dimm_class_init(ObjectClass *oc, void *data) dc->realize = pc_dimm_realize; dc->unrealize = pc_dimm_unrealize; - dc->props = pc_dimm_properties; + device_class_set_props(dc, pc_dimm_properties); dc->desc = "DIMM memory module"; ddc->get_vmstate_memory_region = pc_dimm_get_memory_region; diff --git a/hw/mips/cps.c b/hw/mips/cps.c index c49868d..92b9b1a 100644 --- a/hw/mips/cps.c +++ b/hw/mips/cps.c @@ -178,7 +178,7 @@ static void mips_cps_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = mips_cps_realize; - dc->props = mips_cps_properties; + device_class_set_props(dc, mips_cps_properties); } static const TypeInfo mips_cps_info = { diff --git a/hw/misc/a9scu.c b/hw/misc/a9scu.c index 45c91db..324371a 100644 --- a/hw/misc/a9scu.c +++ b/hw/misc/a9scu.c @@ -135,7 +135,7 @@ static void a9_scu_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = a9_scu_properties; + device_class_set_props(dc, a9_scu_properties); dc->vmsd = &vmstate_a9_scu; dc->reset = a9_scu_reset; } diff --git a/hw/misc/applesmc.c b/hw/misc/applesmc.c index 24d57e8..1c4addb 100644 --- a/hw/misc/applesmc.c +++ b/hw/misc/applesmc.c @@ -353,7 +353,7 @@ static void qdev_applesmc_class_init(ObjectClass *klass, void *data) dc->realize = applesmc_isa_realize; dc->reset = qdev_applesmc_isa_reset; - dc->props = applesmc_isa_properties; + device_class_set_props(dc, applesmc_isa_properties); set_bit(DEVICE_CATEGORY_MISC, dc->categories); } diff --git a/hw/misc/arm11scu.c b/hw/misc/arm11scu.c index 3023284..17c36a0 100644 --- a/hw/misc/arm11scu.c +++ b/hw/misc/arm11scu.c @@ -85,7 +85,7 @@ static void arm11_scu_class_init(ObjectClass *oc, void *data) DeviceClass *dc = DEVICE_CLASS(oc); dc->realize = arm11_scu_realize; - dc->props = arm11_scu_properties; + device_class_set_props(dc, arm11_scu_properties); } static const TypeInfo arm11_scu_type_info = { diff --git a/hw/misc/arm_l2x0.c b/hw/misc/arm_l2x0.c index af2c7af..2066c97 100644 --- a/hw/misc/arm_l2x0.c +++ b/hw/misc/arm_l2x0.c @@ -182,7 +182,7 @@ static void l2x0_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->vmsd = &vmstate_l2x0; - dc->props = l2x0_properties; + device_class_set_props(dc, l2x0_properties); dc->reset = l2x0_priv_reset; } diff --git a/hw/misc/arm_sysctl.c b/hw/misc/arm_sysctl.c index fc79522..a474bbd 100644 --- a/hw/misc/arm_sysctl.c +++ b/hw/misc/arm_sysctl.c @@ -642,7 +642,7 @@ static void arm_sysctl_class_init(ObjectClass *klass, void *data) dc->realize = arm_sysctl_realize; dc->reset = arm_sysctl_reset; dc->vmsd = &vmstate_arm_sysctl; - dc->props = arm_sysctl_properties; + device_class_set_props(dc, arm_sysctl_properties); } static const TypeInfo arm_sysctl_info = { diff --git a/hw/misc/armsse-cpuid.c b/hw/misc/armsse-cpuid.c index 8ab15fe..d58138d 100644 --- a/hw/misc/armsse-cpuid.c +++ b/hw/misc/armsse-cpuid.c @@ -116,7 +116,7 @@ static void armsse_cpuid_class_init(ObjectClass *klass, void *data) * does not need a reset function or VMState. */ - dc->props = armsse_cpuid_props; + device_class_set_props(dc, armsse_cpuid_props); } static const TypeInfo armsse_cpuid_info = { diff --git a/hw/misc/aspeed_scu.c b/hw/misc/aspeed_scu.c index f62fa25..ce2f956 100644 --- a/hw/misc/aspeed_scu.c +++ b/hw/misc/aspeed_scu.c @@ -447,7 +447,7 @@ static void aspeed_scu_class_init(ObjectClass *klass, void *data) dc->reset = aspeed_scu_reset; dc->desc = "ASPEED System Control Unit"; dc->vmsd = &vmstate_aspeed_scu; - dc->props = aspeed_scu_properties; + device_class_set_props(dc, aspeed_scu_properties); } static const TypeInfo aspeed_scu_info = { diff --git a/hw/misc/aspeed_sdmc.c b/hw/misc/aspeed_sdmc.c index 2df3244..9c18479 100644 --- a/hw/misc/aspeed_sdmc.c +++ b/hw/misc/aspeed_sdmc.c @@ -261,7 +261,7 @@ static void aspeed_sdmc_class_init(ObjectClass *klass, void *data) dc->reset = aspeed_sdmc_reset; dc->desc = "ASPEED SDRAM Memory Controller"; dc->vmsd = &vmstate_aspeed_sdmc; - dc->props = aspeed_sdmc_properties; + device_class_set_props(dc, aspeed_sdmc_properties); } static const TypeInfo aspeed_sdmc_info = { diff --git a/hw/misc/bcm2835_property.c b/hw/misc/bcm2835_property.c index 0eea2e2..df91280 100644 --- a/hw/misc/bcm2835_property.c +++ b/hw/misc/bcm2835_property.c @@ -426,7 +426,7 @@ static void bcm2835_property_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = bcm2835_property_props; + device_class_set_props(dc, bcm2835_property_props); dc->realize = bcm2835_property_realize; dc->vmsd = &vmstate_bcm2835_property; } diff --git a/hw/misc/debugexit.c b/hw/misc/debugexit.c index ccf02bd..99a814f 100644 --- a/hw/misc/debugexit.c +++ b/hw/misc/debugexit.c @@ -65,7 +65,7 @@ static void debug_exit_class_initfn(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = debug_exit_realizefn; - dc->props = debug_exit_properties; + device_class_set_props(dc, debug_exit_properties); set_bit(DEVICE_CATEGORY_MISC, dc->categories); } diff --git a/hw/misc/eccmemctl.c b/hw/misc/eccmemctl.c index 4b1f2b6..aec4473 100644 --- a/hw/misc/eccmemctl.c +++ b/hw/misc/eccmemctl.c @@ -336,7 +336,7 @@ static void ecc_class_init(ObjectClass *klass, void *data) dc->realize = ecc_realize; dc->reset = ecc_reset; dc->vmsd = &vmstate_ecc; - dc->props = ecc_properties; + device_class_set_props(dc, ecc_properties); } static const TypeInfo ecc_info = { diff --git a/hw/misc/iotkit-sysctl.c b/hw/misc/iotkit-sysctl.c index 9aa8109..ec1cc19 100644 --- a/hw/misc/iotkit-sysctl.c +++ b/hw/misc/iotkit-sysctl.c @@ -508,7 +508,7 @@ static void iotkit_sysctl_class_init(ObjectClass *klass, void *data) dc->vmsd = &iotkit_sysctl_vmstate; dc->reset = iotkit_sysctl_reset; - dc->props = iotkit_sysctl_props; + device_class_set_props(dc, iotkit_sysctl_props); dc->realize = iotkit_sysctl_realize; } diff --git a/hw/misc/iotkit-sysinfo.c b/hw/misc/iotkit-sysinfo.c index 783e613..b2dcfc4 100644 --- a/hw/misc/iotkit-sysinfo.c +++ b/hw/misc/iotkit-sysinfo.c @@ -121,7 +121,7 @@ static void iotkit_sysinfo_class_init(ObjectClass *klass, void *data) * does not need a reset function or VMState. */ - dc->props = iotkit_sysinfo_props; + device_class_set_props(dc, iotkit_sysinfo_props); } static const TypeInfo iotkit_sysinfo_info = { diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 710cdb72..1a0fad7 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -1055,7 +1055,7 @@ static void ivshmem_plain_class_init(ObjectClass *klass, void *data) PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); k->realize = ivshmem_plain_realize; - dc->props = ivshmem_plain_properties; + device_class_set_props(dc, ivshmem_plain_properties); dc->vmsd = &ivshmem_plain_vmsd; } @@ -1115,7 +1115,7 @@ static void ivshmem_doorbell_class_init(ObjectClass *klass, void *data) PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); k->realize = ivshmem_doorbell_realize; - dc->props = ivshmem_doorbell_properties; + device_class_set_props(dc, ivshmem_doorbell_properties); dc->vmsd = &ivshmem_doorbell_vmsd; } diff --git a/hw/misc/mac_via.c b/hw/misc/mac_via.c index e9e6a95..b7d0012 100644 --- a/hw/misc/mac_via.c +++ b/hw/misc/mac_via.c @@ -1021,7 +1021,7 @@ static void mac_via_class_init(ObjectClass *oc, void *data) dc->realize = mac_via_realize; dc->reset = mac_via_reset; dc->vmsd = &vmstate_mac_via; - dc->props = mac_via_properties; + device_class_set_props(dc, mac_via_properties); } static TypeInfo mac_via_info = { diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c index e38becb..e0cc0aa 100644 --- a/hw/misc/macio/cuda.c +++ b/hw/misc/macio/cuda.c @@ -571,7 +571,7 @@ static void cuda_class_init(ObjectClass *oc, void *data) dc->realize = cuda_realize; dc->reset = cuda_reset; dc->vmsd = &vmstate_cuda; - dc->props = cuda_properties; + device_class_set_props(dc, cuda_properties); set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); } diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c index 50f20d8..7922219 100644 --- a/hw/misc/macio/macio.c +++ b/hw/misc/macio/macio.c @@ -466,7 +466,7 @@ static void macio_newworld_class_init(ObjectClass *oc, void *data) pdc->realize = macio_newworld_realize; pdc->device_id = PCI_DEVICE_ID_APPLE_UNI_N_KEYL; dc->vmsd = &vmstate_macio_newworld; - dc->props = macio_newworld_properties; + device_class_set_props(dc, macio_newworld_properties); } static Property macio_properties[] = { @@ -481,7 +481,7 @@ static void macio_class_init(ObjectClass *klass, void *data) k->vendor_id = PCI_VENDOR_ID_APPLE; k->class_id = PCI_CLASS_OTHERS << 8; - dc->props = macio_properties; + device_class_set_props(dc, macio_properties); set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); /* Reason: Uses serial_hds in macio_instance_init */ dc->user_creatable = false; diff --git a/hw/misc/macio/pmu.c b/hw/misc/macio/pmu.c index 769aed8..b8466a4 100644 --- a/hw/misc/macio/pmu.c +++ b/hw/misc/macio/pmu.c @@ -795,7 +795,7 @@ static void pmu_class_init(ObjectClass *oc, void *data) dc->realize = pmu_realize; dc->reset = pmu_reset; dc->vmsd = &vmstate_pmu; - dc->props = pmu_properties; + device_class_set_props(dc, pmu_properties); set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); } diff --git a/hw/misc/mips_cmgcr.c b/hw/misc/mips_cmgcr.c index 8176d91..3c8b37f 100644 --- a/hw/misc/mips_cmgcr.c +++ b/hw/misc/mips_cmgcr.c @@ -233,7 +233,7 @@ static void mips_gcr_realize(DeviceState *dev, Error **errp) static void mips_gcr_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = mips_gcr_properties; + device_class_set_props(dc, mips_gcr_properties); dc->vmsd = &vmstate_mips_gcr; dc->reset = mips_gcr_reset; dc->realize = mips_gcr_realize; diff --git a/hw/misc/mips_cpc.c b/hw/misc/mips_cpc.c index 19ea016..2f7b2c9 100644 --- a/hw/misc/mips_cpc.c +++ b/hw/misc/mips_cpc.c @@ -175,7 +175,7 @@ static void mips_cpc_class_init(ObjectClass *klass, void *data) dc->realize = mips_cpc_realize; dc->reset = mips_cpc_reset; dc->vmsd = &vmstate_mips_cpc; - dc->props = mips_cpc_properties; + device_class_set_props(dc, mips_cpc_properties); } static const TypeInfo mips_cpc_info = { diff --git a/hw/misc/mips_itu.c b/hw/misc/mips_itu.c index ea0cf97..3540985 100644 --- a/hw/misc/mips_itu.c +++ b/hw/misc/mips_itu.c @@ -561,7 +561,7 @@ static void mips_itu_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = mips_itu_properties; + device_class_set_props(dc, mips_itu_properties); dc->realize = mips_itu_realize; dc->reset = mips_itu_reset; } diff --git a/hw/misc/mos6522.c b/hw/misc/mos6522.c index 10b85bf..19e154b 100644 --- a/hw/misc/mos6522.c +++ b/hw/misc/mos6522.c @@ -502,7 +502,7 @@ static void mos6522_class_init(ObjectClass *oc, void *data) dc->reset = mos6522_reset; dc->vmsd = &vmstate_mos6522; - dc->props = mos6522_properties; + device_class_set_props(dc, mos6522_properties); mdc->parent_reset = dc->reset; mdc->set_sr_int = mos6522_set_sr_int; mdc->portB_write = mos6522_portB_write; diff --git a/hw/misc/mps2-fpgaio.c b/hw/misc/mps2-fpgaio.c index 5e8b103..2f3fbee 100644 --- a/hw/misc/mps2-fpgaio.c +++ b/hw/misc/mps2-fpgaio.c @@ -300,7 +300,7 @@ static void mps2_fpgaio_class_init(ObjectClass *klass, void *data) dc->vmsd = &mps2_fpgaio_vmstate; dc->reset = mps2_fpgaio_reset; - dc->props = mps2_fpgaio_properties; + device_class_set_props(dc, mps2_fpgaio_properties); } static const TypeInfo mps2_fpgaio_info = { diff --git a/hw/misc/mps2-scc.c b/hw/misc/mps2-scc.c index 25779a1..9d0909e 100644 --- a/hw/misc/mps2-scc.c +++ b/hw/misc/mps2-scc.c @@ -293,7 +293,7 @@ static void mps2_scc_class_init(ObjectClass *klass, void *data) dc->realize = mps2_scc_realize; dc->vmsd = &mps2_scc_vmstate; dc->reset = mps2_scc_reset; - dc->props = mps2_scc_properties; + device_class_set_props(dc, mps2_scc_properties); } static const TypeInfo mps2_scc_info = { diff --git a/hw/misc/msf2-sysreg.c b/hw/misc/msf2-sysreg.c index ddc5a30..2dce55c 100644 --- a/hw/misc/msf2-sysreg.c +++ b/hw/misc/msf2-sysreg.c @@ -143,7 +143,7 @@ static void msf2_sysreg_class_init(ObjectClass *klass, void *data) dc->vmsd = &vmstate_msf2_sysreg; dc->reset = msf2_sysreg_reset; - dc->props = msf2_sysreg_properties; + device_class_set_props(dc, msf2_sysreg_properties); dc->realize = msf2_sysreg_realize; } diff --git a/hw/misc/nrf51_rng.c b/hw/misc/nrf51_rng.c index 5140981..fc86e1b 100644 --- a/hw/misc/nrf51_rng.c +++ b/hw/misc/nrf51_rng.c @@ -245,7 +245,7 @@ static void nrf51_rng_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = nrf51_rng_properties; + device_class_set_props(dc, nrf51_rng_properties); dc->vmsd = &vmstate_rng; dc->reset = nrf51_rng_reset; } diff --git a/hw/misc/pci-testdev.c b/hw/misc/pci-testdev.c index 74d8571..188de4d 100644 --- a/hw/misc/pci-testdev.c +++ b/hw/misc/pci-testdev.c @@ -339,7 +339,7 @@ static void pci_testdev_class_init(ObjectClass *klass, void *data) dc->desc = "PCI Test Device"; set_bit(DEVICE_CATEGORY_MISC, dc->categories); dc->reset = qdev_pci_testdev_reset; - dc->props = pci_testdev_properties; + device_class_set_props(dc, pci_testdev_properties); } static const TypeInfo pci_testdev_info = { diff --git a/hw/misc/pvpanic.c b/hw/misc/pvpanic.c index 4ebda78..abb10bb 100644 --- a/hw/misc/pvpanic.c +++ b/hw/misc/pvpanic.c @@ -118,7 +118,7 @@ static void pvpanic_isa_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = pvpanic_isa_realizefn; - dc->props = pvpanic_isa_properties; + device_class_set_props(dc, pvpanic_isa_properties); set_bit(DEVICE_CATEGORY_MISC, dc->categories); } diff --git a/hw/misc/tz-mpc.c b/hw/misc/tz-mpc.c index 49dd605..98f1512 100644 --- a/hw/misc/tz-mpc.c +++ b/hw/misc/tz-mpc.c @@ -596,7 +596,7 @@ static void tz_mpc_class_init(ObjectClass *klass, void *data) dc->realize = tz_mpc_realize; dc->vmsd = &tz_mpc_vmstate; dc->reset = tz_mpc_reset; - dc->props = tz_mpc_properties; + device_class_set_props(dc, tz_mpc_properties); } static const TypeInfo tz_mpc_info = { diff --git a/hw/misc/tz-msc.c b/hw/misc/tz-msc.c index 7d522ac..acbe944 100644 --- a/hw/misc/tz-msc.c +++ b/hw/misc/tz-msc.c @@ -293,7 +293,7 @@ static void tz_msc_class_init(ObjectClass *klass, void *data) dc->realize = tz_msc_realize; dc->vmsd = &tz_msc_vmstate; dc->reset = tz_msc_reset; - dc->props = tz_msc_properties; + device_class_set_props(dc, tz_msc_properties); } static const TypeInfo tz_msc_info = { diff --git a/hw/misc/tz-ppc.c b/hw/misc/tz-ppc.c index 181a5f1..6431257 100644 --- a/hw/misc/tz-ppc.c +++ b/hw/misc/tz-ppc.c @@ -319,7 +319,7 @@ static void tz_ppc_class_init(ObjectClass *klass, void *data) dc->realize = tz_ppc_realize; dc->vmsd = &tz_ppc_vmstate; dc->reset = tz_ppc_reset; - dc->props = tz_ppc_properties; + device_class_set_props(dc, tz_ppc_properties); } static const TypeInfo tz_ppc_info = { diff --git a/hw/misc/unimp.c b/hw/misc/unimp.c index 0e1cb24..bc4084d 100644 --- a/hw/misc/unimp.c +++ b/hw/misc/unimp.c @@ -79,7 +79,7 @@ static void unimp_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = unimp_realize; - dc->props = unimp_properties; + device_class_set_props(dc, unimp_properties); } static const TypeInfo unimp_info = { diff --git a/hw/net/allwinner_emac.c b/hw/net/allwinner_emac.c index e055a66..e9bbff8 100644 --- a/hw/net/allwinner_emac.c +++ b/hw/net/allwinner_emac.c @@ -519,7 +519,7 @@ static void aw_emac_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = aw_emac_realize; - dc->props = aw_emac_properties; + device_class_set_props(dc, aw_emac_properties); dc->reset = aw_emac_reset; dc->vmsd = &vmstate_aw_emac; } diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index b8be73d..871fcf2 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -1627,7 +1627,7 @@ static void gem_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = gem_realize; - dc->props = gem_properties; + device_class_set_props(dc, gem_properties); dc->vmsd = &vmstate_cadence_gem; dc->reset = gem_reset; } diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c index cdc2631..a134d43 100644 --- a/hw/net/dp8393x.c +++ b/hw/net/dp8393x.c @@ -963,7 +963,7 @@ static void dp8393x_class_init(ObjectClass *klass, void *data) dc->realize = dp8393x_realize; dc->reset = dp8393x_reset; dc->vmsd = &vmstate_dp8393x; - dc->props = dp8393x_properties; + device_class_set_props(dc, dp8393x_properties); } static const TypeInfo dp8393x_info = { diff --git a/hw/net/e1000.c b/hw/net/e1000.c index a73f8d4..0b833d5 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c @@ -1764,7 +1764,7 @@ static void e1000_class_init(ObjectClass *klass, void *data) dc->desc = "Intel Gigabit Ethernet"; dc->reset = qdev_e1000_reset; dc->vmsd = &vmstate_e1000; - dc->props = e1000_properties; + device_class_set_props(dc, e1000_properties); } static void e1000_instance_init(Object *obj) diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c index b69fd7d..a91dbdc 100644 --- a/hw/net/e1000e.c +++ b/hw/net/e1000e.c @@ -684,7 +684,6 @@ static void e1000e_class_init(ObjectClass *class, void *data) dc->desc = "Intel 82574L GbE Controller"; dc->reset = e1000e_qdev_reset; dc->vmsd = &e1000e_vmstate; - dc->props = e1000e_properties; e1000e_prop_disable_vnet = qdev_prop_uint8; e1000e_prop_disable_vnet.description = "Do not use virtio headers, " @@ -697,6 +696,7 @@ static void e1000e_class_init(ObjectClass *class, void *data) e1000e_prop_subsys = qdev_prop_uint16; e1000e_prop_subsys.description = "PCI device Subsystem ID"; + device_class_set_props(dc, e1000e_properties); set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); } diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c index 6cc9776..f6474f0 100644 --- a/hw/net/eepro100.c +++ b/hw/net/eepro100.c @@ -2060,7 +2060,7 @@ static void eepro100_class_init(ObjectClass *klass, void *data) info = eepro100_get_class_by_name(object_class_get_name(klass)); set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); - dc->props = e100_properties; + device_class_set_props(dc, e100_properties); dc->desc = info->desc; k->vendor_id = PCI_VENDOR_ID_INTEL; k->class_id = PCI_CLASS_NETWORK_ETHERNET; diff --git a/hw/net/etraxfs_eth.c b/hw/net/etraxfs_eth.c index f30d963..27fd069 100644 --- a/hw/net/etraxfs_eth.c +++ b/hw/net/etraxfs_eth.c @@ -639,7 +639,7 @@ static void etraxfs_eth_class_init(ObjectClass *klass, void *data) dc->realize = etraxfs_eth_realize; dc->reset = etraxfs_eth_reset; - dc->props = etraxfs_eth_properties; + device_class_set_props(dc, etraxfs_eth_properties); /* Reason: dma_out, dma_in are not user settable */ dc->user_creatable = false; } diff --git a/hw/net/fsl_etsec/etsec.c b/hw/net/fsl_etsec/etsec.c index 717de76..475f3c8 100644 --- a/hw/net/fsl_etsec/etsec.c +++ b/hw/net/fsl_etsec/etsec.c @@ -423,7 +423,7 @@ static void etsec_class_init(ObjectClass *klass, void *data) dc->realize = etsec_realize; dc->reset = etsec_reset; - dc->props = etsec_properties; + device_class_set_props(dc, etsec_properties); /* Supported by ppce500 machine */ dc->user_creatable = true; } diff --git a/hw/net/ftgmac100.c b/hw/net/ftgmac100.c index 86ac258..4ad2594 100644 --- a/hw/net/ftgmac100.c +++ b/hw/net/ftgmac100.c @@ -1075,7 +1075,7 @@ static void ftgmac100_class_init(ObjectClass *klass, void *data) dc->vmsd = &vmstate_ftgmac100; dc->reset = ftgmac100_reset; - dc->props = ftgmac100_properties; + device_class_set_props(dc, ftgmac100_properties); set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); dc->realize = ftgmac100_realize; dc->desc = "Faraday FTGMAC100 Gigabit Ethernet emulation"; @@ -1237,7 +1237,7 @@ static void aspeed_mii_class_init(ObjectClass *klass, void *data) dc->reset = aspeed_mii_reset; dc->realize = aspeed_mii_realize; dc->desc = "Aspeed MII controller"; - dc->props = aspeed_mii_properties; + device_class_set_props(dc, aspeed_mii_properties); } static const TypeInfo aspeed_mii_info = { diff --git a/hw/net/imx_fec.c b/hw/net/imx_fec.c index 5a83678..6a124a1 100644 --- a/hw/net/imx_fec.c +++ b/hw/net/imx_fec.c @@ -1338,7 +1338,7 @@ static void imx_eth_class_init(ObjectClass *klass, void *data) dc->vmsd = &vmstate_imx_eth; dc->reset = imx_eth_reset; - dc->props = imx_eth_properties; + device_class_set_props(dc, imx_eth_properties); dc->realize = imx_eth_realize; dc->desc = "i.MX FEC/ENET Ethernet Controller"; } diff --git a/hw/net/lan9118.c b/hw/net/lan9118.c index ed551f2..da7e0bb 100644 --- a/hw/net/lan9118.c +++ b/hw/net/lan9118.c @@ -1369,7 +1369,7 @@ static void lan9118_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->reset = lan9118_reset; - dc->props = lan9118_properties; + device_class_set_props(dc, lan9118_properties); dc->vmsd = &vmstate_lan9118; dc->realize = lan9118_realize; } diff --git a/hw/net/lance.c b/hw/net/lance.c index 4d96299..688724d 100644 --- a/hw/net/lance.c +++ b/hw/net/lance.c @@ -153,7 +153,7 @@ static void lance_class_init(ObjectClass *klass, void *data) dc->fw_name = "ethernet"; dc->reset = lance_reset; dc->vmsd = &vmstate_lance; - dc->props = lance_properties; + device_class_set_props(dc, lance_properties); } static const TypeInfo lance_info = { diff --git a/hw/net/mcf_fec.c b/hw/net/mcf_fec.c index 8fcf354..9327ac8 100644 --- a/hw/net/mcf_fec.c +++ b/hw/net/mcf_fec.c @@ -670,7 +670,7 @@ static void mcf_fec_class_init(ObjectClass *oc, void *data) dc->realize = mcf_fec_realize; dc->desc = "MCF Fast Ethernet Controller network device"; dc->reset = mcf_fec_reset; - dc->props = mcf_fec_properties; + device_class_set_props(dc, mcf_fec_properties); } static const TypeInfo mcf_fec_info = { diff --git a/hw/net/milkymist-minimac2.c b/hw/net/milkymist-minimac2.c index 86b6d28..1ba0175 100644 --- a/hw/net/milkymist-minimac2.c +++ b/hw/net/milkymist-minimac2.c @@ -530,7 +530,7 @@ static void milkymist_minimac2_class_init(ObjectClass *klass, void *data) dc->realize = milkymist_minimac2_realize; dc->reset = milkymist_minimac2_reset; dc->vmsd = &vmstate_milkymist_minimac2; - dc->props = milkymist_minimac2_properties; + device_class_set_props(dc, milkymist_minimac2_properties); } static const TypeInfo milkymist_minimac2_info = { diff --git a/hw/net/mipsnet.c b/hw/net/mipsnet.c index 380ff5a..0c578c4 100644 --- a/hw/net/mipsnet.c +++ b/hw/net/mipsnet.c @@ -278,7 +278,7 @@ static void mipsnet_class_init(ObjectClass *klass, void *data) dc->desc = "MIPS Simulator network device"; dc->reset = mipsnet_sysbus_reset; dc->vmsd = &vmstate_mipsnet; - dc->props = mipsnet_properties; + device_class_set_props(dc, mipsnet_properties); } static const TypeInfo mipsnet_info = { diff --git a/hw/net/ne2000-isa.c b/hw/net/ne2000-isa.c index 6fcf3d5..e744eff 100644 --- a/hw/net/ne2000-isa.c +++ b/hw/net/ne2000-isa.c @@ -89,7 +89,7 @@ static void isa_ne2000_class_initfn(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = isa_ne2000_realizefn; - dc->props = ne2000_isa_properties; + device_class_set_props(dc, ne2000_isa_properties); dc->vmsd = &vmstate_isa_ne2000; set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); } diff --git a/hw/net/ne2000-pci.c b/hw/net/ne2000-pci.c index 9a20d42..e11d67b 100644 --- a/hw/net/ne2000-pci.c +++ b/hw/net/ne2000-pci.c @@ -112,7 +112,7 @@ static void ne2000_class_init(ObjectClass *klass, void *data) k->device_id = PCI_DEVICE_ID_REALTEK_8029; k->class_id = PCI_CLASS_NETWORK_ETHERNET; dc->vmsd = &vmstate_pci_ne2000; - dc->props = ne2000_properties; + device_class_set_props(dc, ne2000_properties); set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); } diff --git a/hw/net/opencores_eth.c b/hw/net/opencores_eth.c index 84a95da..6b338c2 100644 --- a/hw/net/opencores_eth.c +++ b/hw/net/opencores_eth.c @@ -755,7 +755,7 @@ static void open_eth_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); dc->desc = "Opencores 10/100 Mbit Ethernet"; dc->reset = qdev_open_eth_reset; - dc->props = open_eth_properties; + device_class_set_props(dc, open_eth_properties); } static const TypeInfo open_eth_info = { diff --git a/hw/net/pcnet-pci.c b/hw/net/pcnet-pci.c index d067d21..d1f31e0 100644 --- a/hw/net/pcnet-pci.c +++ b/hw/net/pcnet-pci.c @@ -272,7 +272,7 @@ static void pcnet_class_init(ObjectClass *klass, void *data) k->class_id = PCI_CLASS_NETWORK_ETHERNET; dc->reset = pci_reset; dc->vmsd = &vmstate_pci_pcnet; - dc->props = pcnet_properties; + device_class_set_props(dc, pcnet_properties); set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); } diff --git a/hw/net/rocker/rocker.c b/hw/net/rocker/rocker.c index 50f9e33..81dd3b5 100644 --- a/hw/net/rocker/rocker.c +++ b/hw/net/rocker/rocker.c @@ -1519,7 +1519,7 @@ static void rocker_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); dc->desc = "Rocker Switch"; dc->reset = rocker_reset; - dc->props = rocker_properties; + device_class_set_props(dc, rocker_properties); dc->vmsd = &rocker_vmsd; } diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c index 88a97d7..ae4739b 100644 --- a/hw/net/rtl8139.c +++ b/hw/net/rtl8139.c @@ -3435,7 +3435,7 @@ static void rtl8139_class_init(ObjectClass *klass, void *data) k->class_id = PCI_CLASS_NETWORK_ETHERNET; dc->reset = rtl8139_reset; dc->vmsd = &vmstate_rtl8139; - dc->props = rtl8139_properties; + device_class_set_props(dc, rtl8139_properties); set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); } diff --git a/hw/net/smc91c111.c b/hw/net/smc91c111.c index e574635..e9eb6f6 100644 --- a/hw/net/smc91c111.c +++ b/hw/net/smc91c111.c @@ -798,7 +798,7 @@ static void smc91c111_class_init(ObjectClass *klass, void *data) dc->realize = smc91c111_realize; dc->reset = smc91c111_reset; dc->vmsd = &vmstate_smc91c111; - dc->props = smc91c111_properties; + device_class_set_props(dc, smc91c111_properties); } static const TypeInfo smc91c111_info = { diff --git a/hw/net/spapr_llan.c b/hw/net/spapr_llan.c index 3d96884..80f5a1d 100644 --- a/hw/net/spapr_llan.c +++ b/hw/net/spapr_llan.c @@ -856,7 +856,7 @@ static void spapr_vlan_class_init(ObjectClass *klass, void *data) k->dt_compatible = "IBM,l-lan"; k->signal_mask = 0x1; set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); - dc->props = spapr_vlan_properties; + device_class_set_props(dc, spapr_vlan_properties); k->rtce_window_size = 0x10000000; dc->vmsd = &vmstate_spapr_llan; } diff --git a/hw/net/stellaris_enet.c b/hw/net/stellaris_enet.c index 3aca2a0..cb6e250 100644 --- a/hw/net/stellaris_enet.c +++ b/hw/net/stellaris_enet.c @@ -507,7 +507,7 @@ static void stellaris_enet_class_init(ObjectClass *klass, void *data) dc->realize = stellaris_enet_realize; dc->reset = stellaris_enet_reset; - dc->props = stellaris_enet_properties; + device_class_set_props(dc, stellaris_enet_properties); dc->vmsd = &vmstate_stellaris_enet; } diff --git a/hw/net/sungem.c b/hw/net/sungem.c index f31d41a..89da51f 100644 --- a/hw/net/sungem.c +++ b/hw/net/sungem.c @@ -1429,7 +1429,7 @@ static void sungem_class_init(ObjectClass *klass, void *data) k->class_id = PCI_CLASS_NETWORK_ETHERNET; dc->vmsd = &vmstate_sungem; dc->reset = sungem_reset; - dc->props = sungem_properties; + device_class_set_props(dc, sungem_properties); set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); } diff --git a/hw/net/sunhme.c b/hw/net/sunhme.c index 2243b7c..8863601 100644 --- a/hw/net/sunhme.c +++ b/hw/net/sunhme.c @@ -958,7 +958,7 @@ static void sunhme_class_init(ObjectClass *klass, void *data) k->class_id = PCI_CLASS_NETWORK_ETHERNET; dc->vmsd = &vmstate_hme; dc->reset = sunhme_reset; - dc->props = sunhme_properties; + device_class_set_props(dc, sunhme_properties); set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); } diff --git a/hw/net/tulip.c b/hw/net/tulip.c index f85f543..cfac271 100644 --- a/hw/net/tulip.c +++ b/hw/net/tulip.c @@ -1004,7 +1004,7 @@ static void tulip_class_init(ObjectClass *klass, void *data) k->subsystem_id = 0x104f; k->class_id = PCI_CLASS_NETWORK_ETHERNET; dc->vmsd = &vmstate_pci_tulip; - dc->props = tulip_properties; + device_class_set_props(dc, tulip_properties); dc->reset = tulip_qdev_reset; set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); } diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index d7d3ad6..3627bb1 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -3236,7 +3236,7 @@ static void virtio_net_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); - dc->props = virtio_net_properties; + device_class_set_props(dc, virtio_net_properties); dc->vmsd = &vmstate_virtio_net; set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); vdc->realize = virtio_net_device_realize; diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c index 39ff662..6d91cd8 100644 --- a/hw/net/vmxnet3.c +++ b/hw/net/vmxnet3.c @@ -2506,7 +2506,7 @@ static void vmxnet3_class_init(ObjectClass *class, void *data) dc->desc = "VMWare Paravirtualized Ethernet v3"; dc->reset = vmxnet3_qdev_reset; dc->vmsd = &vmstate_vmxnet3; - dc->props = vmxnet3_properties; + device_class_set_props(dc, vmxnet3_properties); set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); } diff --git a/hw/net/xgmac.c b/hw/net/xgmac.c index 2ea8d2e..574dd47 100644 --- a/hw/net/xgmac.c +++ b/hw/net/xgmac.c @@ -414,7 +414,7 @@ static void xgmac_enet_class_init(ObjectClass *klass, void *data) dc->realize = xgmac_enet_realize; dc->vmsd = &vmstate_xgmac; - dc->props = xgmac_properties; + device_class_set_props(dc, xgmac_properties); } static const TypeInfo xgmac_enet_info = { diff --git a/hw/net/xilinx_axienet.c b/hw/net/xilinx_axienet.c index 2c8c065..7047888 100644 --- a/hw/net/xilinx_axienet.c +++ b/hw/net/xilinx_axienet.c @@ -1025,7 +1025,7 @@ static void xilinx_enet_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = xilinx_enet_realize; - dc->props = xilinx_enet_properties; + device_class_set_props(dc, xilinx_enet_properties); dc->reset = xilinx_axienet_reset; } diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c index 384e72b..cf07e69 100644 --- a/hw/net/xilinx_ethlite.c +++ b/hw/net/xilinx_ethlite.c @@ -262,7 +262,7 @@ static void xilinx_ethlite_class_init(ObjectClass *klass, void *data) dc->realize = xilinx_ethlite_realize; dc->reset = xilinx_ethlite_reset; - dc->props = xilinx_ethlite_properties; + device_class_set_props(dc, xilinx_ethlite_properties); } static const TypeInfo xilinx_ethlite_info = { diff --git a/hw/nvram/ds1225y.c b/hw/nvram/ds1225y.c index 934e09b..d5cb922 100644 --- a/hw/nvram/ds1225y.c +++ b/hw/nvram/ds1225y.c @@ -153,7 +153,7 @@ static void nvram_sysbus_class_init(ObjectClass *klass, void *data) dc->realize = nvram_sysbus_realize; dc->vmsd = &vmstate_nvram; - dc->props = nvram_sysbus_properties; + device_class_set_props(dc, nvram_sysbus_properties); } static const TypeInfo nvram_sysbus_info = { diff --git a/hw/nvram/eeprom_at24c.c b/hw/nvram/eeprom_at24c.c index 3416367..d46a2be 100644 --- a/hw/nvram/eeprom_at24c.c +++ b/hw/nvram/eeprom_at24c.c @@ -182,7 +182,7 @@ void at24c_eeprom_class_init(ObjectClass *klass, void *data) k->recv = &at24c_eeprom_recv; k->send = &at24c_eeprom_send; - dc->props = at24c_eeprom_props; + device_class_set_props(dc, at24c_eeprom_props); dc->reset = at24c_eeprom_reset; } diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index 5d879c4..179b302 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -1171,7 +1171,7 @@ static void fw_cfg_io_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = fw_cfg_io_realize; - dc->props = fw_cfg_io_properties; + device_class_set_props(dc, fw_cfg_io_properties); } static const TypeInfo fw_cfg_io_info = { @@ -1234,7 +1234,7 @@ static void fw_cfg_mem_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = fw_cfg_mem_realize; - dc->props = fw_cfg_mem_properties; + device_class_set_props(dc, fw_cfg_mem_properties); } static const TypeInfo fw_cfg_mem_info = { diff --git a/hw/nvram/mac_nvram.c b/hw/nvram/mac_nvram.c index 9a47e35..2e8a1e3 100644 --- a/hw/nvram/mac_nvram.c +++ b/hw/nvram/mac_nvram.c @@ -128,7 +128,7 @@ static void macio_nvram_class_init(ObjectClass *oc, void *data) dc->unrealize = macio_nvram_unrealizefn; dc->reset = macio_nvram_reset; dc->vmsd = &vmstate_macio_nvram; - dc->props = macio_nvram_properties; + device_class_set_props(dc, macio_nvram_properties); set_bit(DEVICE_CATEGORY_MISC, dc->categories); } diff --git a/hw/nvram/nrf51_nvm.c b/hw/nvram/nrf51_nvm.c index 4d678f9..f2283c1 100644 --- a/hw/nvram/nrf51_nvm.c +++ b/hw/nvram/nrf51_nvm.c @@ -369,7 +369,7 @@ static void nrf51_nvm_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = nrf51_nvm_properties; + device_class_set_props(dc, nrf51_nvm_properties); dc->vmsd = &vmstate_nvm; dc->realize = nrf51_nvm_realize; dc->reset = nrf51_nvm_reset; diff --git a/hw/nvram/spapr_nvram.c b/hw/nvram/spapr_nvram.c index 838082b..877ddef 100644 --- a/hw/nvram/spapr_nvram.c +++ b/hw/nvram/spapr_nvram.c @@ -269,7 +269,7 @@ static void spapr_nvram_class_init(ObjectClass *klass, void *data) k->dt_type = "nvram"; k->dt_compatible = "qemu,spapr-nvram"; set_bit(DEVICE_CATEGORY_MISC, dc->categories); - dc->props = spapr_nvram_properties; + device_class_set_props(dc, spapr_nvram_properties); dc->vmsd = &vmstate_spapr_nvram; /* Reason: Internal device only, uses spapr_rtas_register() in realize() */ dc->user_creatable = false; diff --git a/hw/pci-bridge/gen_pcie_root_port.c b/hw/pci-bridge/gen_pcie_root_port.c index 9eaefeb..bb26e27 100644 --- a/hw/pci-bridge/gen_pcie_root_port.c +++ b/hw/pci-bridge/gen_pcie_root_port.c @@ -147,7 +147,7 @@ static void gen_rp_dev_class_init(ObjectClass *klass, void *data) k->device_id = PCI_DEVICE_ID_REDHAT_PCIE_RP; dc->desc = "PCI Express Root Port"; dc->vmsd = &vmstate_rp_dev; - dc->props = gen_rp_props; + device_class_set_props(dc, gen_rp_props); device_class_set_parent_realize(dc, gen_rp_realize, &rpc->parent_realize); diff --git a/hw/pci-bridge/pci_bridge_dev.c b/hw/pci-bridge/pci_bridge_dev.c index cc80cb4..4a080b7 100644 --- a/hw/pci-bridge/pci_bridge_dev.c +++ b/hw/pci-bridge/pci_bridge_dev.c @@ -258,7 +258,7 @@ static void pci_bridge_dev_class_init(ObjectClass *klass, void *data) k->is_bridge = true; dc->desc = "Standard PCI Bridge"; dc->reset = qdev_pci_bridge_dev_reset; - dc->props = pci_bridge_dev_properties; + device_class_set_props(dc, pci_bridge_dev_properties); dc->vmsd = &pci_bridge_dev_vmstate; set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); hc->plug = pci_bridge_dev_plug_cb; diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expander_bridge.c index 0592818..47aaaf8 100644 --- a/hw/pci-bridge/pci_expander_bridge.c +++ b/hw/pci-bridge/pci_expander_bridge.c @@ -309,7 +309,7 @@ static void pxb_dev_class_init(ObjectClass *klass, void *data) k->class_id = PCI_CLASS_BRIDGE_HOST; dc->desc = "PCI Expander Bridge"; - dc->props = pxb_dev_properties; + device_class_set_props(dc, pxb_dev_properties); dc->hotpluggable = false; set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); } @@ -347,7 +347,7 @@ static void pxb_pcie_dev_class_init(ObjectClass *klass, void *data) k->class_id = PCI_CLASS_BRIDGE_HOST; dc->desc = "PCI Express Expander Bridge"; - dc->props = pxb_dev_properties; + device_class_set_props(dc, pxb_dev_properties); dc->hotpluggable = false; set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); } diff --git a/hw/pci-bridge/pcie_pci_bridge.c b/hw/pci-bridge/pcie_pci_bridge.c index 7679bef..eade133 100644 --- a/hw/pci-bridge/pcie_pci_bridge.c +++ b/hw/pci-bridge/pcie_pci_bridge.c @@ -152,7 +152,7 @@ static void pcie_pci_bridge_class_init(ObjectClass *klass, void *data) k->exit = pcie_pci_bridge_exit; k->config_write = pcie_pci_bridge_write_config; dc->vmsd = &pcie_pci_bridge_dev_vmstate; - dc->props = pcie_pci_bridge_dev_properties; + device_class_set_props(dc, pcie_pci_bridge_dev_properties); dc->reset = &pcie_pci_bridge_reset; set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); hc->plug = pci_bridge_dev_plug_cb; diff --git a/hw/pci-bridge/pcie_root_port.c b/hw/pci-bridge/pcie_root_port.c index 012c2cb..0ba4e4d 100644 --- a/hw/pci-bridge/pcie_root_port.c +++ b/hw/pci-bridge/pcie_root_port.c @@ -174,7 +174,7 @@ static void rp_class_init(ObjectClass *klass, void *data) k->exit = rp_exit; set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); dc->reset = rp_reset; - dc->props = rp_props; + device_class_set_props(dc, rp_props); } static const TypeInfo rp_info = { diff --git a/hw/pci-bridge/xio3130_downstream.c b/hw/pci-bridge/xio3130_downstream.c index a9f084b..153a4ac 100644 --- a/hw/pci-bridge/xio3130_downstream.c +++ b/hw/pci-bridge/xio3130_downstream.c @@ -169,7 +169,7 @@ static void xio3130_downstream_class_init(ObjectClass *klass, void *data) dc->desc = "TI X3130 Downstream Port of PCI Express Switch"; dc->reset = xio3130_downstream_reset; dc->vmsd = &vmstate_xio3130_downstream; - dc->props = xio3130_downstream_props; + device_class_set_props(dc, xio3130_downstream_props); } static const TypeInfo xio3130_downstream_info = { diff --git a/hw/pci-host/grackle.c b/hw/pci-host/grackle.c index 537273e..24ccdf6 100644 --- a/hw/pci-host/grackle.c +++ b/hw/pci-host/grackle.c @@ -168,7 +168,7 @@ static void grackle_class_init(ObjectClass *klass, void *data) SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass); dc->realize = grackle_realize; - dc->props = grackle_properties; + device_class_set_props(dc, grackle_properties); set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); dc->fw_name = "pci"; sbc->explicit_ofw_unit_address = grackle_ofw_unit_address; diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index bae7b42..11050a0 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -396,7 +396,7 @@ static void i440fx_pcihost_class_init(ObjectClass *klass, void *data) hc->root_bus_path = i440fx_pcihost_root_bus_path; dc->realize = i440fx_pcihost_realize; dc->fw_name = "pci"; - dc->props = i440fx_props; + device_class_set_props(dc, i440fx_props); /* Reason: needs to be wired up by pc_init1 */ dc->user_creatable = false; } diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c index 8bed8e8..d710727 100644 --- a/hw/pci-host/ppce500.c +++ b/hw/pci-host/ppce500.c @@ -531,7 +531,7 @@ static void e500_pcihost_class_init(ObjectClass *klass, void *data) dc->realize = e500_pcihost_realize; set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); - dc->props = pcihost_properties; + device_class_set_props(dc, pcihost_properties); dc->vmsd = &vmstate_ppce500_pci; } diff --git a/hw/pci-host/prep.c b/hw/pci-host/prep.c index afa136d..f2f8821 100644 --- a/hw/pci-host/prep.c +++ b/hw/pci-host/prep.c @@ -415,7 +415,7 @@ static void raven_pcihost_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); dc->realize = raven_pcihost_realizefn; - dc->props = raven_pcihost_properties; + device_class_set_props(dc, raven_pcihost_properties); dc->fw_name = "pci"; } diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index 158d270..0d5dbba 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -202,7 +202,7 @@ static void q35_host_class_init(ObjectClass *klass, void *data) hc->root_bus_path = q35_host_root_bus_path; dc->realize = q35_host_realize; - dc->props = q35_host_props; + device_class_set_props(dc, q35_host_props); /* Reason: needs to be wired up by pc_q35_init */ dc->user_creatable = false; set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); @@ -612,7 +612,7 @@ static void mch_class_init(ObjectClass *klass, void *data) k->realize = mch_realize; k->config_write = mch_write_config; dc->reset = mch_reset; - dc->props = mch_props; + device_class_set_props(dc, mch_props); set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); dc->desc = "Host bridge"; dc->vmsd = &vmstate_mch; diff --git a/hw/pci-host/sabre.c b/hw/pci-host/sabre.c index fae20ee..2b8503b 100644 --- a/hw/pci-host/sabre.c +++ b/hw/pci-host/sabre.c @@ -521,7 +521,7 @@ static void sabre_class_init(ObjectClass *klass, void *data) dc->realize = sabre_realize; dc->reset = sabre_reset; - dc->props = sabre_properties; + device_class_set_props(dc, sabre_properties); set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); dc->fw_name = "pci"; sbc->explicit_ofw_unit_address = sabre_ofw_unit_address; diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c index 75bc506..cf70b76 100644 --- a/hw/pci-host/uninorth.c +++ b/hw/pci-host/uninorth.c @@ -476,7 +476,7 @@ static void pci_unin_main_class_init(ObjectClass *klass, void *data) SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass); dc->realize = pci_unin_main_realize; - dc->props = pci_unin_main_pci_host_props; + device_class_set_props(dc, pci_unin_main_pci_host_props); set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); dc->fw_name = "pci"; sbc->explicit_ofw_unit_address = pci_unin_main_ofw_unit_address; diff --git a/hw/pci-host/versatile.c b/hw/pci-host/versatile.c index b731d05..cfb9a78 100644 --- a/hw/pci-host/versatile.c +++ b/hw/pci-host/versatile.c @@ -509,7 +509,7 @@ static void pci_vpb_class_init(ObjectClass *klass, void *data) dc->realize = pci_vpb_realize; dc->reset = pci_vpb_reset; dc->vmsd = &pci_vpb_vmstate; - dc->props = pci_vpb_properties; + device_class_set_props(dc, pci_vpb_properties); } static const TypeInfo pci_vpb_info = { diff --git a/hw/pci-host/xilinx-pcie.c b/hw/pci-host/xilinx-pcie.c index 17d5024..e06f2b5 100644 --- a/hw/pci-host/xilinx-pcie.c +++ b/hw/pci-host/xilinx-pcie.c @@ -177,7 +177,7 @@ static void xilinx_pcie_host_class_init(ObjectClass *klass, void *data) dc->realize = xilinx_pcie_host_realize; set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); dc->fw_name = "pci"; - dc->props = xilinx_pcie_host_props; + device_class_set_props(dc, xilinx_pcie_host_props); } static const TypeInfo xilinx_pcie_host_info = { diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 3ac7961..e1ed667 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2624,7 +2624,7 @@ static void pci_device_class_init(ObjectClass *klass, void *data) k->realize = pci_qdev_realize; k->unrealize = pci_qdev_unrealize; k->bus_type = TYPE_PCI_BUS; - k->props = pci_props; + device_class_set_props(k, pci_props); } static void pci_device_class_base_init(ObjectClass *klass, void *data) diff --git a/hw/pci/pcie_port.c b/hw/pci/pcie_port.c index c19a9be..f8263cb 100644 --- a/hw/pci/pcie_port.c +++ b/hw/pci/pcie_port.c @@ -133,7 +133,7 @@ static void pcie_port_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); - dc->props = pcie_port_props; + device_class_set_props(dc, pcie_port_props); } static const TypeInfo pcie_port_type_info = { @@ -155,7 +155,7 @@ static void pcie_slot_class_init(ObjectClass *oc, void *data) DeviceClass *dc = DEVICE_CLASS(oc); HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(oc); - dc->props = pcie_slot_props; + device_class_set_props(dc, pcie_slot_props); hc->pre_plug = pcie_cap_slot_pre_plug_cb; hc->plug = pcie_cap_slot_plug_cb; hc->unplug = pcie_cap_slot_unplug_cb; diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index e2735bb..e61994c 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -1614,7 +1614,7 @@ static void pnv_chip_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_CPU, dc->categories); dc->realize = pnv_chip_realize; - dc->props = pnv_chip_properties; + device_class_set_props(dc, pnv_chip_properties); dc->desc = "PowerNV Chip"; } diff --git a/hw/ppc/pnv_core.c b/hw/ppc/pnv_core.c index 2651044..8ca5fbd 100644 --- a/hw/ppc/pnv_core.c +++ b/hw/ppc/pnv_core.c @@ -323,7 +323,7 @@ static void pnv_core_class_init(ObjectClass *oc, void *data) dc->realize = pnv_core_realize; dc->unrealize = pnv_core_unrealize; - dc->props = pnv_core_properties; + device_class_set_props(dc, pnv_core_properties); } #define DEFINE_PNV_CORE_TYPE(family, cpu_model) \ @@ -421,7 +421,7 @@ static void pnv_quad_class_init(ObjectClass *oc, void *data) DeviceClass *dc = DEVICE_CLASS(oc); dc->realize = pnv_quad_realize; - dc->props = pnv_quad_properties; + device_class_set_props(dc, pnv_quad_properties); } static const TypeInfo pnv_quad_info = { diff --git a/hw/ppc/pnv_homer.c b/hw/ppc/pnv_homer.c index a08b791..93ae42f 100644 --- a/hw/ppc/pnv_homer.c +++ b/hw/ppc/pnv_homer.c @@ -359,7 +359,7 @@ static void pnv_homer_class_init(ObjectClass *klass, void *data) dc->realize = pnv_homer_realize; dc->desc = "PowerNV HOMER Memory"; - dc->props = pnv_homer_properties; + device_class_set_props(dc, pnv_homer_properties); } static const TypeInfo pnv_homer_type_info = { diff --git a/hw/ppc/pnv_lpc.c b/hw/ppc/pnv_lpc.c index 18256d9..22b2055 100644 --- a/hw/ppc/pnv_lpc.c +++ b/hw/ppc/pnv_lpc.c @@ -761,7 +761,7 @@ static void pnv_lpc_class_init(ObjectClass *klass, void *data) dc->realize = pnv_lpc_realize; dc->desc = "PowerNV LPC Controller"; - dc->props = pnv_lpc_properties; + device_class_set_props(dc, pnv_lpc_properties); } static const TypeInfo pnv_lpc_info = { diff --git a/hw/ppc/pnv_occ.c b/hw/ppc/pnv_occ.c index 924fdab..2173fac 100644 --- a/hw/ppc/pnv_occ.c +++ b/hw/ppc/pnv_occ.c @@ -279,7 +279,7 @@ static void pnv_occ_class_init(ObjectClass *klass, void *data) dc->realize = pnv_occ_realize; dc->desc = "PowerNV OCC Controller"; - dc->props = pnv_occ_properties; + device_class_set_props(dc, pnv_occ_properties); } static const TypeInfo pnv_occ_type_info = { diff --git a/hw/ppc/pnv_pnor.c b/hw/ppc/pnv_pnor.c index b061106..f761d8d 100644 --- a/hw/ppc/pnv_pnor.c +++ b/hw/ppc/pnv_pnor.c @@ -121,7 +121,7 @@ static void pnv_pnor_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = pnv_pnor_realize; - dc->props = pnv_pnor_properties; + device_class_set_props(dc, pnv_pnor_properties); } static const TypeInfo pnv_pnor_info = { diff --git a/hw/ppc/pnv_psi.c b/hw/ppc/pnv_psi.c index 1d8da31..6baf950 100644 --- a/hw/ppc/pnv_psi.c +++ b/hw/ppc/pnv_psi.c @@ -937,7 +937,7 @@ static void pnv_psi_class_init(ObjectClass *klass, void *data) xdc->dt_xscom = pnv_psi_dt_xscom; dc->desc = "PowerNV PSI Controller"; - dc->props = pnv_psi_properties; + device_class_set_props(dc, pnv_psi_properties); dc->reset = pnv_psi_reset; } diff --git a/hw/ppc/ppc440_uc.c b/hw/ppc/ppc440_uc.c index 95475c9..1a6a8fa 100644 --- a/hw/ppc/ppc440_uc.c +++ b/hw/ppc/ppc440_uc.c @@ -1296,7 +1296,7 @@ static void ppc460ex_pcie_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); dc->realize = ppc460ex_pcie_realize; - dc->props = ppc460ex_pcie_props; + device_class_set_props(dc, ppc460ex_pcie_props); dc->hotpluggable = false; } diff --git a/hw/ppc/prep_systemio.c b/hw/ppc/prep_systemio.c index 86e83e2..bbc51b6 100644 --- a/hw/ppc/prep_systemio.c +++ b/hw/ppc/prep_systemio.c @@ -289,7 +289,7 @@ static void prep_systemio_class_initfn(ObjectClass *klass, void *data) dc->realize = prep_systemio_realize; dc->vmsd = &vmstate_prep_systemio; - dc->props = prep_systemio_properties; + device_class_set_props(dc, prep_systemio_properties); } static TypeInfo prep_systemio800_info = { diff --git a/hw/ppc/rs6000_mc.c b/hw/ppc/rs6000_mc.c index 66b14db..f8a498b 100644 --- a/hw/ppc/rs6000_mc.c +++ b/hw/ppc/rs6000_mc.c @@ -222,7 +222,7 @@ static void rs6000mc_class_initfn(ObjectClass *klass, void *data) dc->realize = rs6000mc_realize; dc->vmsd = &vmstate_rs6000mc; - dc->props = rs6000mc_properties; + device_class_set_props(dc, rs6000mc_properties); } static const TypeInfo rs6000mc_info = { diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c index 8339c4c..d09125d 100644 --- a/hw/ppc/spapr_cpu_core.c +++ b/hw/ppc/spapr_cpu_core.c @@ -383,7 +383,7 @@ static void spapr_cpu_core_class_init(ObjectClass *oc, void *data) dc->realize = spapr_cpu_core_realize; dc->unrealize = spapr_cpu_core_unrealize; dc->reset = spapr_cpu_core_reset; - dc->props = spapr_cpu_core_properties; + device_class_set_props(dc, spapr_cpu_core_properties); scc->cpu_type = data; } diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 723373d..e82bfc5 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -2217,7 +2217,7 @@ static void spapr_phb_class_init(ObjectClass *klass, void *data) hc->root_bus_path = spapr_phb_root_bus_path; dc->realize = spapr_phb_realize; dc->unrealize = spapr_phb_unrealize; - dc->props = spapr_phb_properties; + device_class_set_props(dc, spapr_phb_properties); dc->reset = spapr_phb_reset; dc->vmsd = &vmstate_spapr_pci; /* Supported by TYPE_SPAPR_MACHINE */ diff --git a/hw/ppc/spapr_rng.c b/hw/ppc/spapr_rng.c index 954e4ae..e8e8d65 100644 --- a/hw/ppc/spapr_rng.c +++ b/hw/ppc/spapr_rng.c @@ -146,7 +146,7 @@ static void spapr_rng_class_init(ObjectClass *oc, void *data) dc->realize = spapr_rng_realize; set_bit(DEVICE_CATEGORY_MISC, dc->categories); - dc->props = spapr_rng_properties; + device_class_set_props(dc, spapr_rng_properties); dc->hotpluggable = false; } diff --git a/hw/ppc/spapr_tpm_proxy.c b/hw/ppc/spapr_tpm_proxy.c index ca1caec..991615d 100644 --- a/hw/ppc/spapr_tpm_proxy.c +++ b/hw/ppc/spapr_tpm_proxy.c @@ -159,7 +159,7 @@ static void spapr_tpm_proxy_class_init(ObjectClass *k, void *data) dk->realize = spapr_tpm_proxy_realize; dk->unrealize = spapr_tpm_proxy_unrealize; dk->user_creatable = true; - dk->props = spapr_tpm_proxy_properties; + device_class_set_props(dk, spapr_tpm_proxy_properties); } static const TypeInfo spapr_tpm_proxy_info = { diff --git a/hw/rdma/vmw/pvrdma_main.c b/hw/rdma/vmw/pvrdma_main.c index 6f0fc40..3254aad 100644 --- a/hw/rdma/vmw/pvrdma_main.c +++ b/hw/rdma/vmw/pvrdma_main.c @@ -690,7 +690,7 @@ static void pvrdma_class_init(ObjectClass *klass, void *data) k->class_id = PCI_CLASS_NETWORK_OTHER; dc->desc = "RDMA Device"; - dc->props = pvrdma_dev_properties; + device_class_set_props(dc, pvrdma_dev_properties); set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); ir->print_statistics = pvrdma_print_statistics; diff --git a/hw/riscv/riscv_hart.c b/hw/riscv/riscv_hart.c index 5b98227..276a9ba 100644 --- a/hw/riscv/riscv_hart.c +++ b/hw/riscv/riscv_hart.c @@ -74,7 +74,7 @@ static void riscv_harts_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = riscv_harts_props; + device_class_set_props(dc, riscv_harts_props); dc->realize = riscv_harts_realize; } diff --git a/hw/riscv/sifive_clint.c b/hw/riscv/sifive_clint.c index e5a8f75..e2feee8 100644 --- a/hw/riscv/sifive_clint.c +++ b/hw/riscv/sifive_clint.c @@ -205,7 +205,7 @@ static void sifive_clint_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = sifive_clint_realize; - dc->props = sifive_clint_properties; + device_class_set_props(dc, sifive_clint_properties); } static const TypeInfo sifive_clint_info = { diff --git a/hw/riscv/sifive_plic.c b/hw/riscv/sifive_plic.c index 98e4304..c1e04cb 100644 --- a/hw/riscv/sifive_plic.c +++ b/hw/riscv/sifive_plic.c @@ -466,7 +466,7 @@ static void sifive_plic_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = sifive_plic_properties; + device_class_set_props(dc, sifive_plic_properties); dc->realize = sifive_plic_realize; } diff --git a/hw/riscv/sifive_u_otp.c b/hw/riscv/sifive_u_otp.c index ea0eee5..f6ecbaa 100644 --- a/hw/riscv/sifive_u_otp.c +++ b/hw/riscv/sifive_u_otp.c @@ -171,7 +171,7 @@ static void sifive_u_otp_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = sifive_u_otp_properties; + device_class_set_props(dc, sifive_u_otp_properties); dc->realize = sifive_u_otp_realize; dc->reset = sifive_u_otp_reset; } diff --git a/hw/rtc/m48t59-isa.c b/hw/rtc/m48t59-isa.c index 7fde854..131eb5b 100644 --- a/hw/rtc/m48t59-isa.c +++ b/hw/rtc/m48t59-isa.c @@ -137,7 +137,7 @@ static void m48txx_isa_class_init(ObjectClass *klass, void *data) dc->realize = m48t59_isa_realize; dc->reset = m48t59_reset_isa; - dc->props = m48t59_isa_properties; + device_class_set_props(dc, m48t59_isa_properties); nc->read = m48txx_isa_read; nc->write = m48txx_isa_write; nc->toggle_lock = m48txx_isa_toggle_lock; diff --git a/hw/rtc/m48t59.c b/hw/rtc/m48t59.c index fc592b9..1269134 100644 --- a/hw/rtc/m48t59.c +++ b/hw/rtc/m48t59.c @@ -667,7 +667,7 @@ static void m48txx_sysbus_class_init(ObjectClass *klass, void *data) dc->realize = m48t59_realize; dc->reset = m48t59_reset_sysbus; - dc->props = m48t59_sysbus_properties; + device_class_set_props(dc, m48t59_sysbus_properties); dc->vmsd = &vmstate_m48t59; nc->read = m48txx_sysbus_read; nc->write = m48txx_sysbus_write; diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c index 74ae74b..dc4269c 100644 --- a/hw/rtc/mc146818rtc.c +++ b/hw/rtc/mc146818rtc.c @@ -1015,7 +1015,7 @@ static void rtc_class_initfn(ObjectClass *klass, void *data) dc->realize = rtc_realizefn; dc->reset = rtc_resetdev; dc->vmsd = &vmstate_rtc; - dc->props = mc146818rtc_properties; + device_class_set_props(dc, mc146818rtc_properties); } static const TypeInfo mc146818rtc_info = { diff --git a/hw/rtc/pl031.c b/hw/rtc/pl031.c index c57cf83..ae47f09 100644 --- a/hw/rtc/pl031.c +++ b/hw/rtc/pl031.c @@ -321,7 +321,7 @@ static void pl031_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->vmsd = &vmstate_pl031; - dc->props = pl031_properties; + device_class_set_props(dc, pl031_properties); } static const TypeInfo pl031_info = { diff --git a/hw/s390x/3270-ccw.c b/hw/s390x/3270-ccw.c index c19a75b..821319e 100644 --- a/hw/s390x/3270-ccw.c +++ b/hw/s390x/3270-ccw.c @@ -155,7 +155,7 @@ static void emulated_ccw_3270_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = emulated_ccw_3270_properties; + device_class_set_props(dc, emulated_ccw_3270_properties); dc->bus_type = TYPE_VIRTUAL_CSS_BUS; dc->realize = emulated_ccw_3270_realize; dc->hotpluggable = false; diff --git a/hw/s390x/ccw-device.c b/hw/s390x/ccw-device.c index 4d222ad..c970711 100644 --- a/hw/s390x/ccw-device.c +++ b/hw/s390x/ccw-device.c @@ -57,7 +57,7 @@ static void ccw_device_class_init(ObjectClass *klass, void *data) k->realize = ccw_device_realize; k->refill_ids = ccw_device_refill_ids; - dc->props = ccw_device_properties; + device_class_set_props(dc, ccw_device_properties); dc->reset = ccw_device_reset; } diff --git a/hw/s390x/css-bridge.c b/hw/s390x/css-bridge.c index 15a8ed9..a306a78 100644 --- a/hw/s390x/css-bridge.c +++ b/hw/s390x/css-bridge.c @@ -139,7 +139,7 @@ static void virtual_css_bridge_class_init(ObjectClass *klass, void *data) hc->unplug = ccw_device_unplug; set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); - dc->props = virtual_css_bridge_properties; + device_class_set_props(dc, virtual_css_bridge_properties); object_class_property_add_bool(klass, "cssid-unrestricted", prop_get_true, NULL, NULL); object_class_property_set_description(klass, "cssid-unrestricted", diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index ca544d6..b3ae901 100644 --- a/hw/s390x/ipl.c +++ b/hw/s390x/ipl.c @@ -666,7 +666,7 @@ static void s390_ipl_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = s390_ipl_realize; - dc->props = s390_ipl_properties; + device_class_set_props(dc, s390_ipl_properties); dc->reset = s390_ipl_reset; dc->vmsd = &vmstate_ipl; set_bit(DEVICE_CATEGORY_MISC, dc->categories); diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index 2d2f4a7..7c6a2b3 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -1314,7 +1314,7 @@ static void s390_pci_device_class_init(ObjectClass *klass, void *data) dc->reset = s390_pci_device_reset; dc->bus_type = TYPE_S390_PCI_BUS; dc->realize = s390_pci_device_realize; - dc->props = s390_pci_device_properties; + device_class_set_props(dc, s390_pci_device_properties); dc->vmsd = &s390_pci_device_vmstate; } diff --git a/hw/s390x/vhost-vsock-ccw.c b/hw/s390x/vhost-vsock-ccw.c index 1835812..12dee15 100644 --- a/hw/s390x/vhost-vsock-ccw.c +++ b/hw/s390x/vhost-vsock-ccw.c @@ -35,7 +35,7 @@ static void vhost_vsock_ccw_class_init(ObjectClass *klass, void *data) k->realize = vhost_vsock_ccw_realize; set_bit(DEVICE_CATEGORY_MISC, dc->categories); - dc->props = vhost_vsock_ccw_properties; + device_class_set_props(dc, vhost_vsock_ccw_properties); } static void vhost_vsock_ccw_instance_init(Object *obj) diff --git a/hw/s390x/virtio-ccw-9p.c b/hw/s390x/virtio-ccw-9p.c index 5453a96..08e1d5d 100644 --- a/hw/s390x/virtio-ccw-9p.c +++ b/hw/s390x/virtio-ccw-9p.c @@ -47,7 +47,7 @@ static void virtio_ccw_9p_class_init(ObjectClass *klass, void *data) VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass); k->realize = virtio_ccw_9p_realize; - dc->props = virtio_ccw_9p_properties; + device_class_set_props(dc, virtio_ccw_9p_properties); set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); } diff --git a/hw/s390x/virtio-ccw-balloon.c b/hw/s390x/virtio-ccw-balloon.c index 7088612..5d28e72 100644 --- a/hw/s390x/virtio-ccw-balloon.c +++ b/hw/s390x/virtio-ccw-balloon.c @@ -52,7 +52,7 @@ static void virtio_ccw_balloon_class_init(ObjectClass *klass, void *data) VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass); k->realize = virtio_ccw_balloon_realize; - dc->props = virtio_ccw_balloon_properties; + device_class_set_props(dc, virtio_ccw_balloon_properties); set_bit(DEVICE_CATEGORY_MISC, dc->categories); } diff --git a/hw/s390x/virtio-ccw-blk.c b/hw/s390x/virtio-ccw-blk.c index 1512af8..bf8520e 100644 --- a/hw/s390x/virtio-ccw-blk.c +++ b/hw/s390x/virtio-ccw-blk.c @@ -49,7 +49,7 @@ static void virtio_ccw_blk_class_init(ObjectClass *klass, void *data) VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass); k->realize = virtio_ccw_blk_realize; - dc->props = virtio_ccw_blk_properties; + device_class_set_props(dc, virtio_ccw_blk_properties); set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); } diff --git a/hw/s390x/virtio-ccw-crypto.c b/hw/s390x/virtio-ccw-crypto.c index 086b397..1a2690c 100644 --- a/hw/s390x/virtio-ccw-crypto.c +++ b/hw/s390x/virtio-ccw-crypto.c @@ -57,7 +57,7 @@ static void virtio_ccw_crypto_class_init(ObjectClass *klass, void *data) VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass); k->realize = virtio_ccw_crypto_realize; - dc->props = virtio_ccw_crypto_properties; + device_class_set_props(dc, virtio_ccw_crypto_properties); set_bit(DEVICE_CATEGORY_MISC, dc->categories); } diff --git a/hw/s390x/virtio-ccw-gpu.c b/hw/s390x/virtio-ccw-gpu.c index be46ca7..f69e3ff 100644 --- a/hw/s390x/virtio-ccw-gpu.c +++ b/hw/s390x/virtio-ccw-gpu.c @@ -48,7 +48,7 @@ static void virtio_ccw_gpu_class_init(ObjectClass *klass, void *data) VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass); k->realize = virtio_ccw_gpu_realize; - dc->props = virtio_ccw_gpu_properties; + device_class_set_props(dc, virtio_ccw_gpu_properties); dc->hotpluggable = false; set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); } diff --git a/hw/s390x/virtio-ccw-input.c b/hw/s390x/virtio-ccw-input.c index 370b776..b257dfd 100644 --- a/hw/s390x/virtio-ccw-input.c +++ b/hw/s390x/virtio-ccw-input.c @@ -38,7 +38,7 @@ static void virtio_ccw_input_class_init(ObjectClass *klass, void *data) VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass); k->realize = virtio_ccw_input_realize; - dc->props = virtio_ccw_input_properties; + device_class_set_props(dc, virtio_ccw_input_properties); set_bit(DEVICE_CATEGORY_INPUT, dc->categories); } diff --git a/hw/s390x/virtio-ccw-net.c b/hw/s390x/virtio-ccw-net.c index 12c03d7..cd02699 100644 --- a/hw/s390x/virtio-ccw-net.c +++ b/hw/s390x/virtio-ccw-net.c @@ -52,7 +52,7 @@ static void virtio_ccw_net_class_init(ObjectClass *klass, void *data) VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass); k->realize = virtio_ccw_net_realize; - dc->props = virtio_ccw_net_properties; + device_class_set_props(dc, virtio_ccw_net_properties); set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); } diff --git a/hw/s390x/virtio-ccw-rng.c b/hw/s390x/virtio-ccw-rng.c index 854254d..d575e30 100644 --- a/hw/s390x/virtio-ccw-rng.c +++ b/hw/s390x/virtio-ccw-rng.c @@ -56,7 +56,7 @@ static void virtio_ccw_rng_class_init(ObjectClass *klass, void *data) VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass); k->realize = virtio_ccw_rng_realize; - dc->props = virtio_ccw_rng_properties; + device_class_set_props(dc, virtio_ccw_rng_properties); set_bit(DEVICE_CATEGORY_MISC, dc->categories); } diff --git a/hw/s390x/virtio-ccw-scsi.c b/hw/s390x/virtio-ccw-scsi.c index 4662288..3cb3ad6 100644 --- a/hw/s390x/virtio-ccw-scsi.c +++ b/hw/s390x/virtio-ccw-scsi.c @@ -59,7 +59,7 @@ static void virtio_ccw_scsi_class_init(ObjectClass *klass, void *data) VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass); k->realize = virtio_ccw_scsi_realize; - dc->props = virtio_ccw_scsi_properties; + device_class_set_props(dc, virtio_ccw_scsi_properties); set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); } @@ -102,7 +102,7 @@ static void vhost_ccw_scsi_class_init(ObjectClass *klass, void *data) VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass); k->realize = vhost_ccw_scsi_realize; - dc->props = vhost_ccw_scsi_properties; + device_class_set_props(dc, vhost_ccw_scsi_properties); set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); } diff --git a/hw/s390x/virtio-ccw-serial.c b/hw/s390x/virtio-ccw-serial.c index eafb7d5..1764db2 100644 --- a/hw/s390x/virtio-ccw-serial.c +++ b/hw/s390x/virtio-ccw-serial.c @@ -60,7 +60,7 @@ static void virtio_ccw_serial_class_init(ObjectClass *klass, void *data) VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass); k->realize = virtio_ccw_serial_realize; - dc->props = virtio_ccw_serial_properties; + device_class_set_props(dc, virtio_ccw_serial_properties); set_bit(DEVICE_CATEGORY_INPUT, dc->categories); } diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c index de9bd20..af18c88 100644 --- a/hw/scsi/megasas.c +++ b/hw/scsi/megasas.c @@ -2511,7 +2511,7 @@ static void megasas_class_init(ObjectClass *oc, void *data) e->osts = info->osts; e->product_name = info->product_name; e->product_version = info->product_version; - dc->props = info->props; + device_class_set_props(dc, info->props); dc->reset = megasas_scsi_reset; dc->vmsd = info->vmsd; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); diff --git a/hw/scsi/mptsas.c b/hw/scsi/mptsas.c index b8a4b37..14cbed8 100644 --- a/hw/scsi/mptsas.c +++ b/hw/scsi/mptsas.c @@ -1431,7 +1431,7 @@ static void mptsas1068_class_init(ObjectClass *oc, void *data) pc->subsystem_vendor_id = PCI_VENDOR_ID_LSI_LOGIC; pc->subsystem_id = 0x8000; pc->class_id = PCI_CLASS_STORAGE_SCSI; - dc->props = mptsas_properties; + device_class_set_props(dc, mptsas_properties); dc->reset = mptsas_reset; dc->vmsd = &vmstate_mptsas; dc->desc = "LSI SAS 1068"; diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index ad0e7f6..1c980ca 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -1728,7 +1728,7 @@ static void scsi_device_class_init(ObjectClass *klass, void *data) k->bus_type = TYPE_SCSI_BUS; k->realize = scsi_qdev_realize; k->unrealize = scsi_qdev_unrealize; - k->props = scsi_props; + device_class_set_props(k, scsi_props); } static void scsi_dev_instance_init(Object *obj) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index e44c61e..10d0794 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -3036,7 +3036,7 @@ static void scsi_hd_class_initfn(ObjectClass *klass, void *data) sc->alloc_req = scsi_new_request; sc->unit_attention_reported = scsi_disk_unit_attention_reported; dc->desc = "virtual SCSI disk"; - dc->props = scsi_hd_properties; + device_class_set_props(dc, scsi_hd_properties); dc->vmsd = &vmstate_scsi_disk_state; } @@ -3067,7 +3067,7 @@ static void scsi_cd_class_initfn(ObjectClass *klass, void *data) sc->alloc_req = scsi_new_request; sc->unit_attention_reported = scsi_disk_unit_attention_reported; dc->desc = "virtual SCSI CD-ROM"; - dc->props = scsi_cd_properties; + device_class_set_props(dc, scsi_cd_properties); dc->vmsd = &vmstate_scsi_disk_state; } @@ -3106,7 +3106,7 @@ static void scsi_block_class_initfn(ObjectClass *klass, void *data) sdc->update_sense = scsi_block_update_sense; sdc->need_fua_emulation = scsi_block_no_fua; dc->desc = "SCSI block device passthrough"; - dc->props = scsi_block_properties; + device_class_set_props(dc, scsi_block_properties); dc->vmsd = &vmstate_scsi_disk_state; } @@ -3146,7 +3146,7 @@ static void scsi_disk_class_initfn(ObjectClass *klass, void *data) dc->fw_name = "disk"; dc->desc = "virtual SCSI disk or CD-ROM (legacy)"; dc->reset = scsi_disk_reset; - dc->props = scsi_disk_properties; + device_class_set_props(dc, scsi_disk_properties); dc->vmsd = &vmstate_scsi_disk_state; } diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c index e7798eb..86ed0a3 100644 --- a/hw/scsi/scsi-generic.c +++ b/hw/scsi/scsi-generic.c @@ -768,7 +768,7 @@ static void scsi_generic_class_initfn(ObjectClass *klass, void *data) dc->fw_name = "disk"; dc->desc = "pass through generic scsi device (/dev/sg*)"; dc->reset = scsi_generic_reset; - dc->props = scsi_generic_properties; + device_class_set_props(dc, scsi_generic_properties); dc->vmsd = &vmstate_scsi_device; } diff --git a/hw/scsi/spapr_vscsi.c b/hw/scsi/spapr_vscsi.c index 2120ceb..7d584e7 100644 --- a/hw/scsi/spapr_vscsi.c +++ b/hw/scsi/spapr_vscsi.c @@ -1267,7 +1267,7 @@ static void spapr_vscsi_class_init(ObjectClass *klass, void *data) k->dt_compatible = "IBM,v-scsi"; k->signal_mask = 0x00000001; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); - dc->props = spapr_vscsi_properties; + device_class_set_props(dc, spapr_vscsi_properties); k->rtce_window_size = 0x10000000; dc->vmsd = &vmstate_spapr_vscsi; } diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c index 26f710d..f052377 100644 --- a/hw/scsi/vhost-scsi.c +++ b/hw/scsi/vhost-scsi.c @@ -293,7 +293,7 @@ static void vhost_scsi_class_init(ObjectClass *klass, void *data) VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); FWPathProviderClass *fwc = FW_PATH_PROVIDER_CLASS(klass); - dc->props = vhost_scsi_properties; + device_class_set_props(dc, vhost_scsi_properties); dc->vmsd = &vmstate_virtio_vhost_scsi; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); vdc->realize = vhost_scsi_realize; diff --git a/hw/scsi/vhost-user-scsi.c b/hw/scsi/vhost-user-scsi.c index 23f972d..a01bf63 100644 --- a/hw/scsi/vhost-user-scsi.c +++ b/hw/scsi/vhost-user-scsi.c @@ -197,7 +197,7 @@ static void vhost_user_scsi_class_init(ObjectClass *klass, void *data) VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); FWPathProviderClass *fwc = FW_PATH_PROVIDER_CLASS(klass); - dc->props = vhost_user_scsi_properties; + device_class_set_props(dc, vhost_user_scsi_properties); dc->vmsd = &vmstate_vhost_scsi; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); vdc->realize = vhost_user_scsi_realize; diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index d3af42e..3b61563 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -1006,7 +1006,7 @@ static void virtio_scsi_class_init(ObjectClass *klass, void *data) VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(klass); - dc->props = virtio_scsi_properties; + device_class_set_props(dc, virtio_scsi_properties); dc->vmsd = &vmstate_virtio_scsi; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); vdc->realize = virtio_scsi_device_realize; diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c index 452a3b6..8f1aaf9 100644 --- a/hw/scsi/vmw_pvscsi.c +++ b/hw/scsi/vmw_pvscsi.c @@ -1292,7 +1292,7 @@ static void pvscsi_class_init(ObjectClass *klass, void *data) &pvs_k->parent_dc_realize); dc->reset = pvscsi_reset; dc->vmsd = &vmstate_pvscsi; - dc->props = pvscsi_properties; + device_class_set_props(dc, pvscsi_properties); set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); hc->unplug = pvscsi_hot_unplug; hc->plug = pvscsi_hotplug; diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 49b8357..71a9af0 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -2118,7 +2118,7 @@ static void sd_class_init(ObjectClass *klass, void *data) SDCardClass *sc = SD_CARD_CLASS(klass); dc->realize = sd_realize; - dc->props = sd_properties; + device_class_set_props(dc, sd_properties); dc->vmsd = &sd_vmstate; dc->reset = sd_reset; dc->bus_type = TYPE_SD_BUS; diff --git a/hw/sd/sdhci-pci.c b/hw/sd/sdhci-pci.c index 2c8d8f5..19fa8bd 100644 --- a/hw/sd/sdhci-pci.c +++ b/hw/sd/sdhci-pci.c @@ -64,7 +64,7 @@ static void sdhci_pci_class_init(ObjectClass *klass, void *data) k->vendor_id = PCI_VENDOR_ID_REDHAT; k->device_id = PCI_DEVICE_ID_REDHAT_SDHCI; k->class_id = PCI_CLASS_SYSTEM_SDHCI; - dc->props = sdhci_pci_properties; + device_class_set_props(dc, sdhci_pci_properties); sdhci_common_class_init(klass, data); } diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index 18c0c05..69dc3e6 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -1499,7 +1499,7 @@ static void sdhci_sysbus_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = sdhci_sysbus_properties; + device_class_set_props(dc, sdhci_sysbus_properties); dc->realize = sdhci_sysbus_realize; dc->unrealize = sdhci_sysbus_unrealize; diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 2aaa5bf..df33b32 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -761,7 +761,7 @@ static void prom_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = prom_properties; + device_class_set_props(dc, prom_properties); dc->realize = prom_realize; } @@ -827,7 +827,7 @@ static void ram_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = ram_realize; - dc->props = ram_properties; + device_class_set_props(dc, ram_properties); } static const TypeInfo ram_info = { diff --git a/hw/sparc/sun4m_iommu.c b/hw/sparc/sun4m_iommu.c index ccf46a5..71f5465 100644 --- a/hw/sparc/sun4m_iommu.c +++ b/hw/sparc/sun4m_iommu.c @@ -379,7 +379,7 @@ static void iommu_class_init(ObjectClass *klass, void *data) dc->reset = iommu_reset; dc->vmsd = &vmstate_iommu; - dc->props = iommu_properties; + device_class_set_props(dc, iommu_properties); } static const TypeInfo iommu_info = { diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index 9550827..5d710d6 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -389,7 +389,7 @@ static void ebus_class_init(ObjectClass *klass, void *data) k->device_id = PCI_DEVICE_ID_SUN_EBUS; k->revision = 0x01; k->class_id = PCI_CLASS_BRIDGE_OTHER; - dc->props = ebus_properties; + device_class_set_props(dc, ebus_properties); } static const TypeInfo ebus_info = { @@ -479,7 +479,7 @@ static void prom_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = prom_properties; + device_class_set_props(dc, prom_properties); dc->realize = prom_realize; } @@ -540,7 +540,7 @@ static void ram_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = ram_realize; - dc->props = ram_properties; + device_class_set_props(dc, ram_properties); } static const TypeInfo ram_info = { diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c index 7755eca..23c8d2f 100644 --- a/hw/ssi/aspeed_smc.c +++ b/hw/ssi/aspeed_smc.c @@ -1401,7 +1401,7 @@ static void aspeed_smc_class_init(ObjectClass *klass, void *data) dc->realize = aspeed_smc_realize; dc->reset = aspeed_smc_reset; - dc->props = aspeed_smc_properties; + device_class_set_props(dc, aspeed_smc_properties); dc->vmsd = &vmstate_aspeed_smc; mc->ctrl = data; } diff --git a/hw/ssi/xilinx_spi.c b/hw/ssi/xilinx_spi.c index a1be0de..eba7ccd 100644 --- a/hw/ssi/xilinx_spi.c +++ b/hw/ssi/xilinx_spi.c @@ -372,7 +372,7 @@ static void xilinx_spi_class_init(ObjectClass *klass, void *data) dc->realize = xilinx_spi_realize; dc->reset = xlx_spi_reset; - dc->props = xilinx_spi_properties; + device_class_set_props(dc, xilinx_spi_properties); dc->vmsd = &vmstate_xilinx_spi; } diff --git a/hw/ssi/xilinx_spips.c b/hw/ssi/xilinx_spips.c index 0d6c2e1..6c9ef59 100644 --- a/hw/ssi/xilinx_spips.c +++ b/hw/ssi/xilinx_spips.c @@ -1455,7 +1455,7 @@ static void xilinx_spips_class_init(ObjectClass *klass, void *data) dc->realize = xilinx_spips_realize; dc->reset = xilinx_spips_reset; - dc->props = xilinx_spips_properties; + device_class_set_props(dc, xilinx_spips_properties); dc->vmsd = &vmstate_xilinx_spips; xsc->reg_ops = &spips_ops; @@ -1471,7 +1471,7 @@ static void xlnx_zynqmp_qspips_class_init(ObjectClass *klass, void * data) dc->realize = xlnx_zynqmp_qspips_realize; dc->reset = xlnx_zynqmp_qspips_reset; dc->vmsd = &vmstate_xlnx_zynqmp_qspips; - dc->props = xilinx_zynqmp_qspips_properties; + device_class_set_props(dc, xilinx_zynqmp_qspips_properties); xsc->reg_ops = &xlnx_zynqmp_qspips_ops; xsc->rx_fifo_size = RXFF_A_Q; xsc->tx_fifo_size = TXFF_A_Q; diff --git a/hw/timer/a9gtimer.c b/hw/timer/a9gtimer.c index 4c634c8..7233068 100644 --- a/hw/timer/a9gtimer.c +++ b/hw/timer/a9gtimer.c @@ -359,7 +359,7 @@ static void a9_gtimer_class_init(ObjectClass *klass, void *data) dc->realize = a9_gtimer_realize; dc->vmsd = &vmstate_a9_gtimer; dc->reset = a9_gtimer_reset; - dc->props = a9_gtimer_properties; + device_class_set_props(dc, a9_gtimer_properties); } static const TypeInfo a9_gtimer_info = { diff --git a/hw/timer/allwinner-a10-pit.c b/hw/timer/allwinner-a10-pit.c index aae880f..f84fc0e 100644 --- a/hw/timer/allwinner-a10-pit.c +++ b/hw/timer/allwinner-a10-pit.c @@ -284,7 +284,7 @@ static void a10_pit_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->reset = a10_pit_reset; - dc->props = a10_pit_properties; + device_class_set_props(dc, a10_pit_properties); dc->desc = "allwinner a10 timer"; dc->vmsd = &vmstate_a10_pit; } diff --git a/hw/timer/altera_timer.c b/hw/timer/altera_timer.c index 79fc381..be81b7a 100644 --- a/hw/timer/altera_timer.c +++ b/hw/timer/altera_timer.c @@ -224,7 +224,7 @@ static void altera_timer_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = altera_timer_realize; - dc->props = altera_timer_properties; + device_class_set_props(dc, altera_timer_properties); dc->reset = altera_timer_reset; } diff --git a/hw/timer/arm_mptimer.c b/hw/timer/arm_mptimer.c index 2bf11f7..cdfca30 100644 --- a/hw/timer/arm_mptimer.c +++ b/hw/timer/arm_mptimer.c @@ -312,7 +312,7 @@ static void arm_mptimer_class_init(ObjectClass *klass, void *data) dc->realize = arm_mptimer_realize; dc->vmsd = &vmstate_arm_mptimer; dc->reset = arm_mptimer_reset; - dc->props = arm_mptimer_properties; + device_class_set_props(dc, arm_mptimer_properties); } static const TypeInfo arm_mptimer_info = { diff --git a/hw/timer/arm_timer.c b/hw/timer/arm_timer.c index beaa285..9607366 100644 --- a/hw/timer/arm_timer.c +++ b/hw/timer/arm_timer.c @@ -397,7 +397,7 @@ static void sp804_class_init(ObjectClass *klass, void *data) DeviceClass *k = DEVICE_CLASS(klass); k->realize = sp804_realize; - k->props = sp804_properties; + device_class_set_props(k, sp804_properties); k->vmsd = &vmstate_sp804; } diff --git a/hw/timer/aspeed_timer.c b/hw/timer/aspeed_timer.c index c91f184..42c47d2 100644 --- a/hw/timer/aspeed_timer.c +++ b/hw/timer/aspeed_timer.c @@ -685,7 +685,7 @@ static void timer_class_init(ObjectClass *klass, void *data) dc->reset = aspeed_timer_reset; dc->desc = "ASPEED Timer"; dc->vmsd = &vmstate_aspeed_timer_state; - dc->props = aspeed_timer_properties; + device_class_set_props(dc, aspeed_timer_properties); } static const TypeInfo aspeed_timer_info = { diff --git a/hw/timer/cmsdk-apb-dualtimer.c b/hw/timer/cmsdk-apb-dualtimer.c index e28ba9c..f653424 100644 --- a/hw/timer/cmsdk-apb-dualtimer.c +++ b/hw/timer/cmsdk-apb-dualtimer.c @@ -510,7 +510,7 @@ static void cmsdk_apb_dualtimer_class_init(ObjectClass *klass, void *data) dc->realize = cmsdk_apb_dualtimer_realize; dc->vmsd = &cmsdk_apb_dualtimer_vmstate; dc->reset = cmsdk_apb_dualtimer_reset; - dc->props = cmsdk_apb_dualtimer_properties; + device_class_set_props(dc, cmsdk_apb_dualtimer_properties); } static const TypeInfo cmsdk_apb_dualtimer_info = { diff --git a/hw/timer/cmsdk-apb-timer.c b/hw/timer/cmsdk-apb-timer.c index 40728e8..f85f130 100644 --- a/hw/timer/cmsdk-apb-timer.c +++ b/hw/timer/cmsdk-apb-timer.c @@ -260,7 +260,7 @@ static void cmsdk_apb_timer_class_init(ObjectClass *klass, void *data) dc->realize = cmsdk_apb_timer_realize; dc->vmsd = &cmsdk_apb_timer_vmstate; dc->reset = cmsdk_apb_timer_reset; - dc->props = cmsdk_apb_timer_properties; + device_class_set_props(dc, cmsdk_apb_timer_properties); } static const TypeInfo cmsdk_apb_timer_info = { diff --git a/hw/timer/grlib_gptimer.c b/hw/timer/grlib_gptimer.c index 7a9371c..eff0ee3 100644 --- a/hw/timer/grlib_gptimer.c +++ b/hw/timer/grlib_gptimer.c @@ -415,7 +415,7 @@ static void grlib_gptimer_class_init(ObjectClass *klass, void *data) dc->realize = grlib_gptimer_realize; dc->reset = grlib_gptimer_reset; - dc->props = grlib_gptimer_properties; + device_class_set_props(dc, grlib_gptimer_properties); } static const TypeInfo grlib_gptimer_info = { diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c index 9f17aaa..8dbcbdc 100644 --- a/hw/timer/hpet.c +++ b/hw/timer/hpet.c @@ -800,7 +800,7 @@ static void hpet_device_class_init(ObjectClass *klass, void *data) dc->realize = hpet_realize; dc->reset = hpet_reset; dc->vmsd = &vmstate_hpet; - dc->props = hpet_device_properties; + device_class_set_props(dc, hpet_device_properties); } static const TypeInfo hpet_device_info = { diff --git a/hw/timer/i8254.c b/hw/timer/i8254.c index a4be733..29f62e5 100644 --- a/hw/timer/i8254.c +++ b/hw/timer/i8254.c @@ -364,7 +364,7 @@ static void pit_class_initfn(ObjectClass *klass, void *data) k->get_channel_info = pit_get_channel_info_common; k->post_load = pit_post_load; dc->reset = pit_reset; - dc->props = pit_properties; + device_class_set_props(dc, pit_properties); } static const TypeInfo pit_info = { diff --git a/hw/timer/lm32_timer.c b/hw/timer/lm32_timer.c index 3fdecd0..f703f40 100644 --- a/hw/timer/lm32_timer.c +++ b/hw/timer/lm32_timer.c @@ -230,7 +230,7 @@ static void lm32_timer_class_init(ObjectClass *klass, void *data) dc->realize = lm32_timer_realize; dc->reset = timer_reset; dc->vmsd = &vmstate_lm32_timer; - dc->props = lm32_timer_properties; + device_class_set_props(dc, lm32_timer_properties); } static const TypeInfo lm32_timer_info = { diff --git a/hw/timer/milkymist-sysctl.c b/hw/timer/milkymist-sysctl.c index 7a62e21..94389820 100644 --- a/hw/timer/milkymist-sysctl.c +++ b/hw/timer/milkymist-sysctl.c @@ -343,7 +343,7 @@ static void milkymist_sysctl_class_init(ObjectClass *klass, void *data) dc->realize = milkymist_sysctl_realize; dc->reset = milkymist_sysctl_reset; dc->vmsd = &vmstate_milkymist_sysctl; - dc->props = milkymist_sysctl_properties; + device_class_set_props(dc, milkymist_sysctl_properties); } static const TypeInfo milkymist_sysctl_info = { diff --git a/hw/timer/mss-timer.c b/hw/timer/mss-timer.c index b1c9a80..29943fd 100644 --- a/hw/timer/mss-timer.c +++ b/hw/timer/mss-timer.c @@ -278,7 +278,7 @@ static void mss_timer_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = mss_timer_properties; + device_class_set_props(dc, mss_timer_properties); dc->vmsd = &vmstate_mss_timer; } diff --git a/hw/timer/pxa2xx_timer.c b/hw/timer/pxa2xx_timer.c index 311cd38..cd172cc 100644 --- a/hw/timer/pxa2xx_timer.c +++ b/hw/timer/pxa2xx_timer.c @@ -562,7 +562,7 @@ static void pxa25x_timer_dev_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->desc = "PXA25x timer"; - dc->props = pxa25x_timer_dev_properties; + device_class_set_props(dc, pxa25x_timer_dev_properties); } static const TypeInfo pxa25x_timer_dev_info = { @@ -584,7 +584,7 @@ static void pxa27x_timer_dev_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->desc = "PXA27x timer"; - dc->props = pxa27x_timer_dev_properties; + device_class_set_props(dc, pxa27x_timer_dev_properties); } static const TypeInfo pxa27x_timer_dev_info = { diff --git a/hw/timer/slavio_timer.c b/hw/timer/slavio_timer.c index c55e8d0..4c5d65e 100644 --- a/hw/timer/slavio_timer.c +++ b/hw/timer/slavio_timer.c @@ -427,7 +427,7 @@ static void slavio_timer_class_init(ObjectClass *klass, void *data) dc->reset = slavio_timer_reset; dc->vmsd = &vmstate_slavio_timer; - dc->props = slavio_timer_properties; + device_class_set_props(dc, slavio_timer_properties); } static const TypeInfo slavio_timer_info = { diff --git a/hw/timer/stm32f2xx_timer.c b/hw/timer/stm32f2xx_timer.c index edc557a..fb370ce 100644 --- a/hw/timer/stm32f2xx_timer.c +++ b/hw/timer/stm32f2xx_timer.c @@ -323,7 +323,7 @@ static void stm32f2xx_timer_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->reset = stm32f2xx_timer_reset; - dc->props = stm32f2xx_timer_properties; + device_class_set_props(dc, stm32f2xx_timer_properties); dc->vmsd = &vmstate_stm32f2xx_timer; } diff --git a/hw/timer/xilinx_timer.c b/hw/timer/xilinx_timer.c index 7191ea5..0190aa4 100644 --- a/hw/timer/xilinx_timer.c +++ b/hw/timer/xilinx_timer.c @@ -253,7 +253,7 @@ static void xilinx_timer_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = xilinx_timer_realize; - dc->props = xilinx_timer_properties; + device_class_set_props(dc, xilinx_timer_properties); } static const TypeInfo xilinx_timer_info = { diff --git a/hw/tpm/tpm_crb.c b/hw/tpm/tpm_crb.c index faae733..cd004e7 100644 --- a/hw/tpm/tpm_crb.c +++ b/hw/tpm/tpm_crb.c @@ -313,7 +313,7 @@ static void tpm_crb_class_init(ObjectClass *klass, void *data) TPMIfClass *tc = TPM_IF_CLASS(klass); dc->realize = tpm_crb_realize; - dc->props = tpm_crb_properties; + device_class_set_props(dc, tpm_crb_properties); dc->vmsd = &vmstate_tpm_crb; dc->user_creatable = true; tc->model = TPM_MODEL_TPM_CRB; diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c index 7aaf9b9..5362df2 100644 --- a/hw/tpm/tpm_tis.c +++ b/hw/tpm/tpm_tis.c @@ -1023,7 +1023,7 @@ static void tpm_tis_class_init(ObjectClass *klass, void *data) TPMIfClass *tc = TPM_IF_CLASS(klass); dc->realize = tpm_tis_realizefn; - dc->props = tpm_tis_properties; + device_class_set_props(dc, tpm_tis_properties); dc->reset = tpm_tis_reset; dc->vmsd = &vmstate_tpm_tis; tc->model = TPM_MODEL_TPM_TIS; diff --git a/hw/usb/bus.c b/hw/usb/bus.c index a6522f5..c9a3900 100644 --- a/hw/usb/bus.c +++ b/hw/usb/bus.c @@ -768,7 +768,7 @@ static void usb_device_class_init(ObjectClass *klass, void *data) k->bus_type = TYPE_USB_BUS; k->realize = usb_qdev_realize; k->unrealize = usb_qdev_unrealize; - k->props = usb_props; + device_class_set_props(k, usb_props); } static const TypeInfo usb_device_type_info = { diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c index 291e41d..3083124 100644 --- a/hw/usb/ccid-card-emulated.c +++ b/hw/usb/ccid-card-emulated.c @@ -603,7 +603,7 @@ static void emulated_class_initfn(ObjectClass *klass, void *data) cc->apdu_from_guest = emulated_apdu_from_guest; set_bit(DEVICE_CATEGORY_INPUT, dc->categories); dc->desc = "emulated smartcard"; - dc->props = emulated_card_properties; + device_class_set_props(dc, emulated_card_properties); } static const TypeInfo emulated_card_info = { diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c index 3d40b70..bb325db 100644 --- a/hw/usb/ccid-card-passthru.c +++ b/hw/usb/ccid-card-passthru.c @@ -403,7 +403,7 @@ static void passthru_class_initfn(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_INPUT, dc->categories); dc->desc = "passthrough smartcard"; dc->vmsd = &passthru_vmstate; - dc->props = passthru_card_properties; + device_class_set_props(dc, passthru_card_properties); } static const TypeInfo passthru_card_info = { diff --git a/hw/usb/dev-audio.c b/hw/usb/dev-audio.c index ea604bb..6fa213f 100644 --- a/hw/usb/dev-audio.c +++ b/hw/usb/dev-audio.c @@ -1002,7 +1002,7 @@ static void usb_audio_class_init(ObjectClass *klass, void *data) USBDeviceClass *k = USB_DEVICE_CLASS(klass); dc->vmsd = &vmstate_usb_audio; - dc->props = usb_audio_properties; + device_class_set_props(dc, usb_audio_properties); set_bit(DEVICE_CATEGORY_SOUND, dc->categories); k->product_desc = "QEMU USB Audio Interface"; k->realize = usb_audio_realize; diff --git a/hw/usb/dev-hid.c b/hw/usb/dev-hid.c index 88492f2..67ec8b6 100644 --- a/hw/usb/dev-hid.c +++ b/hw/usb/dev-hid.c @@ -819,7 +819,7 @@ static void usb_tablet_class_initfn(ObjectClass *klass, void *data) uc->realize = usb_tablet_realize; uc->product_desc = "QEMU USB Tablet"; dc->vmsd = &vmstate_usb_ptr; - dc->props = usb_tablet_properties; + device_class_set_props(dc, usb_tablet_properties); set_bit(DEVICE_CATEGORY_INPUT, dc->categories); } @@ -842,7 +842,7 @@ static void usb_mouse_class_initfn(ObjectClass *klass, void *data) uc->realize = usb_mouse_realize; uc->product_desc = "QEMU USB Mouse"; dc->vmsd = &vmstate_usb_ptr; - dc->props = usb_mouse_properties; + device_class_set_props(dc, usb_mouse_properties); set_bit(DEVICE_CATEGORY_INPUT, dc->categories); } @@ -866,7 +866,7 @@ static void usb_keyboard_class_initfn(ObjectClass *klass, void *data) uc->realize = usb_keyboard_realize; uc->product_desc = "QEMU USB Keyboard"; dc->vmsd = &vmstate_usb_kbd; - dc->props = usb_keyboard_properties; + device_class_set_props(dc, usb_keyboard_properties); set_bit(DEVICE_CATEGORY_INPUT, dc->categories); } diff --git a/hw/usb/dev-hub.c b/hw/usb/dev-hub.c index 07ecfef..49a573b 100644 --- a/hw/usb/dev-hub.c +++ b/hw/usb/dev-hub.c @@ -686,7 +686,7 @@ static void usb_hub_class_initfn(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); dc->fw_name = "hub"; dc->vmsd = &vmstate_usb_hub; - dc->props = usb_hub_properties; + device_class_set_props(dc, usb_hub_properties); } static const TypeInfo hub_info = { diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c index 7c07295..20717f0 100644 --- a/hw/usb/dev-mtp.c +++ b/hw/usb/dev-mtp.c @@ -2105,7 +2105,7 @@ static void usb_mtp_class_initfn(ObjectClass *klass, void *data) dc->desc = "USB Media Transfer Protocol device"; dc->fw_name = "mtp"; dc->vmsd = &vmstate_usb_mtp; - dc->props = mtp_properties; + device_class_set_props(dc, mtp_properties); } static TypeInfo mtp_info = { diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c index b81a8ab..9a78ad9 100644 --- a/hw/usb/dev-network.c +++ b/hw/usb/dev-network.c @@ -1409,7 +1409,7 @@ static void usb_net_class_initfn(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); dc->fw_name = "network"; dc->vmsd = &vmstate_usb_net; - dc->props = net_properties; + device_class_set_props(dc, net_properties); } static const TypeInfo net_info = { diff --git a/hw/usb/dev-serial.c b/hw/usb/dev-serial.c index 9646fe7..9846599 100644 --- a/hw/usb/dev-serial.c +++ b/hw/usb/dev-serial.c @@ -567,7 +567,7 @@ static void usb_serial_class_initfn(ObjectClass *klass, void *data) uc->product_desc = "QEMU USB Serial"; uc->usb_desc = &desc_serial; - dc->props = serial_properties; + device_class_set_props(dc, serial_properties); } static const TypeInfo serial_info = { @@ -588,7 +588,7 @@ static void usb_braille_class_initfn(ObjectClass *klass, void *data) uc->product_desc = "QEMU USB Braille"; uc->usb_desc = &desc_braille; - dc->props = braille_properties; + device_class_set_props(dc, braille_properties); } static const TypeInfo braille_info = { diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c index 4568db2..02693a2 100644 --- a/hw/usb/dev-smartcard-reader.c +++ b/hw/usb/dev-smartcard-reader.c @@ -1456,7 +1456,7 @@ static void ccid_class_initfn(ObjectClass *klass, void *data) uc->unrealize = ccid_unrealize; dc->desc = "CCID Rev 1.1 smartcard reader"; dc->vmsd = &ccid_vmstate; - dc->props = ccid_properties; + device_class_set_props(dc, ccid_properties); set_bit(DEVICE_CATEGORY_INPUT, dc->categories); hc->unplug = qdev_simple_device_unplug_cb; } @@ -1478,7 +1478,7 @@ static void ccid_card_class_init(ObjectClass *klass, void *data) k->bus_type = TYPE_CCID_BUS; k->realize = ccid_card_realize; k->unrealize = ccid_card_unrealize; - k->props = ccid_props; + device_class_set_props(k, ccid_props); } static const TypeInfo ccid_card_type_info = { diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c index 8545193..90da008 100644 --- a/hw/usb/dev-storage.c +++ b/hw/usb/dev-storage.c @@ -702,7 +702,7 @@ static void usb_msd_class_storage_initfn(ObjectClass *klass, void *data) USBDeviceClass *uc = USB_DEVICE_CLASS(klass); uc->realize = usb_msd_storage_realize; - dc->props = msd_properties; + device_class_set_props(dc, msd_properties); } static void usb_msd_get_bootindex(Object *obj, Visitor *v, const char *name, diff --git a/hw/usb/dev-uas.c b/hw/usb/dev-uas.c index 6d6d107..9825ec3 100644 --- a/hw/usb/dev-uas.c +++ b/hw/usb/dev-uas.c @@ -952,7 +952,7 @@ static void usb_uas_class_initfn(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); dc->fw_name = "storage"; dc->vmsd = &vmstate_usb_uas; - dc->props = uas_properties; + device_class_set_props(dc, uas_properties); } static const TypeInfo uas_info = { diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c index 5b9a8d3..fc73a05 100644 --- a/hw/usb/hcd-ehci-pci.c +++ b/hw/usb/hcd-ehci-pci.c @@ -161,7 +161,7 @@ static void ehci_class_init(ObjectClass *klass, void *data) k->class_id = PCI_CLASS_SERIAL_USB; k->config_write = usb_ehci_pci_write_config; dc->vmsd = &vmstate_ehci_pci; - dc->props = ehci_pci_properties; + device_class_set_props(dc, ehci_pci_properties); dc->reset = usb_ehci_pci_reset; } diff --git a/hw/usb/hcd-ehci-sysbus.c b/hw/usb/hcd-ehci-sysbus.c index 020211f..8d47385 100644 --- a/hw/usb/hcd-ehci-sysbus.c +++ b/hw/usb/hcd-ehci-sysbus.c @@ -82,7 +82,7 @@ static void ehci_sysbus_class_init(ObjectClass *klass, void *data) dc->realize = usb_ehci_sysbus_realize; dc->vmsd = &vmstate_ehci_sysbus; - dc->props = ehci_sysbus_properties; + device_class_set_props(dc, ehci_sysbus_properties); dc->reset = usb_ehci_sysbus_reset; set_bit(DEVICE_CATEGORY_USB, dc->categories); } diff --git a/hw/usb/hcd-ohci-pci.c b/hw/usb/hcd-ohci-pci.c index c052f10..a7fb166 100644 --- a/hw/usb/hcd-ohci-pci.c +++ b/hw/usb/hcd-ohci-pci.c @@ -139,7 +139,7 @@ static void ohci_pci_class_init(ObjectClass *klass, void *data) k->class_id = PCI_CLASS_SERIAL_USB; set_bit(DEVICE_CATEGORY_USB, dc->categories); dc->desc = "Apple USB Controller"; - dc->props = ohci_pci_properties; + device_class_set_props(dc, ohci_pci_properties); dc->hotpluggable = false; dc->vmsd = &vmstate_ohci; dc->reset = usb_ohci_reset_pci; diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c index 145ee21..8a94bd0 100644 --- a/hw/usb/hcd-ohci.c +++ b/hw/usb/hcd-ohci.c @@ -2000,7 +2000,7 @@ static void ohci_sysbus_class_init(ObjectClass *klass, void *data) dc->realize = ohci_realize_pxa; set_bit(DEVICE_CATEGORY_USB, dc->categories); dc->desc = "OHCI USB Controller"; - dc->props = ohci_sysbus_properties; + device_class_set_props(dc, ohci_sysbus_properties); dc->reset = usb_ohci_reset_sysbus; } diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index 23507ad..37f7beb 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/usb/hcd-uhci.c @@ -1349,9 +1349,9 @@ static void uhci_data_class_init(ObjectClass *klass, void *data) if (!info->unplug) { /* uhci controllers in companion setups can't be hotplugged */ dc->hotpluggable = false; - dc->props = uhci_properties_companion; + device_class_set_props(dc, uhci_properties_companion); } else { - dc->props = uhci_properties_standalone; + device_class_set_props(dc, uhci_properties_standalone); } u->info = *info; } diff --git a/hw/usb/hcd-xhci-nec.c b/hw/usb/hcd-xhci-nec.c index 05fb3f5..e6a5a22 100644 --- a/hw/usb/hcd-xhci-nec.c +++ b/hw/usb/hcd-xhci-nec.c @@ -44,7 +44,7 @@ static void nec_xhci_class_init(ObjectClass *klass, void *data) PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = nec_xhci_properties; + device_class_set_props(dc, nec_xhci_properties); k->vendor_id = PCI_VENDOR_ID_NEC; k->device_id = PCI_DEVICE_ID_NEC_UPD720200; k->revision = 0x03; diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index fb05de4..b330e36 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -3707,7 +3707,7 @@ static void xhci_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->vmsd = &vmstate_xhci; - dc->props = xhci_properties; + device_class_set_props(dc, xhci_properties); dc->reset = xhci_reset; set_bit(DEVICE_CATEGORY_USB, dc->categories); k->realize = usb_xhci_realize; diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c index 00e0e36..2594700 100644 --- a/hw/usb/host-libusb.c +++ b/hw/usb/host-libusb.c @@ -1635,7 +1635,7 @@ static void usb_host_class_initfn(ObjectClass *klass, void *data) uc->alloc_streams = usb_host_alloc_streams; uc->free_streams = usb_host_free_streams; dc->vmsd = &vmstate_usb_host; - dc->props = usb_host_dev_properties; + device_class_set_props(dc, usb_host_dev_properties); set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); } diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index efdbcc0..45d8b76 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -2584,7 +2584,7 @@ static void usbredir_class_initfn(ObjectClass *klass, void *data) uc->alloc_streams = usbredir_alloc_streams; uc->free_streams = usbredir_free_streams; dc->vmsd = &usbredir_vmstate; - dc->props = usbredir_properties; + device_class_set_props(dc, usbredir_properties); set_bit(DEVICE_CATEGORY_MISC, dc->categories); } diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c index 8fbaa72..8649ac1 100644 --- a/hw/vfio/ap.c +++ b/hw/vfio/ap.c @@ -161,7 +161,7 @@ static void vfio_ap_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = vfio_ap_properties; + device_class_set_props(dc, vfio_ap_properties); dc->vmsd = &vfio_ap_vmstate; dc->desc = "VFIO-based AP device assignment"; set_bit(DEVICE_CATEGORY_MISC, dc->categories); diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c index 3b5520a..50cc2ec 100644 --- a/hw/vfio/ccw.c +++ b/hw/vfio/ccw.c @@ -561,7 +561,7 @@ static void vfio_ccw_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); S390CCWDeviceClass *cdc = S390_CCW_DEVICE_CLASS(klass); - dc->props = vfio_ccw_properties; + device_class_set_props(dc, vfio_ccw_properties); dc->vmsd = &vfio_ccw_vmstate; dc->desc = "VFIO-based subchannel assignment"; set_bit(DEVICE_CATEGORY_MISC, dc->categories); diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 337a173..5e75a95 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -3199,7 +3199,7 @@ static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) PCIDeviceClass *pdc = PCI_DEVICE_CLASS(klass); dc->reset = vfio_pci_reset; - dc->props = vfio_pci_dev_properties; + device_class_set_props(dc, vfio_pci_dev_properties); dc->desc = "VFIO-based PCI device assignment"; set_bit(DEVICE_CATEGORY_MISC, dc->categories); pdc->realize = vfio_realize; @@ -3231,7 +3231,7 @@ static void vfio_pci_nohotplug_dev_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = vfio_pci_dev_nohotplug_properties; + device_class_set_props(dc, vfio_pci_dev_nohotplug_properties); dc->hotpluggable = false; } diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index d7598c6..6b2952c 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -699,7 +699,7 @@ static void vfio_platform_class_init(ObjectClass *klass, void *data) SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass); dc->realize = vfio_platform_realize; - dc->props = vfio_platform_dev_properties; + device_class_set_props(dc, vfio_platform_dev_properties); dc->vmsd = &vfio_platform_vmstate; dc->desc = "VFIO-based platform device assignment"; sbc->connect_irq_notifier = vfio_start_irqfd_injection; diff --git a/hw/virtio/vhost-scsi-pci.c b/hw/virtio/vhost-scsi-pci.c index e8dfbfc..5dce640 100644 --- a/hw/virtio/vhost-scsi-pci.c +++ b/hw/virtio/vhost-scsi-pci.c @@ -64,7 +64,7 @@ static void vhost_scsi_pci_class_init(ObjectClass *klass, void *data) PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass); k->realize = vhost_scsi_pci_realize; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); - dc->props = vhost_scsi_pci_properties; + device_class_set_props(dc, vhost_scsi_pci_properties); pcidev_k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET; pcidev_k->device_id = PCI_DEVICE_ID_VIRTIO_SCSI; pcidev_k->revision = 0x00; diff --git a/hw/virtio/vhost-user-blk-pci.c b/hw/virtio/vhost-user-blk-pci.c index 1dc834a..8d3d766 100644 --- a/hw/virtio/vhost-user-blk-pci.c +++ b/hw/virtio/vhost-user-blk-pci.c @@ -69,7 +69,7 @@ static void vhost_user_blk_pci_class_init(ObjectClass *klass, void *data) PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass); set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); - dc->props = vhost_user_blk_pci_properties; + device_class_set_props(dc, vhost_user_blk_pci_properties); k->realize = vhost_user_blk_pci_realize; pcidev_k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET; pcidev_k->device_id = PCI_DEVICE_ID_VIRTIO_BLOCK; diff --git a/hw/virtio/vhost-user-fs-pci.c b/hw/virtio/vhost-user-fs-pci.c index e3a649d..ae36f11 100644 --- a/hw/virtio/vhost-user-fs-pci.c +++ b/hw/virtio/vhost-user-fs-pci.c @@ -55,7 +55,7 @@ static void vhost_user_fs_pci_class_init(ObjectClass *klass, void *data) PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass); k->realize = vhost_user_fs_pci_realize; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); - dc->props = vhost_user_fs_pci_properties; + device_class_set_props(dc, vhost_user_fs_pci_properties); pcidev_k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET; pcidev_k->device_id = 0; /* Set by virtio-pci based on virtio id */ pcidev_k->revision = 0x00; diff --git a/hw/virtio/vhost-user-fs.c b/hw/virtio/vhost-user-fs.c index ca0b7fc..33b1784 100644 --- a/hw/virtio/vhost-user-fs.c +++ b/hw/virtio/vhost-user-fs.c @@ -271,7 +271,7 @@ static void vuf_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); - dc->props = vuf_properties; + device_class_set_props(dc, vuf_properties); dc->vmsd = &vuf_vmstate; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); vdc->realize = vuf_device_realize; diff --git a/hw/virtio/vhost-user-scsi-pci.c b/hw/virtio/vhost-user-scsi-pci.c index ff13af7..32febb2 100644 --- a/hw/virtio/vhost-user-scsi-pci.c +++ b/hw/virtio/vhost-user-scsi-pci.c @@ -70,7 +70,7 @@ static void vhost_user_scsi_pci_class_init(ObjectClass *klass, void *data) PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass); k->realize = vhost_user_scsi_pci_realize; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); - dc->props = vhost_user_scsi_pci_properties; + device_class_set_props(dc, vhost_user_scsi_pci_properties); pcidev_k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET; pcidev_k->device_id = PCI_DEVICE_ID_VIRTIO_SCSI; pcidev_k->revision = 0x00; diff --git a/hw/virtio/vhost-vsock-pci.c b/hw/virtio/vhost-vsock-pci.c index 4ca097f..01effe3 100644 --- a/hw/virtio/vhost-vsock-pci.c +++ b/hw/virtio/vhost-vsock-pci.c @@ -55,7 +55,7 @@ static void vhost_vsock_pci_class_init(ObjectClass *klass, void *data) PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass); k->realize = vhost_vsock_pci_realize; set_bit(DEVICE_CATEGORY_MISC, dc->categories); - dc->props = vhost_vsock_pci_properties; + device_class_set_props(dc, vhost_vsock_pci_properties); pcidev_k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET; pcidev_k->device_id = PCI_DEVICE_ID_VIRTIO_VSOCK; pcidev_k->revision = 0x00; diff --git a/hw/virtio/vhost-vsock.c b/hw/virtio/vhost-vsock.c index f574436..87c45d8 100644 --- a/hw/virtio/vhost-vsock.c +++ b/hw/virtio/vhost-vsock.c @@ -393,7 +393,7 @@ static void vhost_vsock_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); - dc->props = vhost_vsock_properties; + device_class_set_props(dc, vhost_vsock_properties); dc->vmsd = &vmstate_virtio_vhost_vsock; set_bit(DEVICE_CATEGORY_MISC, dc->categories); vdc->realize = vhost_vsock_device_realize; diff --git a/hw/virtio/virtio-9p-pci.c b/hw/virtio/virtio-9p-pci.c index 22a183c..6507ce3 100644 --- a/hw/virtio/virtio-9p-pci.c +++ b/hw/virtio/virtio-9p-pci.c @@ -61,7 +61,7 @@ static void virtio_9p_pci_class_init(ObjectClass *klass, void *data) pcidev_k->revision = VIRTIO_PCI_ABI_VERSION; pcidev_k->class_id = 0x2; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); - dc->props = virtio_9p_pci_properties; + device_class_set_props(dc, virtio_9p_pci_properties); } static void virtio_9p_pci_instance_init(Object *obj) diff --git a/hw/virtio/virtio-balloon-pci.c b/hw/virtio/virtio-balloon-pci.c index 69ca057..56962ae 100644 --- a/hw/virtio/virtio-balloon-pci.c +++ b/hw/virtio/virtio-balloon-pci.c @@ -59,7 +59,7 @@ static void virtio_balloon_pci_class_init(ObjectClass *klass, void *data) PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass); k->realize = virtio_balloon_pci_realize; set_bit(DEVICE_CATEGORY_MISC, dc->categories); - dc->props = virtio_balloon_pci_properties; + device_class_set_props(dc, virtio_balloon_pci_properties); pcidev_k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET; pcidev_k->device_id = PCI_DEVICE_ID_VIRTIO_BALLOON; pcidev_k->revision = VIRTIO_PCI_ABI_VERSION; diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 57f3b9f..a4729f7 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -932,7 +932,7 @@ static void virtio_balloon_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); - dc->props = virtio_balloon_properties; + device_class_set_props(dc, virtio_balloon_properties); dc->vmsd = &vmstate_virtio_balloon; set_bit(DEVICE_CATEGORY_MISC, dc->categories); vdc->realize = virtio_balloon_device_realize; diff --git a/hw/virtio/virtio-blk-pci.c b/hw/virtio/virtio-blk-pci.c index d9b69a5..efb2c22 100644 --- a/hw/virtio/virtio-blk-pci.c +++ b/hw/virtio/virtio-blk-pci.c @@ -66,7 +66,7 @@ static void virtio_blk_pci_class_init(ObjectClass *klass, void *data) PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass); set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); - dc->props = virtio_blk_pci_properties; + device_class_set_props(dc, virtio_blk_pci_properties); k->realize = virtio_blk_pci_realize; pcidev_k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET; pcidev_k->device_id = PCI_DEVICE_ID_VIRTIO_BLOCK; diff --git a/hw/virtio/virtio-crypto-pci.c b/hw/virtio/virtio-crypto-pci.c index d853dc4..0bebe01 100644 --- a/hw/virtio/virtio-crypto-pci.c +++ b/hw/virtio/virtio-crypto-pci.c @@ -69,7 +69,7 @@ static void virtio_crypto_pci_class_init(ObjectClass *klass, void *data) k->realize = virtio_crypto_pci_realize; set_bit(DEVICE_CATEGORY_MISC, dc->categories); - dc->props = virtio_crypto_pci_properties; + device_class_set_props(dc, virtio_crypto_pci_properties); pcidev_k->class_id = PCI_CLASS_OTHERS; } diff --git a/hw/virtio/virtio-crypto.c b/hw/virtio/virtio-crypto.c index 6d42f95..7351ab0 100644 --- a/hw/virtio/virtio-crypto.c +++ b/hw/virtio/virtio-crypto.c @@ -955,7 +955,7 @@ static void virtio_crypto_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); - dc->props = virtio_crypto_properties; + device_class_set_props(dc, virtio_crypto_properties); dc->vmsd = &vmstate_virtio_crypto; set_bit(DEVICE_CATEGORY_MISC, dc->categories); vdc->realize = virtio_crypto_device_realize; diff --git a/hw/virtio/virtio-input-pci.c b/hw/virtio/virtio-input-pci.c index 80b1172..5a96540 100644 --- a/hw/virtio/virtio-input-pci.c +++ b/hw/virtio/virtio-input-pci.c @@ -60,7 +60,7 @@ static void virtio_input_pci_class_init(ObjectClass *klass, void *data) VirtioPCIClass *k = VIRTIO_PCI_CLASS(klass); PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass); - dc->props = virtio_input_pci_properties; + device_class_set_props(dc, virtio_input_pci_properties); k->realize = virtio_input_pci_realize; set_bit(DEVICE_CATEGORY_INPUT, dc->categories); diff --git a/hw/virtio/virtio-mmio.c b/hw/virtio/virtio-mmio.c index 872f2cd..f12d159 100644 --- a/hw/virtio/virtio-mmio.c +++ b/hw/virtio/virtio-mmio.c @@ -712,7 +712,7 @@ static void virtio_mmio_class_init(ObjectClass *klass, void *data) dc->realize = virtio_mmio_realizefn; dc->reset = virtio_mmio_reset; set_bit(DEVICE_CATEGORY_MISC, dc->categories); - dc->props = virtio_mmio_properties; + device_class_set_props(dc, virtio_mmio_properties); } static const TypeInfo virtio_mmio_info = { diff --git a/hw/virtio/virtio-net-pci.c b/hw/virtio/virtio-net-pci.c index f670aed..5ca71d4 100644 --- a/hw/virtio/virtio-net-pci.c +++ b/hw/virtio/virtio-net-pci.c @@ -68,7 +68,7 @@ static void virtio_net_pci_class_init(ObjectClass *klass, void *data) k->revision = VIRTIO_PCI_ABI_VERSION; k->class_id = PCI_CLASS_NETWORK_ETHERNET; set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); - dc->props = virtio_net_properties; + device_class_set_props(dc, virtio_net_properties); vpciklass->realize = virtio_net_pci_realize; } diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index f723b9f..4cb7843 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1886,7 +1886,7 @@ static void virtio_pci_class_init(ObjectClass *klass, void *data) PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); VirtioPCIClass *vpciklass = VIRTIO_PCI_CLASS(klass); - dc->props = virtio_pci_properties; + device_class_set_props(dc, virtio_pci_properties); k->realize = virtio_pci_realize; k->exit = virtio_pci_exit; k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET; @@ -1925,7 +1925,7 @@ static void virtio_pci_generic_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = virtio_pci_generic_properties; + device_class_set_props(dc, virtio_pci_generic_properties); } static void virtio_pci_transitional_instance_init(Object *obj) diff --git a/hw/virtio/virtio-pmem.c b/hw/virtio/virtio-pmem.c index c0c9395..97287e9 100644 --- a/hw/virtio/virtio-pmem.c +++ b/hw/virtio/virtio-pmem.c @@ -165,7 +165,7 @@ static void virtio_pmem_class_init(ObjectClass *klass, void *data) VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); VirtIOPMEMClass *vpc = VIRTIO_PMEM_CLASS(klass); - dc->props = virtio_pmem_properties; + device_class_set_props(dc, virtio_pmem_properties); vdc->realize = virtio_pmem_realize; vdc->unrealize = virtio_pmem_unrealize; diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c index b498a20..1e363ad 100644 --- a/hw/virtio/virtio-rng.c +++ b/hw/virtio/virtio-rng.c @@ -269,7 +269,7 @@ static void virtio_rng_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); - dc->props = virtio_rng_properties; + device_class_set_props(dc, virtio_rng_properties); dc->vmsd = &vmstate_virtio_rng; set_bit(DEVICE_CATEGORY_MISC, dc->categories); vdc->realize = virtio_rng_device_realize; diff --git a/hw/virtio/virtio-scsi-pci.c b/hw/virtio/virtio-scsi-pci.c index 3c55dc1..e82e7e5 100644 --- a/hw/virtio/virtio-scsi-pci.c +++ b/hw/virtio/virtio-scsi-pci.c @@ -76,7 +76,7 @@ static void virtio_scsi_pci_class_init(ObjectClass *klass, void *data) k->realize = virtio_scsi_pci_realize; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); - dc->props = virtio_scsi_pci_properties; + device_class_set_props(dc, virtio_scsi_pci_properties); pcidev_k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET; pcidev_k->device_id = PCI_DEVICE_ID_VIRTIO_SCSI; pcidev_k->revision = 0x00; diff --git a/hw/virtio/virtio-serial-pci.c b/hw/virtio/virtio-serial-pci.c index 953abbd..22ab4d8 100644 --- a/hw/virtio/virtio-serial-pci.c +++ b/hw/virtio/virtio-serial-pci.c @@ -84,7 +84,7 @@ static void virtio_serial_pci_class_init(ObjectClass *klass, void *data) PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass); k->realize = virtio_serial_pci_realize; set_bit(DEVICE_CATEGORY_INPUT, dc->categories); - dc->props = virtio_serial_pci_properties; + device_class_set_props(dc, virtio_serial_pci_properties); pcidev_k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET; pcidev_k->device_id = PCI_DEVICE_ID_VIRTIO_CONSOLE; pcidev_k->revision = VIRTIO_PCI_ABI_VERSION; diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 7b861e0..2c5410e 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -3713,7 +3713,7 @@ static void virtio_device_class_init(ObjectClass *klass, void *data) dc->realize = virtio_device_realize; dc->unrealize = virtio_device_unrealize; dc->bus_type = TYPE_VIRTIO_BUS; - dc->props = virtio_properties; + device_class_set_props(dc, virtio_properties); vdc->start_ioeventfd = virtio_device_start_ioeventfd_impl; vdc->stop_ioeventfd = virtio_device_stop_ioeventfd_impl; diff --git a/hw/watchdog/cmsdk-apb-watchdog.c b/hw/watchdog/cmsdk-apb-watchdog.c index e6f3b93..1541365 100644 --- a/hw/watchdog/cmsdk-apb-watchdog.c +++ b/hw/watchdog/cmsdk-apb-watchdog.c @@ -371,7 +371,7 @@ static void cmsdk_apb_watchdog_class_init(ObjectClass *klass, void *data) dc->realize = cmsdk_apb_watchdog_realize; dc->vmsd = &cmsdk_apb_watchdog_vmstate; dc->reset = cmsdk_apb_watchdog_reset; - dc->props = cmsdk_apb_watchdog_properties; + device_class_set_props(dc, cmsdk_apb_watchdog_properties); } static const TypeInfo cmsdk_apb_watchdog_info = { diff --git a/hw/watchdog/wdt_aspeed.c b/hw/watchdog/wdt_aspeed.c index f50dab9..6352ba1 100644 --- a/hw/watchdog/wdt_aspeed.c +++ b/hw/watchdog/wdt_aspeed.c @@ -271,7 +271,7 @@ static void aspeed_wdt_class_init(ObjectClass *klass, void *data) dc->reset = aspeed_wdt_reset; set_bit(DEVICE_CATEGORY_MISC, dc->categories); dc->vmsd = &vmstate_aspeed_wdt; - dc->props = aspeed_wdt_properties; + device_class_set_props(dc, aspeed_wdt_properties); } static const TypeInfo aspeed_wdt_info = { diff --git a/hw/xen/xen-bus.c b/hw/xen/xen-bus.c index c2ad22a..919e661 100644 --- a/hw/xen/xen-bus.c +++ b/hw/xen/xen-bus.c @@ -1332,7 +1332,7 @@ static void xen_device_class_init(ObjectClass *class, void *data) dev_class->realize = xen_device_realize; dev_class->unrealize = xen_device_unrealize; - dev_class->props = xen_device_props; + device_class_set_props(dev_class, xen_device_props); dev_class->bus_type = TYPE_XEN_BUS; } diff --git a/hw/xen/xen-legacy-backend.c b/hw/xen/xen-legacy-backend.c index 4412d7aa..4a373b2 100644 --- a/hw/xen/xen-legacy-backend.c +++ b/hw/xen/xen-legacy-backend.c @@ -786,7 +786,7 @@ static void xendev_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = xendev_properties; + device_class_set_props(dc, xendev_properties); set_bit(DEVICE_CATEGORY_MISC, dc->categories); /* xen-backend devices can be plugged/unplugged dynamically */ dc->user_creatable = true; @@ -824,7 +824,7 @@ static void xen_sysdev_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = xen_sysdev_properties; + device_class_set_props(dc, xen_sysdev_properties); dc->bus_type = TYPE_XENSYSBUS; } diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c index 9e767d4..b91082c 100644 --- a/hw/xen/xen_pt.c +++ b/hw/xen/xen_pt.c @@ -964,7 +964,7 @@ static void xen_pci_passthrough_class_init(ObjectClass *klass, void *data) k->config_write = xen_pt_pci_write_config; set_bit(DEVICE_CATEGORY_MISC, dc->categories); dc->desc = "Assign an host PCI device with Xen"; - dc->props = xen_pci_passthrough_properties; + device_class_set_props(dc, xen_pci_passthrough_properties); }; static void xen_pci_passthrough_finalize(Object *obj) diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 6b0e7b2..4065162 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -433,6 +433,8 @@ void qdev_machine_init(void); */ void device_reset(DeviceState *dev); +void device_class_set_props(DeviceClass *dc, Property *props); + void device_class_set_parent_reset(DeviceClass *dc, DeviceReset dev_reset, DeviceReset *parent_reset); diff --git a/migration/migration.c b/migration/migration.c index 990bff0..efd5350 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -3514,7 +3514,7 @@ static void migration_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->user_creatable = false; - dc->props = migration_properties; + device_class_set_props(dc, migration_properties); } static void migration_instance_finalize(Object *obj) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index ffe5de0..5fa6acc 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -4144,7 +4144,7 @@ static void max_x86_cpu_class_init(ObjectClass *oc, void *data) xcc->model_description = "Enables all features supported by the accelerator in the current host"; - dc->props = max_x86_cpu_properties; + device_class_set_props(dc, max_x86_cpu_properties); } static void max_x86_cpu_initfn(Object *obj) @@ -7161,7 +7161,7 @@ static void x86_cpu_common_class_init(ObjectClass *oc, void *data) &xcc->parent_realize); device_class_set_parent_unrealize(dc, x86_cpu_unrealizefn, &xcc->parent_unrealize); - dc->props = x86_cpu_properties; + device_class_set_props(dc, x86_cpu_properties); cpu_class_set_parent_reset(cc, x86_cpu_reset, &xcc->parent_reset); cc->reset_dump_flags = CPU_DUMP_FPU | CPU_DUMP_CCOP; diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 71d88f6..8c90110 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -308,7 +308,7 @@ static void mb_cpu_class_init(ObjectClass *oc, void *data) cc->get_phys_page_debug = mb_cpu_get_phys_page_debug; #endif dc->vmsd = &vmstate_mb_cpu; - dc->props = mb_properties; + device_class_set_props(dc, mb_properties); cc->gdb_num_core_regs = 32 + 5; cc->disas_set_info = mb_disas_set_info; diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c index bbdbc0c..1c0c855 100644 --- a/target/nios2/cpu.c +++ b/target/nios2/cpu.c @@ -187,7 +187,7 @@ static void nios2_cpu_class_init(ObjectClass *oc, void *data) device_class_set_parent_realize(dc, nios2_cpu_realizefn, &ncc->parent_realize); - dc->props = nios2_properties; + device_class_set_props(dc, nios2_properties); cpu_class_set_parent_reset(cc, nios2_cpu_reset, &ncc->parent_reset); cc->class_by_name = nios2_cpu_class_by_name; diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.inc.c index 5ffd07c..2d3efad 100644 --- a/target/ppc/translate_init.inc.c +++ b/target/ppc/translate_init.inc.c @@ -8599,7 +8599,7 @@ POWERPC_FAMILY(POWER7)(ObjectClass *oc, void *data) dc->fw_name = "PowerPC,POWER7"; dc->desc = "POWER7"; - dc->props = powerpc_servercpu_properties; + device_class_set_props(dc, powerpc_servercpu_properties); pcc->pvr_match = ppc_pvr_match_power7; pcc->pcr_mask = PCR_VEC_DIS | PCR_VSX_DIS | PCR_COMPAT_2_05; pcc->pcr_supported = PCR_COMPAT_2_06 | PCR_COMPAT_2_05; @@ -8764,7 +8764,7 @@ POWERPC_FAMILY(POWER8)(ObjectClass *oc, void *data) dc->fw_name = "PowerPC,POWER8"; dc->desc = "POWER8"; - dc->props = powerpc_servercpu_properties; + device_class_set_props(dc, powerpc_servercpu_properties); pcc->pvr_match = ppc_pvr_match_power8; pcc->pcr_mask = PCR_TM_DIS | PCR_COMPAT_2_06 | PCR_COMPAT_2_05; pcc->pcr_supported = PCR_COMPAT_2_07 | PCR_COMPAT_2_06 | PCR_COMPAT_2_05; @@ -8976,7 +8976,7 @@ POWERPC_FAMILY(POWER9)(ObjectClass *oc, void *data) dc->fw_name = "PowerPC,POWER9"; dc->desc = "POWER9"; - dc->props = powerpc_servercpu_properties; + device_class_set_props(dc, powerpc_servercpu_properties); pcc->pvr_match = ppc_pvr_match_power9; pcc->pcr_mask = PCR_COMPAT_2_05 | PCR_COMPAT_2_06 | PCR_COMPAT_2_07; pcc->pcr_supported = PCR_COMPAT_3_00 | PCR_COMPAT_2_07 | PCR_COMPAT_2_06 | @@ -9186,7 +9186,7 @@ POWERPC_FAMILY(POWER10)(ObjectClass *oc, void *data) dc->fw_name = "PowerPC,POWER10"; dc->desc = "POWER10"; - dc->props = powerpc_servercpu_properties; + device_class_set_props(dc, powerpc_servercpu_properties); pcc->pvr_match = ppc_pvr_match_power10; pcc->pcr_mask = PCR_COMPAT_2_05 | PCR_COMPAT_2_06 | PCR_COMPAT_2_07 | PCR_COMPAT_3_00; @@ -10871,7 +10871,7 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data) &pcc->parent_unrealize); pcc->pvr_match = ppc_pvr_match_default; pcc->interrupts_big_endian = ppc_cpu_interrupts_big_endian_always; - dc->props = ppc_cpu_properties; + device_class_set_props(dc, ppc_cpu_properties); cpu_class_set_parent_reset(cc, ppc_cpu_reset, &pcc->parent_reset); diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index d6f1872..8c86ebc 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -492,7 +492,7 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data) #endif /* For now, mark unmigratable: */ cc->vmsd = &vmstate_riscv_cpu; - dc->props = riscv_cpu_properties; + device_class_set_props(dc, riscv_cpu_properties); } char *riscv_isa_string(RISCVCPU *cpu) diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index ca487f5..cf84d30 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -453,7 +453,7 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data) device_class_set_parent_realize(dc, s390_cpu_realizefn, &scc->parent_realize); - dc->props = s390x_cpu_properties; + device_class_set_props(dc, s390x_cpu_properties); dc->user_creatable = true; cpu_class_set_parent_reset(cc, s390_cpu_reset_full, &scc->parent_reset); diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 9c306e5..eeaecbd 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -857,7 +857,7 @@ static void sparc_cpu_class_init(ObjectClass *oc, void *data) device_class_set_parent_realize(dc, sparc_cpu_realizefn, &scc->parent_realize); - dc->props = sparc_cpu_properties; + device_class_set_props(dc, sparc_cpu_properties); cpu_class_set_parent_reset(cc, sparc_cpu_reset, &scc->parent_reset); diff --git a/tests/test-qdev-global-props.c b/tests/test-qdev-global-props.c index 4ed3d06..270c690 100644 --- a/tests/test-qdev-global-props.c +++ b/tests/test-qdev-global-props.c @@ -55,7 +55,7 @@ static void static_prop_class_init(ObjectClass *oc, void *data) DeviceClass *dc = DEVICE_CLASS(oc); dc->realize = NULL; - dc->props = static_props; + device_class_set_props(dc, static_props); } static const TypeInfo static_prop_type = { From patchwork Thu Jan 23 13:48:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1228188 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Y5iWbe2T; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483RX1328Hz9sPW for ; Fri, 24 Jan 2020 02:48:49 +1100 (AEDT) Received: from localhost ([::1]:59718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iueit-0005iu-7S for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 10:48:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51926) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrp-0005eB-6w for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucro-0004bP-5F for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:53 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:50346) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucrn-0004Yl-VA for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:52 -0500 Received: by mail-wm1-x32b.google.com with SMTP id a5so2651069wmb.0 for ; Thu, 23 Jan 2020 05:49:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=X02/VemgHHXV35UWmb1MJdddNEMCdoCFB79eUsdW5b0=; b=Y5iWbe2TwPEBlobL71ujWaHx0k2YzTfplSDTG5nExlL//nu+bt7UbwiH9pfujsXyLc cPpGYNtD9rHQKsMywgmQVDkQRNWMDBx177BJ9VYau3vwKQJ4/vBkcSMFMSEO95wbphja OwaZiSwlXcxpFuopPpPUqxuRd9W3r8ODobdSByg1pyeBXnemP2McPrXnydeHiZP8vIKd qhpR4fS/EPkAU/+vJ/wsDrxY+OXEJ8wO+ZEAcWX9xvi3ip2XsPYs0YPWb/0h610gcxaI aEJouikCNIdmqhEMTB9qBbj/1/3YeyyT+M9aoympaLMzaA1cQSfWqYlnuBZ5pRo4LqUZ lHfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=X02/VemgHHXV35UWmb1MJdddNEMCdoCFB79eUsdW5b0=; b=GvM1PBZD2hvzIa6acQb2H6FCT+Ccj5Aa3QyNyVn9kR2oN0bcHko1g8jrE/HVvPdB39 fC2vTuB4/+foL0Cra8uKNFmFzU6GPxhxZYaYYSskZHbmO0XpH52J0y9VmXy9Lp2vbJtQ 1c/hvvlPqUK6zMlHzmTPS+5jhxQbmPav5jrwcdQjhALrfciIb12gymBM9olei8KkaKcC zbi+IebOUf86u379/156IjOEoKeFPWH+mdrVqFm6qgfWYZwFHmnIoB9OrzwE/Qa9G09l qTE3ldE2aQhHUuF4bUDSQWcQA6QKiVd74oAcvXOMwnpRBnJTSq/iUUjOJTueDG8ETRY5 h1Sg== X-Gm-Message-State: APjAAAVw/j8QvJw3l46aPwQTh5Ksp4jzKdPJjGBP341f219ad5lH6QpI Fgab3k7yvNNhRoRThpjdIO96pJlV X-Google-Smtp-Source: APXvYqzi82jcO2+iP/FF/LMfwpZdZs+UiqkONlTOdXDCtb1x32q/GjSNFwg0Bl3RNF0WyrJWZLC2TA== X-Received: by 2002:a1c:23cf:: with SMTP id j198mr4368161wmj.188.1579787390856; Thu, 23 Jan 2020 05:49:50 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:50 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 50/59] qdev: move instance properties to class properties Date: Thu, 23 Jan 2020 14:48:53 +0100 Message-Id: <1579787342-27146-51-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32b X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Message-Id: <20200110153039.1379601-21-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- hw/core/qdev.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 8047ac9..7abf569 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -944,14 +944,6 @@ static void device_initfn(Object *obj) dev->realized = false; dev->allow_unplug_during_migration = false; - object_property_add_bool(obj, "realized", - device_get_realized, device_set_realized, NULL); - object_property_add_bool(obj, "hotpluggable", - device_get_hotpluggable, NULL, NULL); - object_property_add_bool(obj, "hotplugged", - device_get_hotplugged, NULL, - &error_abort); - class = object_get_class(OBJECT(dev)); do { for (prop = DEVICE_CLASS(class)->props; prop && prop->name; prop++) { @@ -961,9 +953,6 @@ static void device_initfn(Object *obj) class = object_class_get_parent(class); } while (class != object_class_by_name(TYPE_DEVICE)); - object_property_add_link(OBJECT(dev), "parent_bus", TYPE_BUS, - (Object **)&dev->parent_bus, NULL, 0, - &error_abort); QLIST_INIT(&dev->gpios); } @@ -1059,6 +1048,19 @@ static void device_class_init(ObjectClass *class, void *data) dc->hotpluggable = true; dc->user_creatable = true; vc->get_id = device_vmstate_if_get_id; + + object_class_property_add_bool(class, "realized", + device_get_realized, device_set_realized, + &error_abort); + object_class_property_add_bool(class, "hotpluggable", + device_get_hotpluggable, NULL, + &error_abort); + object_class_property_add_bool(class, "hotplugged", + device_get_hotplugged, NULL, + &error_abort); + object_class_property_add_link(class, "parent_bus", TYPE_BUS, + offsetof(DeviceState, parent_bus), NULL, 0, + &error_abort); } void device_class_set_props(DeviceClass *dc, Property *props)