From nobody Tue Sep 9 03:16:10 2025 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=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1748246336; cv=none; d=zohomail.com; s=zohoarc; b=B5DFcikZBGPnR3HB2c3omqXqnZJO4sobFyjDP3SAfF4wTEgHqpPhTRuSpzWA1OELasMN2YpowfRCzuoYANr9BMnCwRfB0nE10XEIJBrLmtNiuI1dvZ6cjx09pCsQXudO8TO7CqqA+3k9V/TxQiJ2Yne/FsMAuSbp9RDhfZQaxW0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748246336; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=EcXGcpSOQoMjDM3qFnxtNH3LA4fwREbOchZFBoIOvF8=; b=L7Ep32CPQLfnGUNZmL3YMB4rZp0GB5Zx2X1IkDhiojUski2mP8cAWUdMUw2eYjhFcngffLq95ujQ670pqYtnaJOKsJ259YEWamEMq1wjwwg6g4nIsqtkWP6F9E2pvRk8EV6lQicVs+tvCXdQTh3AOExmVho/uefSyH3LTxcM2Ls= ARC-Authentication-Results: i=1; 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=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1748246336820517.3221211897659; Mon, 26 May 2025 00:58:56 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id DE8A21635; Mon, 26 May 2025 03:58:55 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 2E4A8173E; Mon, 26 May 2025 03:57:41 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id BF41E13B4; Mon, 26 May 2025 03:57:34 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 3E447147D for ; Mon, 26 May 2025 03:57:34 -0400 (EDT) Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-47-vIo9q3cBO86FcMnFfM-iSA-1; Mon, 26 May 2025 03:57:32 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9EDD019560A1 for ; Mon, 26 May 2025 07:57:31 +0000 (UTC) Received: from speedmetal.lan (unknown [10.44.22.3]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E1DC6195608D for ; Mon, 26 May 2025 07:57:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,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=redhat.com; s=mimecast20190719; t=1748246254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=irGPuSqPSodIJWUaNKfqm4hN8LBKI1yp6uFi923WjQE=; b=FNIAGpK6t8Xpx/7HDkl2JnLKkzyoY/s25Z7q+5gG4lVKr4dgs+2TUuy3AJbSgo5ESeW36e OTfk1y0fLUyW6o8XjMdDxtM9eQvvSS+1RvO6QE40rg76eK9Oh4cpsau26mOXiWEPsQX5Sm ncRHh0SSesoWIuyOyYjQuTeWrBmBm5s= X-MC-Unique: vIo9q3cBO86FcMnFfM-iSA-1 X-Mimecast-MFC-AGG-ID: vIo9q3cBO86FcMnFfM-iSA_1748246251 To: devel@lists.libvirt.org Subject: [PATCH 2/4] qemu: Move floppy device support validation to validation code Date: Mon, 26 May 2025 09:57:24 +0200 Message-ID: <001ad864011b954e645cc72783d9d5b18dc2d225.1748246185.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: iVc14GHF_EgIMx7wFKt2SbYoeZnUc5M6XR8ROUkHAZM_1748246251 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: HGDMSHMDDEFZ4DJXF3KPP5RJGMK2JRNX X-Message-ID-Hash: HGDMSHMDDEFZ4DJXF3KPP5RJGMK2JRNX X-MailFrom: pkrempa@redhat.com 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; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header 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: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1748246337355116600 Content-Type: text/plain; charset="utf-8" From: Peter Krempa Move the validation from qemuProcessStartValidateDisks to qemuValidateDomainDeviceDefDiskFrontend and adjust the test case which now fails a bit earlier, thus no output XML is needed. Signed-off-by: Peter Krempa --- src/qemu/qemu_process.c | 7 --- src/qemu/qemu_validate.c | 7 +++ .../disk-floppy-pseries.ppc64-latest.xml | 44 ------------------- tests/qemuxmlconftest.c | 2 +- 4 files changed, 8 insertions(+), 52 deletions(-) delete mode 100644 tests/qemuxmlconfdata/disk-floppy-pseries.ppc64-latest.= xml diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 7e444bb8b4..54b84922d6 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5620,13 +5620,6 @@ qemuProcessStartValidateDisks(virDomainObj *vm, return -1; } - if (disk->device =3D=3D VIR_DOMAIN_DISK_DEVICE_FLOPPY && - !qemuDomainMachineSupportsFloppy(vm->def->os.machine, qemuCaps= )) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("this machine type do not support floppy devi= ces")); - return -1; - } - if (src->type =3D=3D VIR_STORAGE_TYPE_NVME && !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE_NVME)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 87588024ce..e45f636418 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -3008,6 +3008,13 @@ qemuValidateDomainDeviceDefDiskFrontend(const virDom= ainDiskDef *disk, return -1; } + if (disk->device =3D=3D VIR_DOMAIN_DISK_DEVICE_FLOPPY && + !qemuDomainMachineSupportsFloppy(def->os.machine, qemuCaps)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("this machine type do not support floppy devices"= )); + return -1; + } + if (disk->copy_on_read =3D=3D VIR_TRISTATE_SWITCH_ON) { if (disk->src->readonly) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, diff --git a/tests/qemuxmlconfdata/disk-floppy-pseries.ppc64-latest.xml b/t= ests/qemuxmlconfdata/disk-floppy-pseries.ppc64-latest.xml deleted file mode 100644 index 9a5490c9fe..0000000000 --- a/tests/qemuxmlconfdata/disk-floppy-pseries.ppc64-latest.xml +++ /dev/null @@ -1,44 +0,0 @@ - - QEMUGuest1 - c7a5fdbd-edaf-9455-926a-d65c16db1809 - 219136 - 219136 - 1 - - hvm - - - - POWER10 - - - destroy - restart - destroy - - /usr/bin/qemu-system-ppc64 - - - - -
- - - - - -
- - -
- - - - - - -