From nobody Sun Dec 14 06:21:56 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=1750709315; cv=none; d=zohomail.com; s=zohoarc; b=kV4looWYdAemoyufFcejhyxpxy1ak2mVrDf74MSClzwuEvcm0RmRgVAJo/JpIBPXzwdiV43o4nxbetQarQf1NPYXIG2urH9eH9gkNNDSkxwi+qtur69dTNsQ3fmYZ7W2bZuC+FyFW50BFKtLYgoOYPQuDsC5ElhZJTxa8qoCw3Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1750709315; 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=kFpuySlzt2L3Zejdb9pZHNGVyjOSL4m3LwlVh2c0uf8=; b=Rerkklw5IvJJzllln8LKt40JBZKLgUiR7E1lonuvP+nilFlrcv0szeXejyv5UaFxPnhEr/vxKAXEjutmIwkq1JYOx2D0pmhk8G8AT7FOVAV9ZMnMYNqll99u5OrOjZInVHnZHr8rvpeA31BUueLcnl4butsQnKsNSw/i5z++jhQ= 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 1750709315705793.7203957764394; Mon, 23 Jun 2025 13:08:35 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id AAC7612F7; Mon, 23 Jun 2025 16:08:34 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 1BEBFC5F; Mon, 23 Jun 2025 16:00:15 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 51395126B; Mon, 23 Jun 2025 16:00:09 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 AE9881122 for ; Mon, 23 Jun 2025 15:59:39 -0400 (EDT) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-308-V_364xV8NreiMslqldmP-g-1; Mon, 23 Jun 2025 15:59:37 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 98CC6180034E for ; Mon, 23 Jun 2025 19:59:36 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.5]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D37AD19560A3 for ; Mon, 23 Jun 2025 19:59:35 +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=1750708779; 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=XuxarlutUflU47NgN14ZN965VgQ/EmHkT+AX/CDW/Vg=; b=NfAW358ZjpzleBh9d/NIcX/IPgEgmgB7bPgqMphFOOrM9a/dANpWhv/dycKp9ewFHYuRlB H4EmXturXAo5Waxps2mPf6KFtQkGRfCWIp2CTTdW3ZhcBHh+2jA8vS5RRLGWIUHk5rzr4C Zi9AlVBLuWxgstalpcJ5jWJrltrDtec= X-MC-Unique: V_364xV8NreiMslqldmP-g-1 X-Mimecast-MFC-AGG-ID: V_364xV8NreiMslqldmP-g_1750708776 To: devel@lists.libvirt.org Subject: [PATCH v2 12/13] qemuxmlconftest: Prepare for proper testing in 'disk-cdrom-usb-empty' Date: Mon, 23 Jun 2025 21:59:17 +0200 Message-ID: <60efc4f5d20f419127d41e528f5fb9cdcb390e71.1750705681.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: dilR61f6NuH-OvSv76KRmk1ed_rJXMSdPwfpofPukRY_1750708776 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: FNUS34ABERXH6QKZASYCG5LJJCPCFQKA X-Message-ID-Hash: FNUS34ABERXH6QKZASYCG5LJJCPCFQKA 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: 1750709317809116600 Content-Type: text/plain; charset="utf-8" From: Peter Krempa Modify the validation of empty cdroms to trigger only for VIR_DOMAIN_DISK_MODEL_USB_STORAGE as with 'usb-bot' we can properly emulate a cdrom. Signed-off-by: Peter Krempa Reviewed-by: Jiri Denemark --- src/qemu/qemu_validate.c | 3 +- ...om-usb-empty.x86_64-latest.abi-update.args | 33 ++++++++++++++++ ...rom-usb-empty.x86_64-latest.abi-update.xml | 38 +++++++++++++++++++ tests/qemuxmlconftest.c | 1 + 4 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 tests/qemuxmlconfdata/disk-cdrom-usb-empty.x86_64-lates= t.abi-update.args create mode 100644 tests/qemuxmlconfdata/disk-cdrom-usb-empty.x86_64-lates= t.abi-update.xml diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index b2faf43002..7e0e4db516 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -3189,7 +3189,8 @@ qemuValidateDomainDeviceDefDiskFrontend(const virDoma= inDiskDef *disk, return -1; } - if (virStorageSourceIsEmpty(disk->src)) { + if (disk->model =3D=3D VIR_DOMAIN_DISK_MODEL_USB_STORAGE && + virStorageSourceIsEmpty(disk->src)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("'usb' disk must not be empty")); return -1; diff --git a/tests/qemuxmlconfdata/disk-cdrom-usb-empty.x86_64-latest.abi-u= pdate.args b/tests/qemuxmlconfdata/disk-cdrom-usb-empty.x86_64-latest.abi-u= pdate.args new file mode 100644 index 0000000000..cebc6e66e8 --- /dev/null +++ b/tests/qemuxmlconfdata/disk-cdrom-usb-empty.x86_64-latest.abi-update.a= rgs @@ -0,0 +1,33 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/va= r/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine pc,usb=3Doff,dump-guest-core=3Doff,memory-backend=3Dpc.ram,acpi= =3Doff \ +-accel tcg \ +-cpu qemu64 \ +-m size=3D219136k \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server=3Don,wait=3Doff \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot strict=3Don \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ +-device '{"driver":"usb-storage","bus":"usb.0","port":"1","id":"usb-disk1"= ,"removable":false}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxmlconfdata/disk-cdrom-usb-empty.x86_64-latest.abi-u= pdate.xml b/tests/qemuxmlconfdata/disk-cdrom-usb-empty.x86_64-latest.abi-up= date.xml new file mode 100644 index 0000000000..32aa011f90 --- /dev/null +++ b/tests/qemuxmlconfdata/disk-cdrom-usb-empty.x86_64-latest.abi-update.x= ml @@ -0,0 +1,38 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + qemu64 + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + +
+ + +
+ + +
+ + + + +