From nobody Thu Dec 18 03:58:51 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1503070602956808.1572212843874; Fri, 18 Aug 2017 08:36:42 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F38B2C0587C4; Fri, 18 Aug 2017 15:36:40 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BFCEB5D965; Fri, 18 Aug 2017 15:36:40 +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 8A72D3FC72; Fri, 18 Aug 2017 15:36:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v7IFaAR0021377 for ; Fri, 18 Aug 2017 11:36:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7D4BA60636; Fri, 18 Aug 2017 15:36:10 +0000 (UTC) Received: from caroline.localdomain (unknown [10.43.2.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 29314707B5 for ; Fri, 18 Aug 2017 15:36:07 +0000 (UTC) Received: from caroline.brq.redhat.com (caroline.brq.redhat.com [127.0.0.1]) by caroline.localdomain (Postfix) with ESMTP id 4EEF512036C for ; Fri, 18 Aug 2017 17:36:06 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com F38B2C0587C4 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Martin Kletzander To: libvir-list@redhat.com Date: Fri, 18 Aug 2017 17:36:03 +0200 Message-Id: <4ca7d5c3c8e0f37966b88ec9864c7b71ee98c6eb.1503070458.git.mkletzan@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/2] qemu: Don't mangle the storage format for type='dir' 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 18 Aug 2017 15:36:41 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Partially-resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1443434 Signed-off-by: Martin Kletzander Reviewed-by: John Ferlan --- src/storage/storage_source.c | 5 ++++ .../qemuxml2argv-floppy-drive-noformat.args | 24 +++++++++++++++++ .../qemuxml2argv-floppy-drive-noformat.xml | 31 ++++++++++++++++++= ++++ tests/qemuxml2argvtest.c | 2 ++ 4 files changed, 62 insertions(+) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-noform= at.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-noform= at.xml diff --git a/src/storage/storage_source.c b/src/storage/storage_source.c index b620153f1e5a..bbc5cc77be1a 100644 --- a/src/storage/storage_source.c +++ b/src/storage/storage_source.c @@ -527,11 +527,16 @@ virStorageFileGetMetadata(virStorageSourcePtr src, allow_probe, report_broken); =20 virHashTablePtr cycle =3D NULL; + virStorageType actualType =3D virStorageSourceGetActualType(src); int ret =3D -1; =20 if (!(cycle =3D virHashCreate(5, NULL))) return -1; =20 + /* No backing chains for type=3D'dir' */ + if (actualType =3D=3D VIR_STORAGE_TYPE_DIR) + return 0; + if (src->format <=3D VIR_STORAGE_FILE_NONE) src->format =3D allow_probe ? VIR_STORAGE_FILE_AUTO : VIR_STORAGE_FILE_RAW; diff --git a/tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-noformat.args= b/tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-noformat.args new file mode 100644 index 000000000000..214067b50345 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-noformat.args @@ -0,0 +1,24 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-i686 \ +-name QEMUGuest1 \ +-S \ +-M pc \ +-m 214 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-nographic \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dreadline \ +-no-acpi \ +-boot a \ +-usb \ +-drive file=3Dfat:floppy:/var/somefiles,if=3Dnone,id=3Ddrive-fdc0-0-0,read= only=3Don \ +-global isa-fdc.driveA=3Ddrive-fdc0-0-0 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-noformat.xml = b/tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-noformat.xml new file mode 100644 index 000000000000..9d9dcfe5e603 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-noformat.xml @@ -0,0 +1,31 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + + +
+ + + + + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 77cfe8d28fd1..b7cf2a22b196 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -887,6 +887,8 @@ mymain(void) QEMU_CAPS_DRIVE_BOOT); DO_TEST("floppy-drive-fat", QEMU_CAPS_DRIVE_BOOT); + DO_TEST("floppy-drive-noformat", + QEMU_CAPS_DRIVE_BOOT); DO_TEST("disk-drive-readonly-disk", QEMU_CAPS_NODEFCONFIG); DO_TEST("disk-drive-readonly-no-device", --=20 2.14.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list