From nobody Fri Dec 19 17:37:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1588766943; cv=none; d=zohomail.com; s=zohoarc; b=drpFm5bqc+WQFd6WBdOPVfDSNg7rjLdetE+/JZMXCN/7GtiAcWbTbf2DESNHnjGtmb+tcF+u7RBsA9+tDxp3KxwknR3hbvt57DdVW0sPshJ4P61ZpaE8j3NdCwK5IWeN2Ej66AvohicpD/Kbh0ikpMjd40vyjHa49jXA6s3b/i0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588766943; h=Content-Type:Content-Transfer-Encoding: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=zwPAWDt9O09MUv9d8xb2g1n1pqdXkSE1OAeGPRY6no4=; b=IEwX/02X70iRSmIZaKZ6RzNdGkSPmoXKwsmgBXZhDhuyxXJA2wlOuD3LeeiTQxnL6mZAY5yUMuDsKGxWshXc1LxtjG182daro084ltB8DvJg2iRyuQNYwdDlrwXleC+4OAbC0kADw0zbkhxtw3I+UkpzF+oH9C2E82L1AGEKBco= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1588766943167174.22188202893915; Wed, 6 May 2020 05:09:03 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-222-lpVSvuBANheG2Zgp3vVQew-1; Wed, 06 May 2020 08:08:59 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ABC3A53; Wed, 6 May 2020 12:08:50 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7CCB45C1D4; Wed, 6 May 2020 12:08:50 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 2E8E9180954D; Wed, 6 May 2020 12:08:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 046C8kOk029585 for ; Wed, 6 May 2020 08:08:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id C9B255C1D4; Wed, 6 May 2020 12:08:46 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.208.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3C0225C1BD for ; Wed, 6 May 2020 12:08:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588766941; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=zwPAWDt9O09MUv9d8xb2g1n1pqdXkSE1OAeGPRY6no4=; b=SmN0/+hmbYRL+8IBEkmLnREjQSonWG4J55feOrkpJS6VRpmHQ9rUGq/zR0cmUzAm+duBMD 7ppRJK61P1zgu22kv8Xptys7tcvo5po1faVw1ZQYWNZL0GHZSdkmD6Ho67KnrfliMft31X v3hdfhrQu3Q+0r+xWbl9s4/+JQTNki0= X-MC-Unique: lpVSvuBANheG2Zgp3vVQew-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 02/20] qemuxml2(argv|xml): Modernize 'discard'/'detect-zero' tests Date: Wed, 6 May 2020 14:08:17 +0200 Message-Id: <1c84d6ba9980b5924c13149177bdee3ac96a88af.1588766791.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Switch to DO_TEST_CAPS_LATEST for all of them and also add pre-blockdev case for 'disk-discard' as we had it before. Signed-off-by: Peter Krempa --- .../disk-detect-zeroes.x86_64-2.12.0.args | 1 + tests/qemuxml2argvdata/disk-detect-zeroes.xml | 5 +- ...rd.args =3D> disk-discard.x86_64-4.1.0.args} | 22 +++++---- .../disk-discard.x86_64-latest.args | 46 +++++++++++++++++++ tests/qemuxml2argvtest.c | 7 +-- ...l =3D> disk-detect-zeroes.x86_64-latest.xml} | 0 ...ard.xml =3D> disk-discard.x86_64-latest.xml} | 7 ++- tests/qemuxml2xmltest.c | 4 +- 8 files changed, 73 insertions(+), 19 deletions(-) rename tests/qemuxml2argvdata/{disk-discard.args =3D> disk-discard.x86_64-= 4.1.0.args} (59%) create mode 100644 tests/qemuxml2argvdata/disk-discard.x86_64-latest.args rename tests/qemuxml2xmloutdata/{disk-detect-zeroes.xml =3D> disk-detect-z= eroes.x86_64-latest.xml} (100%) rename tests/qemuxml2xmloutdata/{disk-discard.xml =3D> disk-discard.x86_64= -latest.xml} (87%) diff --git a/tests/qemuxml2argvdata/disk-detect-zeroes.x86_64-2.12.0.args b= /tests/qemuxml2argvdata/disk-detect-zeroes.x86_64-2.12.0.args index 1da46d8987..090cccdb5c 100644 --- a/tests/qemuxml2argvdata/disk-detect-zeroes.x86_64-2.12.0.args +++ b/tests/qemuxml2argvdata/disk-detect-zeroes.x86_64-2.12.0.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-test/master-key.aes \ -machine pc-i440fx-2.12,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ -m 1024 \ -realtime mlock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/disk-detect-zeroes.xml b/tests/qemuxml2= argvdata/disk-detect-zeroes.xml index d1ae37b81b..851077545e 100644 --- a/tests/qemuxml2argvdata/disk-detect-zeroes.xml +++ b/tests/qemuxml2argvdata/disk-detect-zeroes.xml @@ -10,6 +10,9 @@ + + qemu64 + destroy restart @@ -29,7 +32,7 @@
- +
diff --git a/tests/qemuxml2argvdata/disk-discard.args b/tests/qemuxml2argvd= ata/disk-discard.x86_64-4.1.0.args similarity index 59% rename from tests/qemuxml2argvdata/disk-discard.args rename to tests/qemuxml2argvdata/disk-discard.x86_64-4.1.0.args index 163b1b0df2..4437922eee 100644 --- a/tests/qemuxml2argvdata/disk-discard.args +++ b/tests/qemuxml2argvdata/disk-discard.x86_64-4.1.0.args @@ -8,29 +8,33 @@ XDG_CACHE_HOME=3D/tmp/lib/domain--1-test/.cache \ XDG_CONFIG_HOME=3D/tmp/lib/domain--1-test/.config \ QEMU_AUDIO_DRV=3Dnone \ /usr/bin/qemu-system-x86_64 \ --name test \ +-name guest=3Dtest,debug-threads=3Don \ -S \ --machine pc,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-test/master-key.aes \ +-machine pc-i440fx-4.1,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ -m 1024 \ --realtime mlock=3Doff \ +-overcommit mem-lock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ -uuid 92d7a226-cfae-425b-a6d3-00bbf9ec5c9e \ -display none \ -no-user-config \ -nodefaults \ --chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-test/monitor.so= ck,\ -server,nowait \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server,nowait \ -mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ -rtc base=3Dutc \ -no-shutdown \ -no-acpi \ --boot menu=3Don \ --usb \ +-boot menu=3Don,strict=3Don \ +-device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ -drive file=3D/var/lib/libvirt/images/f14.img,format=3Dqcow2,if=3Dnone,\ id=3Ddrive-virtio-disk0,discard=3Dunmap \ --device virtio-blk-pci,bus=3Dpci.0,addr=3D0x4,drive=3Ddrive-virtio-disk0,\ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x4,drive=3Ddrive-vir= tio-disk0,\ id=3Dvirtio-disk0,bootindex=3D2 \ -drive file=3D/var/lib/libvirt/Fedora-14-x86_64-Live-KDE.iso,format=3Draw,= if=3Dnone,\ id=3Ddrive-ide0-1-0,readonly=3Don,discard=3Dignore \ -device ide-cd,bus=3Dide.1,unit=3D0,drive=3Ddrive-ide0-1-0,id=3Dide0-1-0,b= ootindex=3D1 \ --device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/disk-discard.x86_64-latest.args b/tests= /qemuxml2argvdata/disk-discard.x86_64-latest.args new file mode 100644 index 0000000000..a7cbf567c8 --- /dev/null +++ b/tests/qemuxml2argvdata/disk-discard.x86_64-latest.args @@ -0,0 +1,46 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-test/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-test/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-test/.config \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3Dtest,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-test/master-key.aes \ +-machine pc,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ +-m 1024 \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid 92d7a226-cfae-425b-a6d3-00bbf9ec5c9e \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot menu=3Don,strict=3Don \ +-device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ +-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/f14.img",\ +"node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-2-format","read-only":false,"discard":"un= map",\ +"driver":"qcow2","file":"libvirt-2-storage"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x4,drive=3Dlibvirt-2= -format,\ +id=3Dvirtio-disk0,bootindex=3D2 \ +-blockdev '{"driver":"file",\ +"filename":"/var/lib/libvirt/Fedora-14-x86_64-Live-KDE.iso",\ +"node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":true,"discard":"ign= ore",\ +"driver":"raw","file":"libvirt-1-storage"}' \ +-device ide-cd,bus=3Dide.1,unit=3D0,drive=3Dlibvirt-1-format,id=3Dide0-1-0= ,bootindex=3D1 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index ff33870581..f45f04548f 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1135,11 +1135,8 @@ mymain(void) QEMU_CAPS_VIRTIO_BLK_SCSI); DO_TEST_CAPS_VER("disk-copy_on_read", "2.12.0"); DO_TEST_CAPS_LATEST("disk-copy_on_read"); - DO_TEST("disk-discard", - QEMU_CAPS_DRIVE_DISCARD); - DO_TEST("disk-detect-zeroes", - QEMU_CAPS_DRIVE_DISCARD, - QEMU_CAPS_DRIVE_DETECT_ZEROES); + DO_TEST_CAPS_VER("disk-discard", "4.1.0"); + DO_TEST_CAPS_LATEST("disk-discard"); DO_TEST_CAPS_VER("disk-detect-zeroes", "2.12.0"); DO_TEST_CAPS_LATEST("disk-detect-zeroes"); DO_TEST("disk-snapshot", NONE); diff --git a/tests/qemuxml2xmloutdata/disk-detect-zeroes.xml b/tests/qemuxm= l2xmloutdata/disk-detect-zeroes.x86_64-latest.xml similarity index 100% rename from tests/qemuxml2xmloutdata/disk-detect-zeroes.xml rename to tests/qemuxml2xmloutdata/disk-detect-zeroes.x86_64-latest.xml diff --git a/tests/qemuxml2xmloutdata/disk-discard.xml b/tests/qemuxml2xmlo= utdata/disk-discard.x86_64-latest.xml similarity index 87% rename from tests/qemuxml2xmloutdata/disk-discard.xml rename to tests/qemuxml2xmloutdata/disk-discard.x86_64-latest.xml index 563a24ae04..e55c5bf6d3 100644 --- a/tests/qemuxml2xmloutdata/disk-discard.xml +++ b/tests/qemuxml2xmloutdata/disk-discard.x86_64-latest.xml @@ -10,6 +10,9 @@ + + qemu64 + destroy restart @@ -29,7 +32,7 @@
- +
@@ -39,7 +42,7 @@ -
+
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 8bfa23cddf..34a9f2803a 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -638,8 +638,8 @@ mymain(void) DO_TEST("disk-source-pool", NONE); DO_TEST("disk-source-pool-mode", NONE); - DO_TEST("disk-discard", NONE); - DO_TEST("disk-detect-zeroes", NONE); + DO_TEST_CAPS_LATEST("disk-discard"); + DO_TEST_CAPS_LATEST("disk-detect-zeroes"); DO_TEST("disk-serial", NONE); --=20 2.26.2