From nobody Wed May 14 16:41:56 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 1522324313342302.9349213704195; Thu, 29 Mar 2018 04:51:53 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B4ED37FD68; Thu, 29 Mar 2018 11:51:33 +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 753CC60BE2; Thu, 29 Mar 2018 11:51:33 +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 20149180BAD3; Thu, 29 Mar 2018 11:51:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2TBpLI1016317 for ; Thu, 29 Mar 2018 07:51:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9BF4B1102E2D; Thu, 29 Mar 2018 11:51:21 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2626B1102E2B; Thu, 29 Mar 2018 11:51:21 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 29 Mar 2018 13:51:04 +0200 Message-Id: <554bdadbd6e24b23b9a6ee9f02a838b41e731bbc.1522323985.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 07/14] qemu: domain: Forbid VIR_STORAGE_FILE_DIR as a disk format 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 29 Mar 2018 11:51:34 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This is a storage driver type, which is not handled in qemu driver properly. For accessing directories, disk type 'dir' is used instead. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 7 +++++++ tests/qemuxml2argvdata/disk-drive-fmt-dir.xml | 27 +++++++++++++++++++++++= ++++ tests/qemuxml2argvtest.c | 1 + 3 files changed, 35 insertions(+) create mode 100644 tests/qemuxml2argvdata/disk-drive-fmt-dir.xml diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 960a78f082..88b4653da5 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4117,6 +4117,13 @@ qemuDomainValidateStorageSource(virStorageSourcePtr = src) return -1; } + if (src->format =3D=3D VIR_STORAGE_FILE_DIR) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("'directory' storage format is not directly suppo= red by qemu, " + "use 'dir' disk type instead")); + return -1; + } + return 0; } diff --git a/tests/qemuxml2argvdata/disk-drive-fmt-dir.xml b/tests/qemuxml2= argvdata/disk-drive-fmt-dir.xml new file mode 100644 index 0000000000..ede3f8e186 --- /dev/null +++ b/tests/qemuxml2argvdata/disk-drive-fmt-dir.xml @@ -0,0 +1,27 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + + /usr/bin/qemu-system-i686 + + + + +
+ + + + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 5d7f2e15ba..711bd1b661 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -913,6 +913,7 @@ mymain(void) DO_TEST("disk-drive-fmt-qcow", QEMU_CAPS_DRIVE_BOOT); DO_TEST_PARSE_ERROR("disk-drive-fmt-cow", QEMU_CAPS_DRIVE_BOOT); + DO_TEST_PARSE_ERROR("disk-drive-fmt-dir", QEMU_CAPS_DRIVE_BOOT); DO_TEST("disk-drive-shared", QEMU_CAPS_DRIVE_SERIAL); DO_TEST_PARSE_ERROR("disk-drive-shared-qcow", NONE); --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list