Received: by 2002:a17:906:c8d8:b0:a3e:79c1:d636 with SMTP id gc24csp2175004ejb; Wed, 21 Feb 2024 13:21:35 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXUyFAMMDLntI3MzV6ic1RrN3CZ+8I8vj/s2Mgfcd7sa3B4Xvy2PP8gQxvNFZ/uf4Fc7cl/dSuF8dkBNsW8eibr1ziuzz+l X-Google-Smtp-Source: AGHT+IGVkjVfQ6oNXCOc8PbdtVRsm6z6/eYh15gVxxelNagKlIBHIdkTXBs9HFf+bROSN+Y0TdMp X-Received: by 2002:a05:6214:501c:b0:68f:b9b7:9c53 with SMTP id jo28-20020a056214501c00b0068fb9b79c53mr4848qvb.28.1708550494868; Wed, 21 Feb 2024 13:21:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708550494; cv=none; d=google.com; s=arc-20160816; b=t837ac4l8ABiVVF/bB6j3uZ2/7ux8sY93MKaEQJoWHQAZBSIBi8RPUnkf04387gyzO SyKH55pd+ri+RQ7t5sG07EE0gw/jblbogT2E2oHIpuiOF/FjyjuriqENMIkfiVvVwmyE o3E9Ha1CaIIdE3wXkmc9E8EXsvz4tIFFj3LD8niiOMOzQXP4aLJhrd/nm4uWPns2fO1g CDk/TlYH6MVukBhQ8UEa6jyqroL1O0zlMefhyN8P1rLATuFwz37qEP2qs+++sTqdBeyj AlOmNczJuBu1nIyQ/7B4xf2VLw6Eon2fZgXRqb1mofUVYMbYrI2hU6mqaC4GBINHPP/b tyKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XwtVJOAzHCvEh5zeHnf1CnqeZsBBSTY3uRRfR/7NLW8=; fh=oiq67qnM8BqA32ksqeHh/BJ2xCOd1MIE3GFJJBbt894=; b=BlXr/JvGl2tn3MkYxqAx563ANS/yyCn1/QGhKuowa2BmO2AOAH5UmwQmBn2/LEWfXe XuAfceLQnP+W5IyUtAzPRLEMVZ1Z5mtPlCdPDxUWGIq0aIYnH89o/qWnQ0gUUkJdv4fO fWvOVn7mqj9+v7a9DC8stHHYb/Byp5pkOghGDZTawpVSFwjpL81s8DQDpuWbYr1BzdI/ 735meDow2bFt579Qk1BOm6KpZinyHa8rWYYJHwEKtg6Z4zb8JzjhFmVTILFIO/AftITQ 7BW9M25caswfD2s5ENlHcb8+gsvHECJNXKYTdcMgN3AgmsDZdSnbB3nL6xZLlWrlGAmz 8pgQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=k7M65HuW; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c5-20020a056214224500b00681da55cc3fsi12314232qvc.249.2024.02.21.13.21.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 13:21:34 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=k7M65HuW; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rctyv-0006yI-7m; Wed, 21 Feb 2024 16:18:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rctys-0006gN-F1 for qemu-arm@nongnu.org; Wed, 21 Feb 2024 16:18:18 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rctyk-00014s-E9 for qemu-arm@nongnu.org; Wed, 21 Feb 2024 16:18:18 -0500 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3392b12dd21so828722f8f.0 for ; Wed, 21 Feb 2024 13:18:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708550288; x=1709155088; darn=nongnu.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=XwtVJOAzHCvEh5zeHnf1CnqeZsBBSTY3uRRfR/7NLW8=; b=k7M65HuWfT9rTjKKBypVlcMJ9HLsgS5D4kI4RIA7ar37Rs83OXjglwFLBFGuckfrKT K0/GaQDUZYikOb1xMR4I9JRT6ZazJhmpQof7qF3xXHVkkq2f017wWkbqFsDqUtgwSxmB pq8LeEBq8igyzdleE9sWRFUN5/oD2dVtVrK4U6yGW8V/9snw8eWiRIPPm3LfxylJSyw1 9FYGnZXFtrrcQKMnMTTVtNBlUgXdyCLX1cE8KMKdO2e//d2Z1gPpzKcmDg8qfP8A6hk0 Fk6ILIXzWPD++VqBRvqRYbpEVMgHKIfInFk7DpaYdsc5lUZiZ1X08/JIuGURkCGtUsfU vS3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550288; x=1709155088; 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=XwtVJOAzHCvEh5zeHnf1CnqeZsBBSTY3uRRfR/7NLW8=; b=OWT3zIF1eSq38Xnvq+230RoBp8kquU4EGi7Pw5WjZPy40Pu54gCtqqwmWrKLzUFhJ+ 0l8ftDv2J4mJ0Zob4Ci4LkcWrH0NdX1du5Tzv9igz+4R6dZWoWoPiiLSMrTaC1UevQzT TrSARjflrMX1Iujmd3A9HqZfRnUMI1Hq3rQf2tb9g4JrgF5SzWYV4N5W4BSYYYud9eHS Q3xnm+5FqO7Orcm8d7o5VOe6h/hUU0w5ZK/xlIkldeNQT5JQkPJMJTiAt+9Ssf90HMN8 l41udAl8LUWqPYxot5c9p4+3a4r4CSDfC2uIwzgodoqeu9YrPPTEovgijH6YnqyHCjw4 ckng== X-Gm-Message-State: AOJu0Yy7NbNF5LTckWE1lsFxbSGZBIYQkFOvMrvx68ts4ES4DNcC+fSq gvDee0ab8Q1KhmcU5XYM9RVEuui9rQ+YH8VCw48eseiinp6umX6v5PfVUYOVr34TumJZJnNATKG OttA= X-Received: by 2002:a05:6000:184a:b0:33d:6b89:fbbb with SMTP id c10-20020a056000184a00b0033d6b89fbbbmr4816826wri.47.1708550288697; Wed, 21 Feb 2024 13:18:08 -0800 (PST) Received: from m1x-phil.lan ([176.187.211.34]) by smtp.gmail.com with ESMTPSA id bx14-20020a5d5b0e000000b0033d6bd4eab9sm6920318wrb.1.2024.02.21.13.18.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 21 Feb 2024 13:18:08 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Bernhard Beschow , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PULL 12/25] hw/i386/pc: Merge pc_guest_info_init() into pc_machine_initfn() Date: Wed, 21 Feb 2024 22:16:12 +0100 Message-ID: <20240221211626.48190-13-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240221211626.48190-1-philmd@linaro.org> References: <20240221211626.48190-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org X-TUID: XqeS7UoVuLrS From: Bernhard Beschow Resolves redundant code in the piix and q35 machines. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240208220349.4948-5-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- include/hw/i386/pc.h | 2 -- hw/i386/pc.c | 9 +++------ hw/i386/pc_piix.c | 2 -- hw/i386/pc_q35.c | 2 -- 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index cf2fa60868..39cdb9b933 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -154,8 +154,6 @@ extern int fd_bootchk; void pc_acpi_smi_interrupt(void *opaque, int irq, int level); -void pc_guest_info_init(PCMachineState *pcms); - #define PCI_HOST_PROP_RAM_MEM "ram-mem" #define PCI_HOST_PROP_PCI_MEM "pci-mem" #define PCI_HOST_PROP_SYSTEM_MEM "system-mem" diff --git a/hw/i386/pc.c b/hw/i386/pc.c index d7183780bd..694de8e130 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -698,12 +698,6 @@ void pc_machine_done(Notifier *notifier, void *data) pc_cmos_init_late(pcms); } -void pc_guest_info_init(PCMachineState *pcms) -{ - pcms->machine_done.notify = pc_machine_done; - qemu_add_machine_init_done_notifier(&pcms->machine_done); -} - /* setup pci memory address space mapping into system address space */ void pc_pci_as_mapping_init(MemoryRegion *system_memory, MemoryRegion *pci_address_space) @@ -1744,6 +1738,9 @@ static void pc_machine_initfn(Object *obj) object_property_add_alias(OBJECT(pcms), "pcspk-audiodev", OBJECT(pcms->pcspk), "audiodev"); cxl_machine_init(obj, &pcms->cxl_devices_state); + + pcms->machine_done.notify = pc_machine_done; + qemu_add_machine_init_done_notifier(&pcms->machine_done); } static void pc_machine_reset(MachineState *machine, ShutdownCause reason) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index bea096f569..eeca725504 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -225,8 +225,6 @@ static void pc_init1(MachineState *machine, &error_abort); } - pc_guest_info_init(pcms); - if (pcmc->smbios_defaults) { MachineClass *mc = MACHINE_GET_CLASS(machine); /* These values are guest ABI, do not change */ diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 0e9bd27a6e..8053d8cccb 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -188,8 +188,6 @@ static void pc_q35_init(MachineState *machine) kvmclock_create(pcmc->kvmclock_create_always); } - pc_guest_info_init(pcms); - if (pcmc->smbios_defaults) { /* These values are guest ABI, do not change */ smbios_set_defaults("QEMU", mc->desc, -- 2.41.0