From nobody Tue Dec 24 13:47:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1734622991906123.56895549326657; Thu, 19 Dec 2024 07:43:11 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id F1B6F16F4; Thu, 19 Dec 2024 10:43:10 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 57F9A178D; Thu, 19 Dec 2024 10:40:15 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 16F7816FD; Thu, 19 Dec 2024 10:40:11 -0500 (EST) Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id C34D11752 for ; Thu, 19 Dec 2024 10:39:56 -0500 (EST) Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-385e27c75f4so740531f8f.2 for ; Thu, 19 Dec 2024 07:39:56 -0800 (PST) Received: from localhost.localdomain ([78.196.4.158]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4364a376846sm79508525e9.0.2024.12.19.07.39.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Dec 2024 07:39:55 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734622795; x=1735227595; darn=lists.libvirt.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8jM7iK7CzjLBlq0GL2o2lmBr4BfhFWF4uDH24qr2bSs=; b=nUQpqFZJWzJjTKgCooOzHr230INLNThyJtIkrMLknhnWcoUbrP2RMcSq3A8ulZ+Wke EVAcJJjGx+J6Ly5tW4ak6cgPSR41UxV6LGT/YVSDAgWxg+U2M8Z4vzbNb6ObLXpxJMZH sdLoa6E3A45bKhTfM6NkKoFPek5x+6sbLIQj+OFDbjBQAFwogBK0+ZzXck9Bs4YGzECG TdHqR1SfZG9bN2V/HNIPjFFpL7KZ8rRcsh5+/v2B/q+d8Z5SpPi0h8ufCRxpzZXiWaaQ 0/QSkd7fbDe4wZR1wZNiF1eU/x0+Mhq1vHyz0oOIE4Imsvyu4nhWuye/wpQ1osXJWrsn XAyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734622795; x=1735227595; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8jM7iK7CzjLBlq0GL2o2lmBr4BfhFWF4uDH24qr2bSs=; b=PYtPTKDrRtQ/f7Vc/2AbTd/oQsgQIFmXPG9qk3fx/pZ0dQw6YyJMyY7ZIFIwfFHka0 3UPhBvwWm1AeC3IIzQbYRLuRy1UuR3I/YelRM0GKDL4PxE36dD7l6h+Q0s/eaAau7egN zWxDj/GjYdE8xu7omyQkUHC+SuJjzBRujT7ODjaVl7ryB2JF+t4jeKZuhqThtpqPHdAG XsZCGPPGo3YJx0na9dZVxnLD6x1xwlUeO5PgZzObs0wOl4jGiAyg63WG7GdAz+R0O4Mw oYPv22KxdIe0g5kx1XOgLbK1CfRb5Wl30OAZm8uQxOt7y7k862k9itq8d8ja0HaFu/z0 yfHw== X-Forwarded-Encrypted: i=1; AJvYcCUEYuhksZlVLoWpqVZZMQuIMH/aEC23Mw0kb/IrMWsHjG+u1rGsRuNGB8HzFGhoQ8KPcLgwQA==@lists.libvirt.org X-Gm-Message-State: AOJu0YwYuoHoaqDYLjJTvVLKQeYU8Mh4rPlssXOJ33E/JGD97QtPGoQ9 5pUSFsuZssf1ieP1o5JDpvudwfIfs8li9a6+3SjAc2avHESUv/1xxH86tRk+tsA= X-Gm-Gg: ASbGncuikMToN96/P4PffSGIKOP3vMKea3mRjRfTQQB+j3RXVLw1Qy3DMOjdDL49Xbk 1w7vCvbi2KTU6NqHW0zFDDDB2WP0yCdCtI/gavS/D2ypT9EQyPoqQZILnGjP6Y5qoQmwJu6w/oZ nBSF/FdW3POevvZdsrm9xb4GaNMedk0OjBWpN/6P9c9nguH6yUo3fGzaHUe0cVMDdjbCGVAs+/U yoiFXkvI/95mdwAPjrV1+5JKRrSMTPWIf5C7GRfsg60CDqUj+w9cLvk7J/45anJOjeGL3PRNwKB mfkN X-Google-Smtp-Source: AGHT+IFDP3fNJA6xBv/hfaKPgC0bZEnVC+6UMLDZJxil0bxoO2WYS57R0WmK+DgL2vSBssckSHhikA== X-Received: by 2002:a05:6000:178b:b0:386:3835:9fec with SMTP id ffacd0b85a97d-388e4d8fbc0mr7568848f8f.44.1734622795613; Thu, 19 Dec 2024 07:39:55 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [RFC PATCH-for-10.2 10/10] hw/misc/vmcoreinfo: Remove legacy '-device vmcoreinfo' Date: Thu, 19 Dec 2024 16:38:57 +0100 Message-ID: <20241219153857.57450-11-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241219153857.57450-1-philmd@linaro.org> References: <20241219153857.57450-1-philmd@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: GZOWYQRZNG33E6DGXPKD5KTRNHF722HH X-Message-ID-Hash: GZOWYQRZNG33E6DGXPKD5KTRNHF722HH X-MailFrom: philmd@linaro.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0 CC: Ani Sinha , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , devel@lists.libvirt.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1734622993909116600 Content-Type: text/plain; charset="utf-8" Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- docs/about/deprecated.rst | 5 ---- docs/about/removed-features.rst | 5 ++++ include/hw/misc/vmcoreinfo.h | 3 +-- hw/misc/vmcoreinfo.c | 44 ++++++--------------------------- 4 files changed, 13 insertions(+), 44 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 57a3d734081..d6809f94ea1 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -79,11 +79,6 @@ described with -smp are supported by the target machine. =20 Use ``-run-with user=3D..`` instead. =20 -``-device vmcoreinfo`` (since 10.0) -''''''''''''''''''''''''''''''''''' - -Use ``-object vmcore-info`` instead. - =20 User-mode emulator command line arguments ----------------------------------------- diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.= rst index cb1388049a8..6fedf13c133 100644 --- a/docs/about/removed-features.rst +++ b/docs/about/removed-features.rst @@ -555,6 +555,11 @@ to produce an odd effect (rotating input but not displ= ay output). But this was never intended or documented behaviour, so we have dropped the options along with the machine models they were intended for. =20 +``-device vmcoreinfo`` (removed in 10.2) +'''''''''''''''''''''''''''''''''''''''' + +``-device vmcoreinfo`` has been replaced by ``-object vmcore-info``. + User-mode emulator command line arguments ----------------------------------------- =20 diff --git a/include/hw/misc/vmcoreinfo.h b/include/hw/misc/vmcoreinfo.h index d4cce42cee6..56af12d33a4 100644 --- a/include/hw/misc/vmcoreinfo.h +++ b/include/hw/misc/vmcoreinfo.h @@ -12,7 +12,6 @@ #ifndef VMCOREINFO_H #define VMCOREINFO_H =20 -#include "hw/qdev-core.h" #include "standard-headers/linux/qemu_fw_cfg.h" #include "qom/object.h" =20 @@ -26,7 +25,7 @@ DECLARE_INSTANCE_CHECKER(VMCoreInfoState, VMCOREINFO_DEVI= CE, typedef struct fw_cfg_vmcoreinfo FWCfgVMCoreInfo; =20 struct VMCoreInfoState { - DeviceState parent_obj; + Object parent_obj; =20 bool has_vmcoreinfo; FWCfgVMCoreInfo vmcoreinfo; diff --git a/hw/misc/vmcoreinfo.c b/hw/misc/vmcoreinfo.c index e2258e08fb1..36d1143722e 100644 --- a/hw/misc/vmcoreinfo.c +++ b/hw/misc/vmcoreinfo.c @@ -54,8 +54,9 @@ static void vmcoreinfo_reset_hold(Object *obj, ResetType = type) s->vmcoreinfo.host_format =3D cpu_to_le16(FW_CFG_VMCOREINFO_FORMAT_ELF= ); } =20 -static void vmcoreinfo_realize(VMCoreInfoState *s, Error **errp) +static void vmcoreinfo_complete(UserCreatable *uc, Error **errp) { + VMCoreInfoState *s =3D VMCOREINFO(uc); FWCfgState *fw_cfg =3D fw_cfg_find(); /* for gdb script dump-guest-memory.py */ static VMCoreInfoState * volatile vmcoreinfo_state G_GNUC_UNUSED; @@ -76,6 +77,10 @@ static void vmcoreinfo_realize(VMCoreInfoState *s, Error= **errp) return; } =20 + if (vmstate_register_any(VMSTATE_IF(s), &vmstate_vmcoreinfo, s) < 0) { + error_setg(errp, "%s: Failed to register vmstate", TYPE_VMCOREINFO= ); + } + fw_cfg_add_file_callback(fw_cfg, FW_CFG_VMCOREINFO_FILENAME, NULL, fw_cfg_vmci_write, s, &s->vmcoreinfo, sizeof(s->vmcoreinfo), false); @@ -88,25 +93,11 @@ static void vmcoreinfo_realize(VMCoreInfoState *s, Erro= r **errp) vmcoreinfo_state =3D s; } =20 -static void vmcoreinfo_device_realize(DeviceState *dev, Error **errp) -{ - vmcoreinfo_realize(VMCOREINFO_DEVICE(dev), errp); -} - static bool vmcoreinfo_can_be_deleted(UserCreatable *uc) { return false; } =20 -static void vmcoreinfo_complete(UserCreatable *uc, Error **errp) -{ - if (vmstate_register_any(VMSTATE_IF(uc), &vmstate_vmcoreinfo, uc) < 0)= { - error_setg(errp, "%s: Failed to register vmstate", TYPE_VMCOREINFO= ); - } - - vmcoreinfo_realize(VMCOREINFO(uc), errp); -} - static void vmcoreinfo_class_init(ObjectClass *oc, void *data) { UserCreatableClass *ucc =3D USER_CREATABLE_CLASS(oc); @@ -119,25 +110,7 @@ static void vmcoreinfo_class_init(ObjectClass *oc, voi= d *data) rc->phases.hold =3D vmcoreinfo_reset_hold; } =20 -static void vmcoreinfo_device_class_init(ObjectClass *klass, void *data) -{ - DeviceClass *dc =3D DEVICE_CLASS(klass); - ResettableClass *rc =3D RESETTABLE_CLASS(klass); - - dc->vmsd =3D &vmstate_vmcoreinfo; - dc->realize =3D vmcoreinfo_device_realize; - dc->hotpluggable =3D false; - set_bit(DEVICE_CATEGORY_MISC, dc->categories); - rc->phases.hold =3D vmcoreinfo_reset_hold; -} - static const TypeInfo vmcoreinfo_types[] =3D { - { - .name =3D TYPE_VMCOREINFO_DEVICE, - .parent =3D TYPE_DEVICE, - .instance_size =3D sizeof(VMCoreInfoState), - .class_init =3D vmcoreinfo_device_class_init, - }, { .name =3D TYPE_VMCOREINFO, .parent =3D TYPE_OBJECT, @@ -158,10 +131,7 @@ VMCoreInfoState *vmcoreinfo_find(void) { Object *obj; =20 - obj =3D object_resolve_path_type("", TYPE_VMCOREINFO_DEVICE, NULL); - if (!obj) { - obj =3D object_resolve_path_type("", TYPE_VMCOREINFO, NULL); - } + obj =3D object_resolve_path_type("", TYPE_VMCOREINFO, NULL); =20 return obj ? (VMCoreInfoState *)obj : NULL; } --=20 2.47.1