From nobody Wed Feb 11 06:14:47 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977813; cv=none; d=zohomail.com; s=zohoarc; b=WVFBaIqyrFP49GkiVkp33SivLiO2RnJdjvqkra5YYOi1P4gR8uigNtsfpBlbuLVY9n4GLDfmfNZHOC9p4/rog5TZ9J4qAYcSLIm3Nh5yTzdIsMZi82XaG2WpPzN3739IikuWk05PDkiWiQkIn11wQZw9cvvnlc+gOMRJ+LGcXPw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977813; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=z5jMXh0AgvMSbbzSsPF24dLhbhVyf2VnDuH5Ua++icY=; b=e1L2qEsjihNUa33KEiHPU+V8VJTNV5Ax53VsAVLi+jQ8no/lVX2r+hfFgIKCTMcBRnd/4yDjOIguMKn7jfuIhg6LmPyoAPIHkSIwU4VlVJUkcHafmQx13ob4JOMc0Vgwq+mB8GXC5NXYy1A0jqQnJFl73ENOtnPm+cFq4d/oIBM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695977813814758.9163592597835; Fri, 29 Sep 2023 01:56:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9EG-0006Cx-Ss; Fri, 29 Sep 2023 04:52:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9EC-0005pM-Gv for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:52:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9Du-0005nQ-M2 for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:52:02 -0400 Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-217-ABfsF6HGP-ia1bWzet4u0A-1; Fri, 29 Sep 2023 04:51:40 -0400 Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-5334e22b2dbso10918893a12.0 for ; Fri, 29 Sep 2023 01:51:40 -0700 (PDT) Received: from [192.168.1.174] ([151.48.237.81]) by smtp.gmail.com with ESMTPSA id v15-20020a056402174f00b0053631c4958asm1749629edx.22.2023.09.29.01.51.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 01:51:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977501; 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=z5jMXh0AgvMSbbzSsPF24dLhbhVyf2VnDuH5Ua++icY=; b=DM118fjWh/78Op5dfP2tmetBj7TUS0R4EsVkmC83A4DPsNG3eOFfxYiYhaoVPJTOuzegzm rcfVDjt32PQdorJL5WefWP3RQmJuNy4wPDsl8VtDjZx0DzTrw9rx7f4INj3wKSTt4gm/Ku NVovfXsq05EvyO4SAmwJmxFNVnd8Wg4= X-MC-Unique: ABfsF6HGP-ia1bWzet4u0A-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695977498; x=1696582298; 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=z5jMXh0AgvMSbbzSsPF24dLhbhVyf2VnDuH5Ua++icY=; b=GruHK41IM5b8l84PNxQk+yQnMXjvMp//yiKNmM6jL1Idwo5TnAMumZ9rjHtgiOk78D 5rXE3rIZbTQ/58A+s29k+TkdZFN39t7TVJelunV76N/oLwshlrTpFMHbWkkWVXUbfZE5 UID9eD7cQUVc8WFeTVxjzaRT6HCR1eu1Zc3j2UFqMDYTXAuVcHSzg+WUI8eunpauziP9 3czt53E5GLrckGXPHNq4pvvReUq572GE/lgO5VOZvTgKOtME+dzOrLpHdPT5wYxVLcVL DAGIlYosDCxFOJeNVxgGnuytIHcs0+pMxrAZAOP8keZQuAmm9ij9pWCg+c3BJ4JKh1gC CoGw== X-Gm-Message-State: AOJu0Yw4swLPzn0A0tbalhj0JtjjRZefQ35QGroqaKbMJ4QPvRB2F0vd 6IvohIe6i2cTSkKcKXjHZh6jaZK81fSgnTacMWLVMCKA7xUEPJsXMNoCZU+ibXCNn/jTHwHajc2 //T0op+5zyz3JehR9JyGzz0+cpMdfLeLODJ09mJqgvX4/m3YA/nIKI78JNVTMw5aLDLhWIpFpFA s= X-Received: by 2002:aa7:d48f:0:b0:530:a61f:ed1 with SMTP id b15-20020aa7d48f000000b00530a61f0ed1mr2954593edr.42.1695977498339; Fri, 29 Sep 2023 01:51:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF1rNU9b2o1IizNvAqUoj8xO5RTaWNurb1OOeR5YjpP5MGJYYwA2p3aUqmOBkh45098IfgQmw== X-Received: by 2002:aa7:d48f:0:b0:530:a61f:ed1 with SMTP id b15-20020aa7d48f000000b00530a61f0ed1mr2954580edr.42.1695977498041; Fri, 29 Sep 2023 01:51:38 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: berrange@redhat.com, balaton@eik.bme.hu Subject: [PATCH v3 11/14] vt82c686: Support machine-default audiodev with fallback Date: Fri, 29 Sep 2023 10:51:04 +0200 Message-ID: <20230929085112.983957-12-pbonzini@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230929085112.983957-1-pbonzini@redhat.com> References: <20230929085112.983957-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1695977815485100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini Reviewed-by: BALATON Zoltan --- hw/mips/fuloong2e.c | 15 ++++++++++++--- hw/ppc/pegasos2.c | 12 ++++++++++-- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c index c827f615f3b..c6109633fee 100644 --- a/hw/mips/fuloong2e.c +++ b/hw/mips/fuloong2e.c @@ -295,9 +295,17 @@ static void mips_fuloong2e_init(MachineState *machine) pci_bus =3D bonito_init((qemu_irq *)&(env->irq[2])); =20 /* South bridge -> IP5 */ - pci_dev =3D pci_create_simple_multifunction(pci_bus, - PCI_DEVFN(FULOONG2E_VIA_SLOT= , 0), - TYPE_VT82C686B_ISA); + pci_dev =3D pci_new_multifunction(PCI_DEVFN(FULOONG2E_VIA_SLOT, 0), + TYPE_VT82C686B_ISA); + + /* Set properties on individual devices before realizing the south bri= dge */ + if (machine->audiodev) { + dev =3D DEVICE(object_resolve_path_component(OBJECT(pci_dev), "ac9= 7")); + qdev_prop_set_string(dev, "audiodev", machine->audiodev); + } + + pci_realize_and_unref(pci_dev, pci_bus, &error_abort); + object_property_add_alias(OBJECT(machine), "rtc-time", object_resolve_path_component(OBJECT(pci_dev= ), "rtc"), @@ -337,6 +345,7 @@ static void mips_fuloong2e_machine_init(MachineClass *m= c) mc->default_ram_size =3D 256 * MiB; mc->default_ram_id =3D "fuloong2e.ram"; mc->minimum_page_bits =3D 14; + machine_add_audiodev_property(mc); } =20 DEFINE_MACHINE("fuloong2e", mips_fuloong2e_machine_init) diff --git a/hw/ppc/pegasos2.c b/hw/ppc/pegasos2.c index bd397cf2b5c..3203a4a7289 100644 --- a/hw/ppc/pegasos2.c +++ b/hw/ppc/pegasos2.c @@ -180,8 +180,15 @@ static void pegasos2_init(MachineState *machine) pci_bus_irqs(pci_bus, pegasos2_pci_irq, pm, PCI_NUM_PINS); =20 /* VIA VT8231 South Bridge (multifunction PCI device) */ - via =3D OBJECT(pci_create_simple_multifunction(pci_bus, PCI_DEVFN(12, = 0), - TYPE_VT8231_ISA)); + via =3D OBJECT(pci_new_multifunction(PCI_DEVFN(12, 0), TYPE_VT8231_ISA= )); + + /* Set properties on individual devices before realizing the south bri= dge */ + if (machine->audiodev) { + dev =3D PCI_DEVICE(object_resolve_path_component(via, "ac97")); + qdev_prop_set_string(DEVICE(dev), "audiodev", machine->audiodev); + } + + pci_realize_and_unref(PCI_DEVICE(via), pci_bus, &error_abort); for (i =3D 0; i < PCI_NUM_PINS; i++) { pm->via_pirq[i] =3D qdev_get_gpio_in_named(DEVICE(via), "pirq", i); } @@ -556,6 +563,7 @@ static void pegasos2_machine_class_init(ObjectClass *oc= , void *data) mc->default_cpu_type =3D POWERPC_CPU_TYPE_NAME("7457_v1.2"); mc->default_ram_id =3D "pegasos2.ram"; mc->default_ram_size =3D 512 * MiB; + machine_add_audiodev_property(mc); =20 vhc->cpu_in_nested =3D pegasos2_cpu_in_nested; vhc->hypercall =3D pegasos2_hypercall; --=20 2.41.0