From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176055487491.3734802986222; Mon, 13 Aug 2018 09:00:55 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 72F883084040; Mon, 13 Aug 2018 16:00:52 +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 E953710694F3; Mon, 13 Aug 2018 16:00:51 +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 8601D4A469; Mon, 13 Aug 2018 16:00:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG0e6j001179 for ; Mon, 13 Aug 2018 12:00:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9B69F2166BA5; Mon, 13 Aug 2018 16:00:40 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 39D4B2166BA0 for ; Mon, 13 Aug 2018 16:00:40 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 17:59:35 +0200 Message-Id: <1ed7d371c3253a7094121c4796771817e66d90a2.1534173734.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 01/62] qemu: process: Fix alias for disk-tray-moved event 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Mon, 13 Aug 2018 16:00:53 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Currently we'd report the alias of the drive which is backing the cdrom rather than the device itself: $ virsh event ds tray-change --loop event 'tray-change' for domain ds disk drive-ide0-0-1: opened event 'tray-change' for domain ds disk drive-ide0-0-1: closed Report the disk device alias as we document in the API docs. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/qemu/qemu_process.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index c4e33723d1..c1a8dfda29 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -1053,9 +1053,7 @@ qemuProcessHandleTrayChange(qemuMonitorPtr mon ATTRIB= UTE_UNUSED, disk =3D qemuProcessFindDomainDiskByAlias(vm, devAlias); if (disk) { - event =3D virDomainEventTrayChangeNewFromObj(vm, - devAlias, - reason); + event =3D virDomainEventTrayChangeNewFromObj(vm, disk->info.alias,= reason); /* Update disk tray status */ if (reason =3D=3D VIR_DOMAIN_EVENT_TRAY_CHANGE_OPEN) disk->tray_status =3D VIR_DOMAIN_DISK_TRAY_OPEN; --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176060197163.19245907325728; Mon, 13 Aug 2018 09:01:00 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5D8E2307C706; Mon, 13 Aug 2018 16:00:57 +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 255435B686; Mon, 13 Aug 2018 16:00:57 +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 A9A0818037F1; Mon, 13 Aug 2018 16:00:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG0fvb001184 for ; Mon, 13 Aug 2018 12:00:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id 48E8E2166BB1; Mon, 13 Aug 2018 16:00:41 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id DB7B22166BA0 for ; Mon, 13 Aug 2018 16:00:40 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 17:59:36 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 02/62] tests: qemumonitorjson: Simplify debugging of 'blockInfo' test 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Mon, 13 Aug 2018 16:00:58 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Print the differences in case when the expected data does not match. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- tests/qemumonitorjsontest.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index e9b2632655..3a0490bd26 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1585,12 +1585,29 @@ testQemuMonitorJSONqemuMonitorJSONGetVirtType(const= void *data) return ret; } + +static void +testQemuMonitorJSONGetBlockInfoPrint(const struct qemuDomainDiskInfo *d) +{ + VIR_TEST_VERBOSE("removable: %d, tray: %d, tray_open: %d, empty: %d, " + "io_status: %d, nodename: '%s'\n", + d->removable, d->tray, d->tray_open, d->empty, + d->io_status, NULLSTR(d->nodename)); +} + + static int testHashEqualQemuDomainDiskInfo(const void *value1, const void *value2) { const struct qemuDomainDiskInfo *info1 =3D value1, *info2 =3D value2; + int ret; + + if ((ret =3D memcmp(info1, info2, sizeof(*info1))) !=3D 0) { + testQemuMonitorJSONGetBlockInfoPrint(info1); + testQemuMonitorJSONGetBlockInfoPrint(info2); + } - return memcmp(info1, info2, sizeof(*info1)); + return ret; } static int --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176068221923.7639210528895; Mon, 13 Aug 2018 09:01:08 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 76B3530820EF; Mon, 13 Aug 2018 16:01:05 +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 4CC92D4D52; Mon, 13 Aug 2018 16:01:04 +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 6663E18037F6; Mon, 13 Aug 2018 16:01:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG0gD9001192 for ; Mon, 13 Aug 2018 12:00:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id EB1202166BA5; Mon, 13 Aug 2018 16:00:41 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8943F2166BA0 for ; Mon, 13 Aug 2018 16:00:41 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 17:59:37 +0200 Message-Id: <142930f2925f56f0fa8278e7bb5e7d4277addf02.1534173734.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 03/62] qemu: Improve errors in qemuDomainBlockResize 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.84 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Mon, 13 Aug 2018 16:01:06 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Remove the pointless "empty path" check and use a better error message if the disk was not found. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/qemu/qemu_driver.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index d4a2379e48..4fc1e358fa 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -10963,12 +10963,6 @@ qemuDomainBlockResize(virDomainPtr dom, virCheckFlags(VIR_DOMAIN_BLOCK_RESIZE_BYTES, -1); - if (path[0] =3D=3D '\0') { - virReportError(VIR_ERR_INVALID_ARG, - "%s", _("empty path")); - return -1; - } - /* We prefer operating on bytes. */ if ((flags & VIR_DOMAIN_BLOCK_RESIZE_BYTES) =3D=3D 0) { if (size > ULLONG_MAX / 1024) { @@ -10996,7 +10990,7 @@ qemuDomainBlockResize(virDomainPtr dom, if (!(disk =3D virDomainDiskByName(vm->def, path, false))) { virReportError(VIR_ERR_INVALID_ARG, - _("invalid path: %s"), path); + _("disk '%s' was not found in the domain config"), = path); goto endjob; } --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176058903311.65352939980653; Mon, 13 Aug 2018 09:00:58 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2EE243084047; Mon, 13 Aug 2018 16:00:55 +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 9AF1F3001A65; Mon, 13 Aug 2018 16:00:54 +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 456254A46D; Mon, 13 Aug 2018 16:00:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG0gKb001199 for ; Mon, 13 Aug 2018 12:00:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 98CD62166BA5; Mon, 13 Aug 2018 16:00:42 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 36FE32166BA0 for ; Mon, 13 Aug 2018 16:00:42 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 17:59:38 +0200 Message-Id: <190b310967eda0657cdf4d3b343087c200c6ec3e.1534173734.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 04/62] qemu: monitor: Remove unsupported function check for 'block_resize' 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.84 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Mon, 13 Aug 2018 16:00:57 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" QEMU supports 'block_resize' since 0.14 so we don't need to do explicit checking. Additionally the caller did not use the different value at all. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/qemu/qemu_monitor_json.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 2921f110a9..0695ec8d2c 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2550,8 +2550,6 @@ qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitorPt= r mon, } -/* Return 0 on success, -1 on failure, or -2 if not supported. Size - * is in bytes. */ int qemuMonitorJSONBlockResize(qemuMonitorPtr mon, const char *device, unsigned long long size) @@ -2570,11 +2568,6 @@ int qemuMonitorJSONBlockResize(qemuMonitorPtr mon, if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) goto cleanup; - if (qemuMonitorJSONHasError(reply, "CommandNotFound")) { - ret =3D -2; - goto cleanup; - } - if (qemuMonitorJSONCheckError(cmd, reply) < 0) goto cleanup; --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176073157127.41398837438942; Mon, 13 Aug 2018 09:01:13 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F355F30820D2; Mon, 13 Aug 2018 16:01:10 +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 A97CC70C2A; Mon, 13 Aug 2018 16:01:10 +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 1D11518037F8; Mon, 13 Aug 2018 16:01:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG0haw001209 for ; Mon, 13 Aug 2018 12:00:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id 48D932166BA5; Mon, 13 Aug 2018 16:00:43 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id DAAED2166BA0 for ; Mon, 13 Aug 2018 16:00:42 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 17:59:39 +0200 Message-Id: <3aa2a6a4b1647b507b208aa9cd3244efac411a0e.1534173734.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 05/62] qemu: monitor: Remove useless 'locked' property from struct qemuDomainDiskInfo 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Mon, 13 Aug 2018 16:01:11 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We don't use it for anything useful so it does not make much sense to extract it. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/qemu/qemu_domain.h | 1 - src/qemu/qemu_monitor_json.c | 7 ------- tests/qemumonitorjsontest.c | 1 - 3 files changed, 9 deletions(-) diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index bff293fc0a..7b79d77257 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -438,7 +438,6 @@ struct _qemuDomainVcpuPrivate { struct qemuDomainDiskInfo { bool removable; - bool locked; bool tray; bool tray_open; bool empty; diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 0695ec8d2c..2389ebb9aa 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2243,13 +2243,6 @@ int qemuMonitorJSONGetBlockInfo(qemuMonitorPtr mon, goto cleanup; } - if (virJSONValueObjectGetBoolean(dev, "locked", &info->locked) < 0= ) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot read %s value"), - "locked"); - goto cleanup; - } - /* 'tray_open' is present only if the device has a tray */ if (virJSONValueObjectGetBoolean(dev, "tray_open", &info->tray_ope= n) =3D=3D 0) info->tray =3D true; diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 3a0490bd26..955892b1f6 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1647,7 +1647,6 @@ testQemuMonitorJSONqemuMonitorJSONGetBlockInfo(const = void *data) if (VIR_ALLOC(info) < 0) goto cleanup; - info->locked =3D true; info->removable =3D true; info->tray =3D true; --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176081682527.0409545901093; Mon, 13 Aug 2018 09:01:21 -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 9CC953001976; Mon, 13 Aug 2018 16:01:18 +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 416CD6F977; Mon, 13 Aug 2018 16:01:18 +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 BF4DC12D9A; Mon, 13 Aug 2018 16:01:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG0iYx001219 for ; Mon, 13 Aug 2018 12:00:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 436FA2166BA5; Mon, 13 Aug 2018 16:00:44 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 961282166BA0 for ; Mon, 13 Aug 2018 16:00:43 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 17:59:40 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 06/62] tests: qemucapabilities: Update capability data for qemu 3.0.0 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.40]); Mon, 13 Aug 2018 16:01:20 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The diff contains changes from the change of the JSON library reformatting as well as dropping of the preconfig state and adding of the 'qdev' field to output of 'query-blockstats'. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- .../qemucapabilitiesdata/caps_3.0.0.x86_64.replies | 591 +++--------------= ---- tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml | 8 +- 2 files changed, 88 insertions(+), 511 deletions(-) diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.replies b/tests/q= emucapabilitiesdata/caps_3.0.0.x86_64.replies index b2f8377248..714fac5a6f 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.replies @@ -4,8 +4,7 @@ } { - "return": { - }, + "return": {}, "id": "libvirt-1" } @@ -17,11 +16,11 @@ { "return": { "qemu": { - "micro": 90, + "micro": 93, "minor": 12, "major": 2 }, - "package": "v3.0.0-rc0-31-g633e824037" + "package": "v3.0.0-rc3-17-g09b94ac0f2" }, "id": "libvirt-2" } @@ -175,7 +174,7 @@ "name": "system_wakeup" }, { - "name": "exit-preconfig" + "name": "x-exit-preconfig" }, { "name": "cont" @@ -5346,40 +5345,35 @@ { "name": "max", "typename": "max-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": false }, { "name": "host", "typename": "host-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": false }, { "name": "base", "typename": "base-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": true, "migration-safe": true }, { "name": "qemu64", "typename": "qemu64-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "qemu32", "typename": "qemu32-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, @@ -5400,64 +5394,56 @@ { "name": "pentium3", "typename": "pentium3-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "pentium2", "typename": "pentium2-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "pentium", "typename": "pentium-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "n270", "typename": "n270-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "kvm64", "typename": "kvm64-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "kvm32", "typename": "kvm32-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "coreduo", "typename": "coreduo-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "core2duo", "typename": "core2duo-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, @@ -5475,16 +5461,14 @@ { "name": "Westmere-IBRS", "typename": "Westmere-IBRS-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "Westmere", "typename": "Westmere-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, @@ -5525,40 +5509,35 @@ { "name": "Skylake-Client-IBRS", "typename": "Skylake-Client-IBRS-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "Skylake-Client", "typename": "Skylake-Client-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "SandyBridge-IBRS", "typename": "SandyBridge-IBRS-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "SandyBridge", "typename": "SandyBridge-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "Penryn", "typename": "Penryn-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, @@ -5600,32 +5579,28 @@ { "name": "Opteron_G2", "typename": "Opteron_G2-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "Opteron_G1", "typename": "Opteron_G1-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "Nehalem-IBRS", "typename": "Nehalem-IBRS-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "Nehalem", "typename": "Nehalem-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, @@ -5650,48 +5625,42 @@ { "name": "IvyBridge-IBRS", "typename": "IvyBridge-IBRS-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "IvyBridge", "typename": "IvyBridge-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "Haswell-noTSX-IBRS", "typename": "Haswell-noTSX-IBRS-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "Haswell-noTSX", "typename": "Haswell-noTSX-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "Haswell-IBRS", "typename": "Haswell-IBRS-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "Haswell", "typename": "Haswell-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, @@ -5729,48 +5698,42 @@ { "name": "Conroe", "typename": "Conroe-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "Broadwell-noTSX-IBRS", "typename": "Broadwell-noTSX-IBRS-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "Broadwell-noTSX", "typename": "Broadwell-noTSX-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "Broadwell-IBRS", "typename": "Broadwell-IBRS-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "Broadwell", "typename": "Broadwell-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "486", "typename": "486-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true } @@ -6065,13 +6028,11 @@ "option": "spice" }, { - "parameters": [ - ], + "parameters": [], "option": "smbios" }, { - "parameters": [ - ], + "parameters": [], "option": "acpi" }, { @@ -6347,8 +6308,7 @@ "option": "icount" }, { - "parameters": [ - ], + "parameters": [], "option": "numa" }, { @@ -6390,13 +6350,11 @@ "option": "realtime" }, { - "parameters": [ - ], + "parameters": [], "option": "tpmdev" }, { - "parameters": [ - ], + "parameters": [], "option": "object" }, { @@ -6700,23 +6658,19 @@ "option": "rtc" }, { - "parameters": [ - ], + "parameters": [], "option": "net" }, { - "parameters": [ - ], + "parameters": [], "option": "nic" }, { - "parameters": [ - ], + "parameters": [], "option": "netdev" }, { - "parameters": [ - ], + "parameters": [], "option": "device" }, { @@ -7193,8 +7147,6 @@ { "name": "query-status", "ret-type": "1", - "allow-oob": false, - "allow-preconfig": true, "meta-type": "command", "arg-type": "0" }, @@ -7246,8 +7198,6 @@ { "name": "watchdog-set-action", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "5" }, @@ -7264,368 +7214,276 @@ { "name": "job-pause", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "8" }, { "name": "job-resume", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "9" }, { "name": "job-cancel", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "10" }, { "name": "job-complete", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "11" }, { "name": "job-dismiss", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "12" }, { "name": "job-finalize", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "13" }, { "name": "query-jobs", "ret-type": "[14]", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "x-block-latency-histogram-set", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "15" }, { "name": "query-block", "ret-type": "[16]", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "query-blockstats", "ret-type": "[18]", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "17" }, { "name": "query-block-jobs", "ret-type": "[19]", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "block_passwd", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "20" }, { "name": "block_resize", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "21" }, { "name": "blockdev-snapshot-sync", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "22" }, { "name": "blockdev-snapshot", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "23" }, { "name": "change-backing-file", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "24" }, { "name": "block-commit", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "25" }, { "name": "drive-backup", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "26" }, { "name": "blockdev-backup", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "27" }, { "name": "query-named-block-nodes", "ret-type": "[28]", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "drive-mirror", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "29" }, { "name": "block-dirty-bitmap-add", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "30" }, { "name": "block-dirty-bitmap-remove", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "31" }, { "name": "block-dirty-bitmap-clear", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "31" }, { "name": "x-block-dirty-bitmap-enable", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "31" }, { "name": "x-block-dirty-bitmap-disable", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "31" }, { "name": "x-block-dirty-bitmap-merge", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "32" }, { "name": "x-debug-block-dirty-bitmap-sha256", "ret-type": "33", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "31" }, { "name": "blockdev-mirror", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "34" }, { "name": "block_set_io_throttle", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "35" }, { "name": "block-stream", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "36" }, { "name": "block-job-set-speed", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "37" }, { "name": "block-job-cancel", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "38" }, { "name": "block-job-pause", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "39" }, { "name": "block-job-resume", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "40" }, { "name": "block-job-complete", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "41" }, { "name": "block-job-dismiss", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "42" }, { "name": "block-job-finalize", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "43" }, { "name": "blockdev-add", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "44" }, { "name": "blockdev-del", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "45" }, { "name": "blockdev-create", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "46" }, { "name": "blockdev-open-tray", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "47" }, { "name": "blockdev-close-tray", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "48" }, { "name": "blockdev-remove-medium", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "49" }, { "name": "blockdev-insert-medium", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "50" }, { "name": "blockdev-change-medium", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "51" }, @@ -7672,96 +7530,72 @@ { "name": "block-set-write-threshold", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "60" }, { "name": "x-blockdev-change", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "61" }, { "name": "x-blockdev-set-iothread", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "62" }, { "name": "query-pr-managers", "ret-type": "[63]", - "allow-oob": false, - "allow-preconfig": true, "meta-type": "command", "arg-type": "0" }, { "name": "blockdev-snapshot-internal-sync", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "64" }, { "name": "blockdev-snapshot-delete-internal-sync", "ret-type": "66", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "65" }, { "name": "eject", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "67" }, { "name": "nbd-server-start", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "68" }, { "name": "nbd-server-add", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "69" }, { "name": "nbd-server-remove", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "70" }, { "name": "x-nbd-server-add-bitmap", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "71" }, { "name": "nbd-server-stop", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, @@ -7788,64 +7622,48 @@ { "name": "query-chardev", "ret-type": "[76]", - "allow-oob": false, - "allow-preconfig": true, "meta-type": "command", "arg-type": "0" }, { "name": "query-chardev-backends", "ret-type": "[77]", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "ringbuf-write", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "78" }, { "name": "ringbuf-read", "ret-type": "str", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "79" }, { "name": "chardev-add", "ret-type": "81", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "80" }, { "name": "chardev-change", "ret-type": "81", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "82" }, { "name": "chardev-remove", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "83" }, { "name": "chardev-send-break", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "84" }, @@ -7857,32 +7675,24 @@ { "name": "set_link", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "86" }, { "name": "netdev_add", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "87" }, { "name": "netdev_del", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "88" }, { "name": "query-rx-filter", "ret-type": "[90]", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "89" }, @@ -7894,88 +7704,66 @@ { "name": "query-rocker", "ret-type": "93", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "92" }, { "name": "query-rocker-ports", "ret-type": "[95]", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "94" }, { "name": "query-rocker-of-dpa-flows", "ret-type": "[97]", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "96" }, { "name": "query-rocker-of-dpa-groups", "ret-type": "[99]", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "98" }, { "name": "query-tpm-models", "ret-type": "[100]", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "query-tpm-types", "ret-type": "[101]", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "query-tpm", "ret-type": "[102]", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "set_password", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "103" }, { "name": "expire_password", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "104" }, { "name": "screendump", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "105" }, { "name": "query-spice", "ret-type": "106", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, @@ -8002,24 +7790,18 @@ { "name": "query-vnc", "ret-type": "110", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "query-vnc-servers", "ret-type": "[111]", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "change-vnc-password", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "112" }, @@ -8041,80 +7823,60 @@ { "name": "query-mice", "ret-type": "[116]", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "send-key", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "117" }, { "name": "input-send-event", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "118" }, { "name": "query-migrate", "ret-type": "119", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "migrate-set-capabilities", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "120" }, { "name": "query-migrate-capabilities", "ret-type": "[121]", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "migrate-set-parameters", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "122" }, { "name": "query-migrate-parameters", "ret-type": "123", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "client_migrate_info", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "124" }, { "name": "migrate-start-postcopy", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, @@ -8131,104 +7893,78 @@ { "name": "x-colo-lost-heartbeat", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "migrate_cancel", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "migrate-continue", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "127" }, { "name": "migrate_set_downtime", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "128" }, { "name": "migrate_set_speed", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "129" }, { "name": "migrate-set-cache-size", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "130" }, { "name": "query-migrate-cache-size", "ret-type": "int", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "migrate", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "131" }, { "name": "migrate-incoming", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "132" }, { "name": "xen-save-devices-state", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "133" }, { "name": "xen-set-replication", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "134" }, { "name": "query-xen-replication-status", "ret-type": "135", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "xen-colo-do-checkpoint", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, @@ -8236,7 +7972,6 @@ "name": "migrate-recover", "ret-type": "0", "allow-oob": true, - "allow-preconfig": false, "meta-type": "command", "arg-type": "136" }, @@ -8244,135 +7979,102 @@ "name": "migrate-pause", "ret-type": "0", "allow-oob": true, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "transaction", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "137" }, { "name": "trace-event-get-state", "ret-type": "[139]", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "138" }, { "name": "trace-event-set-state", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "140" }, { "name": "query-qmp-schema", "ret-type": "[141]", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "qmp_capabilities", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": true, "meta-type": "command", "arg-type": "142" }, { "name": "query-version", "ret-type": "143", - "allow-oob": false, - "allow-preconfig": true, "meta-type": "command", "arg-type": "0" }, { "name": "query-commands", "ret-type": "[144]", - "allow-oob": false, - "allow-preconfig": true, "meta-type": "command", "arg-type": "0" }, { "name": "add_client", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "145" }, { "name": "query-name", "ret-type": "146", - "allow-oob": false, - "allow-preconfig": true, "meta-type": "command", "arg-type": "0" }, { "name": "query-kvm", "ret-type": "147", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "query-uuid", "ret-type": "148", - "allow-oob": false, - "allow-preconfig": true, "meta-type": "command", "arg-type": "0" }, { "name": "query-events", "ret-type": "[149]", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "query-cpus", "ret-type": "[150]", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "query-cpus-fast", "ret-type": "[151]", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "query-iothreads", "ret-type": "[152]", - "allow-oob": false, - "allow-preconfig": true, "meta-type": "command", "arg-type": "0" }, { "name": "query-balloon", "ret-type": "153", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, @@ -8384,192 +8086,144 @@ { "name": "query-pci", "ret-type": "[155]", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "quit", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "stop", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "system_reset", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "system_powerdown", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "cpu-add", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "156" }, { "name": "memsave", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "157" }, { "name": "pmemsave", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "158" }, { "name": "cont", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { - "name": "exit-preconfig", + "name": "x-exit-preconfig", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": true, "meta-type": "command", "arg-type": "0" }, { "name": "system_wakeup", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "inject-nmi", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "balloon", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "159" }, { "name": "human-monitor-command", "ret-type": "str", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "160" }, { "name": "qom-list", "ret-type": "[162]", - "allow-oob": false, - "allow-preconfig": true, "meta-type": "command", "arg-type": "161" }, { "name": "qom-get", "ret-type": "any", - "allow-oob": false, - "allow-preconfig": true, "meta-type": "command", "arg-type": "163" }, { "name": "qom-set", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": true, "meta-type": "command", "arg-type": "164" }, { "name": "change", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "165" }, { "name": "qom-list-types", "ret-type": "[167]", - "allow-oob": false, - "allow-preconfig": true, "meta-type": "command", "arg-type": "166" }, { "name": "device-list-properties", "ret-type": "[162]", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "168" }, { "name": "qom-list-properties", "ret-type": "[162]", - "allow-oob": false, - "allow-preconfig": true, "meta-type": "command", "arg-type": "169" }, { "name": "xen-set-global-dirty-log", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "170" }, { "name": "device_add", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "171" }, { "name": "device_del", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "172" }, @@ -8581,16 +8235,12 @@ { "name": "dump-guest-memory", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "174" }, { "name": "query-dump", "ret-type": "175", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, @@ -8602,152 +8252,114 @@ { "name": "query-dump-guest-memory-capability", "ret-type": "177", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "dump-skeys", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "178" }, { "name": "object-add", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "179" }, { "name": "object-del", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "180" }, { "name": "getfd", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "181" }, { "name": "closefd", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "182" }, { "name": "query-machines", "ret-type": "[183]", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "query-memory-size-summary", "ret-type": "184", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "query-cpu-definitions", "ret-type": "[185]", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "query-cpu-model-expansion", "ret-type": "187", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "186" }, { "name": "query-cpu-model-comparison", "ret-type": "189", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "188" }, { "name": "query-cpu-model-baseline", "ret-type": "191", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "190" }, { "name": "add-fd", "ret-type": "193", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "192" }, { "name": "remove-fd", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "194" }, { "name": "query-fdsets", "ret-type": "[195]", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "query-target", "ret-type": "196", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "query-command-line-options", "ret-type": "[198]", - "allow-oob": false, - "allow-preconfig": true, "meta-type": "command", "arg-type": "197" }, { "name": "query-memdev", "ret-type": "[199]", - "allow-oob": false, - "allow-preconfig": true, "meta-type": "command", "arg-type": "0" }, { "name": "query-memory-devices", "ret-type": "[200]", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, @@ -8759,8 +8371,6 @@ { "name": "query-acpi-ospm-status", "ret-type": "[202]", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, @@ -8772,8 +8382,6 @@ { "name": "rtc-reset-reinjection", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, @@ -8785,56 +8393,42 @@ { "name": "xen-load-devices-state", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "205" }, { "name": "query-gic-capabilities", "ret-type": "[206]", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "query-hotpluggable-cpus", "ret-type": "[207]", - "allow-oob": false, - "allow-preconfig": true, "meta-type": "command", "arg-type": "0" }, { "name": "query-vm-generation-id", "ret-type": "208", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "query-sev", "ret-type": "209", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "query-sev-launch-measure", "ret-type": "210", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, { "name": "query-sev-capabilities", "ret-type": "211", - "allow-oob": false, - "allow-preconfig": false, "meta-type": "command", "arg-type": "0" }, @@ -8846,15 +8440,12 @@ { "name": "set-numa-node", "ret-type": "0", - "allow-oob": false, - "allow-preconfig": true, "meta-type": "command", "arg-type": "213" }, { "name": "0", - "members": [ - ], + "members": [], "meta-type": "object" }, { @@ -9146,6 +8737,11 @@ "default": null, "type": "str" }, + { + "name": "qdev", + "default": null, + "type": "str" + }, { "name": "node-name", "default": null, @@ -16222,10 +15818,7 @@ }, { "name": "allow-oob", - "type": "bool" - }, - { - "name": "allow-preconfig", + "default": null, "type": "bool" } ], @@ -19117,8 +18710,7 @@ }, { "name": "470", - "members": [ - ], + "members": [], "meta-type": "object" }, { @@ -19938,6 +19530,7 @@ "syscall": true, "level": 13, "avx512dq": false, + "x-migrate-smi-count": true, "svm": false, "full-cpuid-auto-level": true, "hv-reset": false, @@ -20602,6 +20195,7 @@ "syscall": true, "level": 13, "avx512dq": false, + "x-migrate-smi-count": true, "svm": false, "full-cpuid-auto-level": true, "hv-reset": false, @@ -20772,8 +20366,7 @@ } { - "return": { - }, + "return": {}, "id": "libvirt-1" } @@ -20787,8 +20380,7 @@ { "name": "max", "typename": "max-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": false }, @@ -20804,24 +20396,21 @@ { "name": "base", "typename": "base-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": true, "migration-safe": true }, { "name": "qemu64", "typename": "qemu64-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "qemu32", "typename": "qemu32-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, @@ -20837,72 +20426,63 @@ { "name": "pentium3", "typename": "pentium3-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "pentium2", "typename": "pentium2-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "pentium", "typename": "pentium-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "n270", "typename": "n270-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "kvm64", "typename": "kvm64-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "kvm32", "typename": "kvm32-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "coreduo", "typename": "coreduo-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "core2duo", "typename": "core2duo-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "athlon", "typename": "athlon-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, @@ -20918,8 +20498,7 @@ { "name": "Westmere", "typename": "Westmere-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, @@ -21049,8 +20628,7 @@ { "name": "Penryn", "typename": "Penryn-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, @@ -21095,16 +20673,14 @@ { "name": "Opteron_G2", "typename": "Opteron_G2-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, { "name": "Opteron_G1", "typename": "Opteron_G1-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, @@ -21120,8 +20696,7 @@ { "name": "Nehalem", "typename": "Nehalem-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, @@ -21296,8 +20871,7 @@ { "name": "Conroe", "typename": "Conroe-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true }, @@ -21386,8 +20960,7 @@ { "name": "486", "typename": "486-x86_64-cpu", - "unavailable-features": [ - ], + "unavailable-features": [], "static": false, "migration-safe": true } @@ -21905,6 +21478,7 @@ "syscall": true, "level": 13, "avx512dq": false, + "x-migrate-smi-count": true, "svm": true, "full-cpuid-auto-level": true, "hv-reset": false, @@ -22569,6 +22143,7 @@ "syscall": true, "level": 13, "avx512dq": false, + "x-migrate-smi-count": true, "svm": true, "full-cpuid-auto-level": true, "hv-reset": false, diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_3.0.0.x86_64.xml index efddcbc6a5..9f4cdfc540 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml @@ -215,10 +215,10 @@ - 2012090 + 2012093 0 - 438109 - v3.0.0-rc0-31-g633e824037 + 427343 + v3.0.0-rc3-17-g09b94ac0f2 x86_64 @@ -327,6 +327,7 @@ + @@ -580,6 +581,7 @@ + --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176069018264.77731952297984; Mon, 13 Aug 2018 09:01:09 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 927E03002C98; Mon, 13 Aug 2018 16:01:06 +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 4A6B0AC333; Mon, 13 Aug 2018 16:01:06 +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 9E0623FCC3; Mon, 13 Aug 2018 16:01:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG0jXA001229 for ; Mon, 13 Aug 2018 12:00:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id F03BF2166BA5; Mon, 13 Aug 2018 16:00:44 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8E16A2166BA0 for ; Mon, 13 Aug 2018 16:00:44 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 17:59:41 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 07/62] Revert "qemu: monitor: Add the 'query-nodes' argument for query-blockstats" 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.84 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Mon, 13 Aug 2018 16:01:07 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Turns out that 'query-nodes' is not what we want and the 'query-blockstats' command was in fact buggy. Revert the new field since it's not needed. This reverts commit 50edca1331298bfcb2622e8fe588d493aff9ab68. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/qemu/qemu_block.c | 2 +- src/qemu/qemu_monitor.c | 8 ++------ src/qemu/qemu_monitor.h | 3 +-- src/qemu/qemu_monitor_json.c | 9 +++------ src/qemu/qemu_monitor_json.h | 3 +-- 5 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index be120b30f0..ccdd334367 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -358,7 +358,7 @@ qemuBlockNodeNamesDetect(virQEMUDriverPtr driver, return -1; data =3D qemuMonitorQueryNamedBlockNodes(qemuDomainGetMonitor(vm)); - blockstats =3D qemuMonitorQueryBlockstats(qemuDomainGetMonitor(vm), fa= lse); + blockstats =3D qemuMonitorQueryBlockstats(qemuDomainGetMonitor(vm)); if (qemuDomainObjExitMonitor(driver, vm) < 0 || !data || !blockstats) goto cleanup; diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 6e0644221b..4f0bbc147d 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2243,19 +2243,15 @@ qemuMonitorGetBlockInfo(qemuMonitorPtr mon) /** * qemuMonitorQueryBlockstats: * @mon: monitor object - * @nodenames: include backing chain nodes with explicitly specified name * * Returns data from a call to 'query-blockstats'. */ virJSONValuePtr -qemuMonitorQueryBlockstats(qemuMonitorPtr mon, - bool nodenames) +qemuMonitorQueryBlockstats(qemuMonitorPtr mon) { QEMU_CHECK_MONITOR_NULL(mon); - VIR_DEBUG("nodenames: %d", nodenames); - - return qemuMonitorJSONQueryBlockstats(mon, nodenames); + return qemuMonitorJSONQueryBlockstats(mon); } diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 2fa8d5b51d..b8e3ca2ce1 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -563,8 +563,7 @@ int qemuMonitorSetMemoryStatsPeriod(qemuMonitorPtr mon, int qemuMonitorBlockIOStatusToError(const char *status); virHashTablePtr qemuMonitorGetBlockInfo(qemuMonitorPtr mon); -virJSONValuePtr qemuMonitorQueryBlockstats(qemuMonitorPtr mon, - bool nodenames); +virJSONValuePtr qemuMonitorQueryBlockstats(qemuMonitorPtr mon); typedef struct _qemuBlockStats qemuBlockStats; typedef qemuBlockStats *qemuBlockStatsPtr; diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 2389ebb9aa..e20851eeb2 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2362,16 +2362,13 @@ qemuMonitorJSONGetOneBlockStatsInfo(virJSONValuePtr= dev, virJSONValuePtr -qemuMonitorJSONQueryBlockstats(qemuMonitorPtr mon, - bool nodenames) +qemuMonitorJSONQueryBlockstats(qemuMonitorPtr mon) { virJSONValuePtr cmd; virJSONValuePtr reply =3D NULL; virJSONValuePtr ret =3D NULL; - if (!(cmd =3D qemuMonitorJSONMakeCommand("query-blockstats", - "B:query-nodes", nodenames, - NULL))) + if (!(cmd =3D qemuMonitorJSONMakeCommand("query-blockstats", NULL))) return NULL; if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) @@ -2400,7 +2397,7 @@ qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mo= n, size_t i; virJSONValuePtr devices; - if (!(devices =3D qemuMonitorJSONQueryBlockstats(mon, false))) + if (!(devices =3D qemuMonitorJSONQueryBlockstats(mon))) return -1; for (i =3D 0; i < virJSONValueArraySize(devices); i++) { diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 2408ab0c5b..0458d81c0d 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -86,8 +86,7 @@ int qemuMonitorJSONSetMemoryStatsPeriod(qemuMonitorPtr mo= n, int qemuMonitorJSONGetBlockInfo(qemuMonitorPtr mon, virHashTablePtr table); -virJSONValuePtr qemuMonitorJSONQueryBlockstats(qemuMonitorPtr mon, - bool nodenames); +virJSONValuePtr qemuMonitorJSONQueryBlockstats(qemuMonitorPtr mon); int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, virHashTablePtr hash, bool backingChain); --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176089823820.1641683124449; Mon, 13 Aug 2018 09:01:29 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9927BE8CAC; Mon, 13 Aug 2018 16:01:27 +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 7BD6E1073027; Mon, 13 Aug 2018 16:01:25 +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 919E224F62; Mon, 13 Aug 2018 16:01:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG0jHw001241 for ; Mon, 13 Aug 2018 12:00:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9E55B2166BA5; Mon, 13 Aug 2018 16:00:45 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3C5232166BA0 for ; Mon, 13 Aug 2018 16:00:45 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 17:59:42 +0200 Message-Id: <29ba403274957fa99f418014c2fbc47e21cda08e.1534173734.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 08/62] qemu: hotplug: consolidate media change code paths 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 13 Aug 2018 16:01:28 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Use qemuDomainAttachDeviceDiskLive to change the media in qemuDomainChangeDiskLive as the former function already does all the necessary steps to prepare the new medium. This also allows us to turn qemuDomainChangeEjectableMedia static. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/qemu/qemu_driver.c | 18 ++---------------- src/qemu/qemu_hotplug.c | 18 +++++++++++++++--- src/qemu/qemu_hotplug.h | 9 ++------- tests/qemuhotplugtest.c | 2 +- 4 files changed, 20 insertions(+), 27 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 4fc1e358fa..15ec92bf10 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -7599,7 +7599,7 @@ qemuDomainAttachDeviceLive(virDomainObjPtr vm, switch ((virDomainDeviceType)dev->type) { case VIR_DOMAIN_DEVICE_DISK: qemuDomainObjCheckDiskTaint(driver, vm, dev->data.disk, NULL); - ret =3D qemuDomainAttachDeviceDiskLive(driver, vm, dev); + ret =3D qemuDomainAttachDeviceDiskLive(driver, vm, dev, false); if (!ret) { alias =3D dev->data.disk->info.alias; dev->data.disk =3D NULL; @@ -7850,12 +7850,6 @@ qemuDomainChangeDiskLive(virDomainObjPtr vm, virDomainDeviceDef oldDev =3D { .type =3D dev->type }; int ret =3D -1; - if (virDomainDiskTranslateSourcePool(disk) < 0) - goto cleanup; - - if (qemuDomainDetermineDiskChain(driver, vm, disk, true) < 0) - goto cleanup; - if (!(orig_disk =3D virDomainDiskFindByBusAndDst(vm->def, disk->bus, disk->dst)))= { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -7884,16 +7878,8 @@ qemuDomainChangeDiskLive(virDomainObjPtr vm, goto cleanup; } - /* Add the new disk src into shared disk hash table */ - if (qemuAddSharedDevice(driver, dev, vm->def->name) < 0) - goto cleanup; - - if (qemuDomainChangeEjectableMedia(driver, vm, orig_disk, - dev->data.disk->src, force) < 0= ) { - ignore_value(qemuRemoveSharedDisk(driver, dev->data.disk, - vm->def->name)); + if (qemuDomainAttachDeviceDiskLive(driver, vm, dev, force) < 0) goto cleanup; - } dev->data.disk->src =3D NULL; } diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 5b52fe9edc..c46f27f4b4 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -586,7 +586,7 @@ qemuHotplugDiskSourceRemove(qemuMonitorPtr mon, * * Returns 0 on success, -1 on error and reports libvirt error */ -int +static int qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver, virDomainObjPtr vm, virDomainDiskDefPtr disk, @@ -909,10 +909,22 @@ qemuDomainAttachUSBMassStorageDevice(virQEMUDriverPtr= driver, } +/** + * qemuDomainAttachDeviceDiskLive: + * @driver: qemu driver struct + * @vm: domain object + * @dev: device to attach (expected type is DISK) + * @forceMediaChange: Forcibly open the drive if changing media + * + * Attach a new disk or in case of cdroms/floppies change the media in the= drive. + * This function handles all the necessary steps to attach a new storage s= ource + * to the VM. If @forceMediaChange is true the drive is opened forcibly. + */ int qemuDomainAttachDeviceDiskLive(virQEMUDriverPtr driver, virDomainObjPtr vm, - virDomainDeviceDefPtr dev) + virDomainDeviceDefPtr dev, + bool forceMediaChange) { size_t i; virDomainDiskDefPtr disk =3D dev->data.disk; @@ -946,7 +958,7 @@ qemuDomainAttachDeviceDiskLive(virQEMUDriverPtr driver, } if (qemuDomainChangeEjectableMedia(driver, vm, orig_disk, - disk->src, false) < 0) + disk->src, forceMediaChange) < = 0) goto cleanup; disk->src =3D NULL; diff --git a/src/qemu/qemu_hotplug.h b/src/qemu/qemu_hotplug.h index 0297e42a98..c085c45082 100644 --- a/src/qemu/qemu_hotplug.h +++ b/src/qemu/qemu_hotplug.h @@ -28,12 +28,6 @@ # include "qemu_domain.h" # include "domain_conf.h" -int qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDiskDefPtr disk, - virStorageSourcePtr newsrc, - bool force); - void qemuDomainDelTLSObjects(virQEMUDriverPtr driver, virDomainObjPtr vm, qemuDomainAsyncJob asyncJob, @@ -60,7 +54,8 @@ int qemuDomainAttachControllerDevice(virQEMUDriverPtr dri= ver, virDomainControllerDefPtr controller); int qemuDomainAttachDeviceDiskLive(virQEMUDriverPtr driver, virDomainObjPtr vm, - virDomainDeviceDefPtr dev); + virDomainDeviceDefPtr dev, + bool forceMediaChange); int qemuDomainAttachNetDevice(virQEMUDriverPtr driver, virDomainObjPtr vm, virDomainNetDefPtr net); diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 5b1e0db104..e0e248556f 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -120,7 +120,7 @@ testQemuHotplugAttach(virDomainObjPtr vm, /* conn in only used for storage pool and secrets lookup so as long * as we don't use any of them, passing NULL should be safe */ - ret =3D qemuDomainAttachDeviceDiskLive(&driver, vm, dev); + ret =3D qemuDomainAttachDeviceDiskLive(&driver, vm, dev, false); break; case VIR_DOMAIN_DEVICE_CHR: ret =3D qemuDomainAttachChrDevice(&driver, vm, dev->data.chr); --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176094534112.65980856954309; Mon, 13 Aug 2018 09:01:34 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7F7C4307CF2D; Mon, 13 Aug 2018 16:01:32 +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 3723A5B686; Mon, 13 Aug 2018 16:01:32 +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 B508C24F57; Mon, 13 Aug 2018 16:01:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG0kK0001252 for ; Mon, 13 Aug 2018 12:00:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4CC4B2166BA5; Mon, 13 Aug 2018 16:00:46 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id DF0862166BA0 for ; Mon, 13 Aug 2018 16:00:45 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 17:59:43 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 09/62] qemu: hotplug: Prepare disk source in qemuDomainAttachDeviceDiskLive 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Mon, 13 Aug 2018 16:01:33 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Move the preparation steps from qemuDomainAttachDiskGeneric up into qemuDomainAttachDeviceDiskLive so that also media changing can use the prepared file. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/qemu/qemu_hotplug.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index c46f27f4b4..87bc63e5e1 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -641,7 +641,6 @@ qemuDomainAttachDiskGeneric(virQEMUDriverPtr driver, qemuDomainObjPrivatePtr priv =3D vm->privateData; qemuHotplugDiskSourceDataPtr diskdata =3D NULL; char *devstr =3D NULL; - virQEMUDriverConfigPtr cfg =3D virQEMUDriverGetConfig(driver); if (qemuHotplugPrepareDiskAccess(driver, vm, disk, NULL, false) < 0) goto cleanup; @@ -649,9 +648,6 @@ qemuDomainAttachDiskGeneric(virQEMUDriverPtr driver, if (qemuAssignDeviceDiskAlias(vm->def, disk) < 0) goto error; - if (qemuDomainPrepareDiskSource(disk, priv, cfg) < 0) - goto error; - if (!(diskdata =3D qemuHotplugDiskSourceAttachPrepare(disk, priv->qemu= Caps))) goto error; @@ -686,7 +682,6 @@ qemuDomainAttachDiskGeneric(virQEMUDriverPtr driver, qemuHotplugDiskSourceDataFree(diskdata); qemuDomainSecretDiskDestroy(disk); VIR_FREE(devstr); - virObjectUnref(cfg); return ret; exit_monitor: @@ -927,6 +922,8 @@ qemuDomainAttachDeviceDiskLive(virQEMUDriverPtr driver, bool forceMediaChange) { size_t i; + virQEMUDriverConfigPtr cfg =3D virQEMUDriverGetConfig(driver); + qemuDomainObjPrivatePtr priv =3D vm->privateData; virDomainDiskDefPtr disk =3D dev->data.disk; virDomainDiskDefPtr orig_disk =3D NULL; int ret =3D -1; @@ -943,6 +940,9 @@ qemuDomainAttachDeviceDiskLive(virQEMUDriverPtr driver, if (qemuDomainDetermineDiskChain(driver, vm, disk, true) < 0) goto cleanup; + if (qemuDomainPrepareDiskSource(disk, priv, cfg) < 0) + goto cleanup; + switch ((virDomainDiskDevice) disk->device) { case VIR_DOMAIN_DISK_DEVICE_CDROM: case VIR_DOMAIN_DISK_DEVICE_FLOPPY: @@ -1013,6 +1013,7 @@ qemuDomainAttachDeviceDiskLive(virQEMUDriverPtr drive= r, cleanup: if (ret !=3D 0) ignore_value(qemuRemoveSharedDevice(driver, dev, vm->def->name)); + virObjectUnref(cfg); return ret; } --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176076530942.8164029317784; Mon, 13 Aug 2018 09:01:16 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8B93F30BB368; Mon, 13 Aug 2018 16:01:13 +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 A520878C35; Mon, 13 Aug 2018 16:01:12 +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 399343F7D2; Mon, 13 Aug 2018 16:01:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG0lAo001262 for ; Mon, 13 Aug 2018 12:00:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id F02E62166BA5; Mon, 13 Aug 2018 16:00:46 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8D4F52166BA0 for ; Mon, 13 Aug 2018 16:00:46 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 17:59:44 +0200 Message-Id: <983520155daca29b725efbc00c1e33d6ebd5978e.1534173734.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 10/62] qemu: monitor: Reuse qemuMonitorJSONQueryBlock in qemuMonitorJSONBlockIoThrottleInfo 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Mon, 13 Aug 2018 16:01:15 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The wrapper executes the command and does error detection so there's no need to open-code all of those things. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/qemu/qemu_monitor_json.c | 37 +++++-------------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index e20851eeb2..48439ccae1 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -4817,21 +4817,14 @@ int qemuMonitorJSONOpenGraphics(qemuMonitorPtr mon, goto cleanup; \ } static int -qemuMonitorJSONBlockIoThrottleInfo(virJSONValuePtr result, +qemuMonitorJSONBlockIoThrottleInfo(virJSONValuePtr io_throttle, const char *device, virDomainBlockIoTuneInfoPtr reply) { - virJSONValuePtr io_throttle; int ret =3D -1; size_t i; bool found =3D false; - if (!(io_throttle =3D virJSONValueObjectGetArray(result, "return"))) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _(" block_io_throttle reply was missing device list= ")); - goto cleanup; - } - for (i =3D 0; i < virJSONValueArraySize(io_throttle); i++) { virJSONValuePtr temp_dev =3D virJSONValueArrayGet(io_throttle, i); virJSONValuePtr inserted; @@ -5001,33 +4994,13 @@ int qemuMonitorJSONGetBlockIoThrottle(qemuMonitorPt= r mon, virDomainBlockIoTuneInfoPtr reply) { int ret =3D -1; - virJSONValuePtr cmd =3D NULL; - virJSONValuePtr result =3D NULL; + virJSONValuePtr devices =3D NULL; - cmd =3D qemuMonitorJSONMakeCommand("query-block", NULL); - if (!cmd) + if (!(devices =3D qemuMonitorJSONQueryBlock(mon))) return -1; - if (qemuMonitorJSONCommand(mon, cmd, &result) < 0) - goto cleanup; - - if (virJSONValueObjectHasKey(result, "error")) { - if (qemuMonitorJSONHasError(result, "DeviceNotActive")) - virReportError(VIR_ERR_OPERATION_INVALID, - _("No active operation on device: %s"), device); - else if (qemuMonitorJSONHasError(result, "NotSupported")) - virReportError(VIR_ERR_OPERATION_INVALID, - _("Operation is not supported for device: %s"),= device); - else - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Unexpected error")); - goto cleanup; - } - - ret =3D qemuMonitorJSONBlockIoThrottleInfo(result, device, reply); - cleanup: - virJSONValueFree(cmd); - virJSONValueFree(result); + ret =3D qemuMonitorJSONBlockIoThrottleInfo(devices, device, reply); + virJSONValueFree(devices); return ret; } --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176081360118.27108026565395; Mon, 13 Aug 2018 09:01:21 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7217E3078AAC; Mon, 13 Aug 2018 16:01:18 +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 2DD37AC316; Mon, 13 Aug 2018 16:01:18 +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 BC23E18037F2; Mon, 13 Aug 2018 16:01:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG0lQk001277 for ; Mon, 13 Aug 2018 12:00:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9CE2C2166BA5; Mon, 13 Aug 2018 16:00:47 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3AFE32166BA0 for ; Mon, 13 Aug 2018 16:00:47 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 17:59:45 +0200 Message-Id: <0d0f1609f165747b27e75c8a0f44fffa65dd2949.1534173734.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 11/62] qemu: monitor: Allow using 'id' instead of 'device' for 'block_set_io_throttle' 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.84 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Mon, 13 Aug 2018 16:01:19 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The 'device' argument matches only the legacy drive alias. For blockdev we need to set the throttling for a QOM id and thus we'll need to use the 'id' field. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/qemu/qemu_driver.c | 2 +- src/qemu/qemu_monitor.c | 8 +++++--- src/qemu/qemu_monitor.h | 3 ++- src/qemu/qemu_monitor_json.c | 14 ++++++++++---- src/qemu/qemu_monitor_json.h | 3 ++- tests/qemumonitorjsontest.c | 2 +- 6 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 15ec92bf10..36ec0a2346 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -18474,7 +18474,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, * via the JSON error code from the block_set_io_throttle call */ qemuDomainObjEnterMonitor(driver, vm); - ret =3D qemuMonitorSetBlockIoThrottle(priv->mon, device, + ret =3D qemuMonitorSetBlockIoThrottle(priv->mon, device, NULL, &info, supportMaxOptions, set_fields & QEMU_BLOCK_IOTUNE= _SET_GROUP_NAME, supportMaxLengthOptions); diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 4f0bbc147d..2902c3b246 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3444,17 +3444,19 @@ qemuMonitorGetBlockJobInfo(qemuMonitorPtr mon, int qemuMonitorSetBlockIoThrottle(qemuMonitorPtr mon, - const char *device, + const char *drivealias, + const char *qomid, virDomainBlockIoTuneInfoPtr info, bool supportMaxOptions, bool supportGroupNameOption, bool supportMaxLengthOptions) { - VIR_DEBUG("device=3D%p, info=3D%p", device, info); + VIR_DEBUG("drivealias=3D%s, qomid=3D%s, info=3D%p", + NULLSTR(drivealias), NULLSTR(qomid), info); QEMU_CHECK_MONITOR(mon); - return qemuMonitorJSONSetBlockIoThrottle(mon, device, info, + return qemuMonitorJSONSetBlockIoThrottle(mon, drivealias, qomid, info, supportMaxOptions, supportGroupNameOption, supportMaxLengthOptions); diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index b8e3ca2ce1..16fc75819f 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -932,7 +932,8 @@ int qemuMonitorOpenGraphics(qemuMonitorPtr mon, bool skipauth); int qemuMonitorSetBlockIoThrottle(qemuMonitorPtr mon, - const char *device, + const char *drivealias, + const char *qomid, virDomainBlockIoTuneInfoPtr info, bool supportMaxOptions, bool supportGroupNameOption, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 48439ccae1..3a1dfb8563 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -4897,7 +4897,8 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValuePtr io= _throttle, #undef GET_THROTTLE_STATS_OPTIONAL int qemuMonitorJSONSetBlockIoThrottle(qemuMonitorPtr mon, - const char *device, + const char *drivealias, + const char *qomid, virDomainBlockIoTuneInfoPtr info, bool supportMaxOptions, bool supportGroupNameOption, @@ -4907,12 +4908,17 @@ int qemuMonitorJSONSetBlockIoThrottle(qemuMonitorPt= r mon, virJSONValuePtr cmd =3D NULL; virJSONValuePtr result =3D NULL; virJSONValuePtr args =3D NULL; + const char *errdev =3D drivealias; + + if (!errdev) + errdev =3D qomid; if (!(cmd =3D qemuMonitorJSONMakeCommand("block_set_io_throttle", NULL= ))) return -1; if (virJSONValueObjectCreate(&args, - "s:device", device, + "S:device", drivealias, + "S:id", qomid, "U:bps", info->total_bytes_sec, "U:bps_rd", info->read_bytes_sec, "U:bps_wr", info->write_bytes_sec, @@ -4967,10 +4973,10 @@ int qemuMonitorJSONSetBlockIoThrottle(qemuMonitorPt= r mon, if (virJSONValueObjectHasKey(result, "error")) { if (qemuMonitorJSONHasError(result, "DeviceNotActive")) { virReportError(VIR_ERR_OPERATION_INVALID, - _("No active operation on device: %s"), device); + _("No active operation on device: %s"), errdev); } else if (qemuMonitorJSONHasError(result, "NotSupported")) { virReportError(VIR_ERR_OPERATION_INVALID, - _("Operation is not supported for device: %s"),= device); + _("Operation is not supported for device: %s"),= errdev); } else { virJSONValuePtr error =3D virJSONValueObjectGet(result, "error= "); virReportError(VIR_ERR_INTERNAL_ERROR, diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 0458d81c0d..47635f14b1 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -327,7 +327,8 @@ int qemuMonitorJSONOpenGraphics(qemuMonitorPtr mon, bool skipauth); int qemuMonitorJSONSetBlockIoThrottle(qemuMonitorPtr mon, - const char *device, + const char *drivealias, + const char *qomid, virDomainBlockIoTuneInfoPtr info, bool supportMaxOptions, bool supportGroupNameOption, diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 955892b1f6..b39d8cd0b8 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2146,7 +2146,7 @@ testQemuMonitorJSONqemuMonitorJSONSetBlockIoThrottle(= const void *data) goto cleanup; if (qemuMonitorJSONSetBlockIoThrottle(qemuMonitorTestGetMonitor(test), - "drive-virtio-disk1", &info, tru= e, + "drive-virtio-disk1", NULL, &inf= o, true, true, true) < 0) goto cleanup; --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176063713867.9807613180435; Mon, 13 Aug 2018 09:01:03 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3E8DD300306D; Mon, 13 Aug 2018 16:01:00 +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 EA2615C6CF; Mon, 13 Aug 2018 16:00:59 +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 8EDA918037F3; Mon, 13 Aug 2018 16:00:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG0miP001289 for ; Mon, 13 Aug 2018 12:00:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4E3702166BA5; Mon, 13 Aug 2018 16:00:48 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id E01032166BA0 for ; Mon, 13 Aug 2018 16:00:47 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 17:59:46 +0200 Message-Id: <7b0a70f117c62e3da568b11589f61e3e8c6a27f1.1534173735.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 12/62] qemu: monitor: Allow using 'qdev' instead of 'device' for getting disk throttling 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Mon, 13 Aug 2018 16:01:02 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The 'device' field reported by 'query-block' is empty when -blockdev is used. Add an argument which will allow matching disk by using the qdev id so we can use this code with -blockdev. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/qemu/qemu_driver.c | 2 +- src/qemu/qemu_monitor.c | 8 +++++--- src/qemu/qemu_monitor.h | 3 ++- src/qemu/qemu_monitor_json.c | 21 ++++++++++++++------- src/qemu/qemu_monitor_json.h | 3 ++- tests/qemumonitorjsontest.c | 2 +- 6 files changed, 25 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 36ec0a2346..d11e990443 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -18603,7 +18603,7 @@ qemuDomainGetBlockIoTune(virDomainPtr dom, if (!(device =3D qemuAliasDiskDriveFromDisk(disk))) goto endjob; qemuDomainObjEnterMonitor(driver, vm); - ret =3D qemuMonitorGetBlockIoThrottle(priv->mon, device, &reply); + ret =3D qemuMonitorGetBlockIoThrottle(priv->mon, device, NULL, &re= ply); if (qemuDomainObjExitMonitor(driver, vm) < 0) goto endjob; if (ret < 0) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 2902c3b246..758942ffcb 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3465,14 +3465,16 @@ qemuMonitorSetBlockIoThrottle(qemuMonitorPtr mon, int qemuMonitorGetBlockIoThrottle(qemuMonitorPtr mon, - const char *device, + const char *drivealias, + const char *qdevid, virDomainBlockIoTuneInfoPtr reply) { - VIR_DEBUG("device=3D%p, reply=3D%p", device, reply); + VIR_DEBUG("drivealias=3D%s, qdevid=3D%s, reply=3D%p", + NULLSTR(drivealias), NULLSTR(qdevid), reply); QEMU_CHECK_MONITOR(mon); - return qemuMonitorJSONGetBlockIoThrottle(mon, device, reply); + return qemuMonitorJSONGetBlockIoThrottle(mon, drivealias, qdevid, repl= y); } diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 16fc75819f..60418422e9 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -940,7 +940,8 @@ int qemuMonitorSetBlockIoThrottle(qemuMonitorPtr mon, bool supportMaxLengthOptions); int qemuMonitorGetBlockIoThrottle(qemuMonitorPtr mon, - const char *device, + const char *drivealias, + const char *qdevid, virDomainBlockIoTuneInfoPtr reply); int qemuMonitorSystemWakeup(qemuMonitorPtr mon); diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 3a1dfb8563..e43447dc53 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -4818,7 +4818,8 @@ int qemuMonitorJSONOpenGraphics(qemuMonitorPtr mon, } static int qemuMonitorJSONBlockIoThrottleInfo(virJSONValuePtr io_throttle, - const char *device, + const char *drivealias, + const char *qdevid, virDomainBlockIoTuneInfoPtr reply) { int ret =3D -1; @@ -4828,7 +4829,8 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValuePtr io= _throttle, for (i =3D 0; i < virJSONValueArraySize(io_throttle); i++) { virJSONValuePtr temp_dev =3D virJSONValueArrayGet(io_throttle, i); virJSONValuePtr inserted; - const char *current_dev; + const char *current_drive; + const char *current_qdev; if (!temp_dev || virJSONValueGetType(temp_dev) !=3D VIR_JSON_TYPE_= OBJECT) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -4837,14 +4839,18 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValuePtr = io_throttle, goto cleanup; } - if (!(current_dev =3D virJSONValueObjectGetString(temp_dev, "devic= e"))) { + current_qdev =3D virJSONValueObjectGetString(temp_dev, "qdev"); + current_drive =3D virJSONValueObjectGetString(temp_dev, "device"); + + if (!current_drive && !current_qdev) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("block_io_throttle device entry " "was not in expected format")); goto cleanup; } - if (STRNEQ(current_dev, device)) + if ((drivealias && STRNEQ(current_drive, drivealias)) || + (qdevid && STRNEQ(current_qdev, qdevid))) continue; found =3D true; @@ -4885,7 +4891,7 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValuePtr io= _throttle, if (!found) { virReportError(VIR_ERR_INTERNAL_ERROR, _("cannot find throttling info for device '%s'"), - device); + drivealias ? drivealias : qdevid); goto cleanup; } ret =3D 0; @@ -4996,7 +5002,8 @@ int qemuMonitorJSONSetBlockIoThrottle(qemuMonitorPtr = mon, } int qemuMonitorJSONGetBlockIoThrottle(qemuMonitorPtr mon, - const char *device, + const char *drivealias, + const char *qdevid, virDomainBlockIoTuneInfoPtr reply) { int ret =3D -1; @@ -5005,7 +5012,7 @@ int qemuMonitorJSONGetBlockIoThrottle(qemuMonitorPtr = mon, if (!(devices =3D qemuMonitorJSONQueryBlock(mon))) return -1; - ret =3D qemuMonitorJSONBlockIoThrottleInfo(devices, device, reply); + ret =3D qemuMonitorJSONBlockIoThrottleInfo(devices, drivealias, qdevid= , reply); virJSONValueFree(devices); return ret; } diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 47635f14b1..4d75e04183 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -335,7 +335,8 @@ int qemuMonitorJSONSetBlockIoThrottle(qemuMonitorPtr mo= n, bool supportMaxLengthOptions); int qemuMonitorJSONGetBlockIoThrottle(qemuMonitorPtr mon, - const char *device, + const char *drivealias, + const char *qdevid, virDomainBlockIoTuneInfoPtr reply); int qemuMonitorJSONSystemWakeup(qemuMonitorPtr mon); diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index b39d8cd0b8..35d24cfb22 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2139,7 +2139,7 @@ testQemuMonitorJSONqemuMonitorJSONSetBlockIoThrottle(= const void *data) goto cleanup; if (qemuMonitorJSONGetBlockIoThrottle(qemuMonitorTestGetMonitor(test), - "drive-virtio-disk0", &info) < 0) + "drive-virtio-disk0", NULL, &inf= o) < 0) goto cleanup; if (testValidateGetBlockIoThrottle(&info, &expectedInfo) < 0) --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176103425854.5486365243253; Mon, 13 Aug 2018 09:01:43 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AF6643082A3C; Mon, 13 Aug 2018 16:01: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 5F52426FAA; Mon, 13 Aug 2018 16:01: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 DA66238B7; Mon, 13 Aug 2018 16:01:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG0nj5001294 for ; Mon, 13 Aug 2018 12:00:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id F10462166BA5; Mon, 13 Aug 2018 16:00:48 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8F3732166BA0 for ; Mon, 13 Aug 2018 16:00:48 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 17:59:47 +0200 Message-Id: <7405d5c3caa2794dd2cd235031bd58c23890f3c2.1534173735.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 13/62] qemu: monitor: Add 'nodename' argument for 'block_resize' 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Mon, 13 Aug 2018 16:01:42 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Allow referring to individual node name to rezise. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/qemu/qemu_driver.c | 2 +- src/qemu/qemu_monitor.c | 12 ++++++++++-- src/qemu/qemu_monitor.h | 3 ++- src/qemu/qemu_monitor_json.c | 4 +++- src/qemu/qemu_monitor_json.h | 3 ++- tests/qemumonitorjsontest.c | 2 +- 6 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index d11e990443..7456db6468 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -10991,7 +10991,7 @@ qemuDomainBlockResize(virDomainPtr dom, goto endjob; qemuDomainObjEnterMonitor(driver, vm); - if (qemuMonitorBlockResize(priv->mon, device, size) < 0) { + if (qemuMonitorBlockResize(priv->mon, device, NULL, size) < 0) { ignore_value(qemuDomainObjExitMonitor(driver, vm)); goto endjob; } diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 758942ffcb..4dcbd69dce 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2312,13 +2312,21 @@ qemuMonitorBlockStatsUpdateCapacity(qemuMonitorPtr = mon, int qemuMonitorBlockResize(qemuMonitorPtr mon, const char *device, + const char *nodename, unsigned long long size) { - VIR_DEBUG("device=3D%s size=3D%llu", device, size); + VIR_DEBUG("device=3D%s nodename=3D%s size=3D%llu", + NULLSTR(device), NULLSTR(nodename), size); QEMU_CHECK_MONITOR(mon); - return qemuMonitorJSONBlockResize(mon, device, size); + if ((!device && !nodename) || (device && nodename)) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("exactly one of 'device' and 'nodename' need to b= e specified")); + return -1; + } + + return qemuMonitorJSONBlockResize(mon, device, nodename, size); } diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 60418422e9..f8f6969ddb 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -596,7 +596,8 @@ int qemuMonitorBlockStatsUpdateCapacity(qemuMonitorPtr = mon, ATTRIBUTE_NONNULL(2); int qemuMonitorBlockResize(qemuMonitorPtr mon, - const char *dev_name, + const char *device, + const char *nodename, unsigned long long size); int qemuMonitorSetVNCPassword(qemuMonitorPtr mon, const char *password); diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index e43447dc53..de3fcd83d8 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2542,6 +2542,7 @@ qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitorPt= r mon, int qemuMonitorJSONBlockResize(qemuMonitorPtr mon, const char *device, + const char *nodename, unsigned long long size) { int ret =3D -1; @@ -2549,7 +2550,8 @@ int qemuMonitorJSONBlockResize(qemuMonitorPtr mon, virJSONValuePtr reply =3D NULL; cmd =3D qemuMonitorJSONMakeCommand("block_resize", - "s:device", device, + "S:device", device, + "S:node-name", nodename, "U:size", size, NULL); if (!cmd) diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 4d75e04183..19aebef5fb 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -94,7 +94,8 @@ int qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitorPt= r mon, virHashTablePtr stats, bool backingChain); int qemuMonitorJSONBlockResize(qemuMonitorPtr mon, - const char *devce, + const char *device, + const char *nodename, unsigned long long size); int qemuMonitorJSONSetVNCPassword(qemuMonitorPtr mon, diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 35d24cfb22..3da4d3076a 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1320,7 +1320,7 @@ cleanup: \ } GEN_TEST_FUNC(qemuMonitorJSONSetLink, "vnet0", VIR_DOMAIN_NET_INTERFACE_LI= NK_STATE_DOWN) -GEN_TEST_FUNC(qemuMonitorJSONBlockResize, "vda", 123456) +GEN_TEST_FUNC(qemuMonitorJSONBlockResize, "vda", "asdf", 123456) GEN_TEST_FUNC(qemuMonitorJSONSetVNCPassword, "secret_password") GEN_TEST_FUNC(qemuMonitorJSONSetPassword, "spice", "secret_password", "dis= connect") GEN_TEST_FUNC(qemuMonitorJSONExpirePassword, "spice", "123456") --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176089434372.55134684156815; Mon, 13 Aug 2018 09:01:29 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id DFF9FC0ADB7B; Mon, 13 Aug 2018 16:01:26 +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 7F87C765C4; Mon, 13 Aug 2018 16:01:26 +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 F0CAE24F60; Mon, 13 Aug 2018 16:01:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG0n2e001302 for ; Mon, 13 Aug 2018 12:00:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id A177C2166BA5; Mon, 13 Aug 2018 16:00:49 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3E9D02166BA0 for ; Mon, 13 Aug 2018 16:00:49 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 17:59:48 +0200 Message-Id: <9c42446443cccf5284dee27bf06f07c6f6798896.1534173735.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 14/62] tests: qemu: Drop disk from hostdev-mdev tests 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 13 Aug 2018 16:01:27 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The disk is not necessary to test the mdevs. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- tests/qemuxml2argvdata/hostdev-mdev-display-missing-graphics.xml | 6 --= ---- .../hostdev-mdev-display-spice-egl-headless.x86_64-latest.args | 2 -- tests/qemuxml2argvdata/hostdev-mdev-display-spice-egl-headless.xml | 6 --= ---- .../hostdev-mdev-display-spice-opengl.x86_64-latest.args | 2 -- tests/qemuxml2argvdata/hostdev-mdev-display-spice-opengl.xml | 6 --= ---- .../hostdev-mdev-display-vnc-egl-headless.x86_64-latest.args | 2 -- tests/qemuxml2argvdata/hostdev-mdev-display-vnc-egl-headless.xml | 6 --= ---- tests/qemuxml2argvdata/hostdev-mdev-display-vnc.x86_64-latest.args | 2 -- tests/qemuxml2argvdata/hostdev-mdev-display-vnc.xml | 6 --= ---- tests/qemuxml2argvdata/hostdev-mdev-display.xml | 6 --= ---- tests/qemuxml2argvdata/hostdev-mdev-invalid-target-address.xml | 5 --= --- tests/qemuxml2argvdata/hostdev-mdev-precreated.args | 3 --- tests/qemuxml2argvdata/hostdev-mdev-precreated.xml | 6 --= ---- tests/qemuxml2argvdata/hostdev-mdev-src-address-invalid.xml | 6 --= ---- tests/qemuxml2xmloutdata/hostdev-mdev-display.xml | 6 --= ---- tests/qemuxml2xmloutdata/hostdev-mdev-precreated.xml | 6 --= ---- 16 files changed, 76 deletions(-) diff --git a/tests/qemuxml2argvdata/hostdev-mdev-display-missing-graphics.x= ml b/tests/qemuxml2argvdata/hostdev-mdev-display-missing-graphics.xml index ea559a6444..55b60ba133 100644 --- a/tests/qemuxml2argvdata/hostdev-mdev-display-missing-graphics.xml +++ b/tests/qemuxml2argvdata/hostdev-mdev-display-missing-graphics.xml @@ -14,12 +14,6 @@ destroy /usr/bin/qemu-system-i686 - - - - -
- diff --git a/tests/qemuxml2argvdata/hostdev-mdev-display-spice-egl-headless= .x86_64-latest.args b/tests/qemuxml2argvdata/hostdev-mdev-display-spice-egl= -headless.x86_64-latest.args index 0ac90c81d2..b84869264e 100644 --- a/tests/qemuxml2argvdata/hostdev-mdev-display-spice-egl-headless.x86_64= -latest.args +++ b/tests/qemuxml2argvdata/hostdev-mdev-display-spice-egl-headless.x86_64= -latest.args @@ -23,8 +23,6 @@ file=3D/tmp/lib/domain--1-QEMUGuest2/master-key.aes \ -no-acpi \ -boot strict=3Don \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ --drive file=3D/dev/HostVG/QEMUGuest2,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ --device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ -spice port=3D0,seamless-migration=3Don \ -display egl-headless \ -device qxl-vga,id=3Dvideo0,ram_size=3D67108864,vram_size=3D67108864,\ diff --git a/tests/qemuxml2argvdata/hostdev-mdev-display-spice-egl-headless= .xml b/tests/qemuxml2argvdata/hostdev-mdev-display-spice-egl-headless.xml index c8f10c2f3a..3a686ad2bf 100644 --- a/tests/qemuxml2argvdata/hostdev-mdev-display-spice-egl-headless.xml +++ b/tests/qemuxml2argvdata/hostdev-mdev-display-spice-egl-headless.xml @@ -14,12 +14,6 @@ destroy /usr/bin/qemu-system-i686 - - - - -
- diff --git a/tests/qemuxml2argvdata/hostdev-mdev-display-spice-opengl.x86_6= 4-latest.args b/tests/qemuxml2argvdata/hostdev-mdev-display-spice-opengl.x8= 6_64-latest.args index 1fd9fdaa16..80c56abfb9 100644 --- a/tests/qemuxml2argvdata/hostdev-mdev-display-spice-opengl.x86_64-lates= t.args +++ b/tests/qemuxml2argvdata/hostdev-mdev-display-spice-opengl.x86_64-lates= t.args @@ -23,8 +23,6 @@ file=3D/tmp/lib/domain--1-QEMUGuest2/master-key.aes \ -no-acpi \ -boot strict=3Don \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ --drive file=3D/dev/HostVG/QEMUGuest2,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ --device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ -spice port=3D0,gl=3Don,rendernode=3D/dev/dri/foo,seamless-migration=3Don \ -device qxl-vga,id=3Dvideo0,ram_size=3D67108864,vram_size=3D67108864,\ vram64_size_mb=3D0,vgamem_mb=3D16,max_outputs=3D1,bus=3Dpci.0,addr=3D0x2 \ diff --git a/tests/qemuxml2argvdata/hostdev-mdev-display-spice-opengl.xml b= /tests/qemuxml2argvdata/hostdev-mdev-display-spice-opengl.xml index 18c9817608..a632e58a41 100644 --- a/tests/qemuxml2argvdata/hostdev-mdev-display-spice-opengl.xml +++ b/tests/qemuxml2argvdata/hostdev-mdev-display-spice-opengl.xml @@ -14,12 +14,6 @@ destroy /usr/bin/qemu-system-i686 - - - - -
- diff --git a/tests/qemuxml2argvdata/hostdev-mdev-display-vnc-egl-headless.x= 86_64-latest.args b/tests/qemuxml2argvdata/hostdev-mdev-display-vnc-egl-hea= dless.x86_64-latest.args index cdf545d0e0..91708d7663 100644 --- a/tests/qemuxml2argvdata/hostdev-mdev-display-vnc-egl-headless.x86_64-l= atest.args +++ b/tests/qemuxml2argvdata/hostdev-mdev-display-vnc-egl-headless.x86_64-l= atest.args @@ -23,8 +23,6 @@ file=3D/tmp/lib/domain--1-QEMUGuest2/master-key.aes \ -no-acpi \ -boot strict=3Don \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ --drive file=3D/dev/HostVG/QEMUGuest2,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ --device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ -vnc 127.0.0.1:0 \ -display egl-headless \ -device qxl-vga,id=3Dvideo0,ram_size=3D67108864,vram_size=3D67108864,\ diff --git a/tests/qemuxml2argvdata/hostdev-mdev-display-vnc-egl-headless.x= ml b/tests/qemuxml2argvdata/hostdev-mdev-display-vnc-egl-headless.xml index b3eaeeef13..ddcf617692 100644 --- a/tests/qemuxml2argvdata/hostdev-mdev-display-vnc-egl-headless.xml +++ b/tests/qemuxml2argvdata/hostdev-mdev-display-vnc-egl-headless.xml @@ -14,12 +14,6 @@ destroy /usr/bin/qemu-system-i686 - - - - -
- diff --git a/tests/qemuxml2argvdata/hostdev-mdev-display-vnc.x86_64-latest.= args b/tests/qemuxml2argvdata/hostdev-mdev-display-vnc.x86_64-latest.args index 19439afda9..dd84b74183 100644 --- a/tests/qemuxml2argvdata/hostdev-mdev-display-vnc.x86_64-latest.args +++ b/tests/qemuxml2argvdata/hostdev-mdev-display-vnc.x86_64-latest.args @@ -23,8 +23,6 @@ file=3D/tmp/lib/domain--1-QEMUGuest2/master-key.aes \ -no-acpi \ -boot strict=3Don \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ --drive file=3D/dev/HostVG/QEMUGuest2,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ --device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ -vnc 127.0.0.1:0 \ -device qxl-vga,id=3Dvideo0,ram_size=3D67108864,vram_size=3D67108864,\ vram64_size_mb=3D0,vgamem_mb=3D16,max_outputs=3D1,bus=3Dpci.0,addr=3D0x2 \ diff --git a/tests/qemuxml2argvdata/hostdev-mdev-display-vnc.xml b/tests/qe= muxml2argvdata/hostdev-mdev-display-vnc.xml index f5b3575c04..a70f506865 100644 --- a/tests/qemuxml2argvdata/hostdev-mdev-display-vnc.xml +++ b/tests/qemuxml2argvdata/hostdev-mdev-display-vnc.xml @@ -14,12 +14,6 @@ destroy /usr/bin/qemu-system-i686 - - - - -
- diff --git a/tests/qemuxml2argvdata/hostdev-mdev-display.xml b/tests/qemuxm= l2argvdata/hostdev-mdev-display.xml index f37e08e1b9..ac4e9a7eaa 100644 --- a/tests/qemuxml2argvdata/hostdev-mdev-display.xml +++ b/tests/qemuxml2argvdata/hostdev-mdev-display.xml @@ -14,12 +14,6 @@ destroy /usr/bin/qemu-system-i686 - - - - -
- diff --git a/tests/qemuxml2argvdata/hostdev-mdev-invalid-target-address.xml= b/tests/qemuxml2argvdata/hostdev-mdev-invalid-target-address.xml index 7251a304a5..a5c10b8401 100644 --- a/tests/qemuxml2argvdata/hostdev-mdev-invalid-target-address.xml +++ b/tests/qemuxml2argvdata/hostdev-mdev-invalid-target-address.xml @@ -14,11 +14,6 @@ destroy /usr/bin/qemu-system-i686 - - - -
- diff --git a/tests/qemuxml2argvdata/hostdev-mdev-precreated.args b/tests/qe= muxml2argvdata/hostdev-mdev-precreated.args index d4090e7457..5d41ba2af5 100644 --- a/tests/qemuxml2argvdata/hostdev-mdev-precreated.args +++ b/tests/qemuxml2argvdata/hostdev-mdev-precreated.args @@ -21,9 +21,6 @@ server,nowait \ -no-shutdown \ -no-acpi \ -usb \ --drive file=3D/dev/HostVG/QEMUGuest2,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ --device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0,\ -bootindex=3D1 \ -device vfio-pci,id=3Dhostdev0,\ sysfsdev=3D/sys/bus/mdev/devices/53764d0e-85a0-42b4-af5c-2046b460b1dc,bus= =3Dpci.0,\ addr=3D0x3 diff --git a/tests/qemuxml2argvdata/hostdev-mdev-precreated.xml b/tests/qem= uxml2argvdata/hostdev-mdev-precreated.xml index 5b5028f202..a525b23550 100644 --- a/tests/qemuxml2argvdata/hostdev-mdev-precreated.xml +++ b/tests/qemuxml2argvdata/hostdev-mdev-precreated.xml @@ -14,12 +14,6 @@ destroy /usr/bin/qemu-system-i686 - - - - -
- diff --git a/tests/qemuxml2argvdata/hostdev-mdev-src-address-invalid.xml b/= tests/qemuxml2argvdata/hostdev-mdev-src-address-invalid.xml index 9ec043827f..6a321c8a42 100644 --- a/tests/qemuxml2argvdata/hostdev-mdev-src-address-invalid.xml +++ b/tests/qemuxml2argvdata/hostdev-mdev-src-address-invalid.xml @@ -14,12 +14,6 @@ destroy /usr/bin/qemu-system-i686 - - - - -
- diff --git a/tests/qemuxml2xmloutdata/hostdev-mdev-display.xml b/tests/qemu= xml2xmloutdata/hostdev-mdev-display.xml index 94c11b1199..d0a85913ac 100644 --- a/tests/qemuxml2xmloutdata/hostdev-mdev-display.xml +++ b/tests/qemuxml2xmloutdata/hostdev-mdev-display.xml @@ -14,12 +14,6 @@ destroy /usr/bin/qemu-system-i686 - - - - -
-
diff --git a/tests/qemuxml2xmloutdata/hostdev-mdev-precreated.xml b/tests/q= emuxml2xmloutdata/hostdev-mdev-precreated.xml index 2ee24dec2d..9d35fac366 100644 --- a/tests/qemuxml2xmloutdata/hostdev-mdev-precreated.xml +++ b/tests/qemuxml2xmloutdata/hostdev-mdev-precreated.xml @@ -14,12 +14,6 @@ destroy /usr/bin/qemu-system-i686 - - - - -
-
--=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176073067497.32558754271065; Mon, 13 Aug 2018 09:01:13 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 72A1630041CF; Mon, 13 Aug 2018 16:01:10 +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 1781330012A5; Mon, 13 Aug 2018 16:01:10 +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 8098B3F7FE; Mon, 13 Aug 2018 16:01:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG0oeQ001310 for ; Mon, 13 Aug 2018 12:00:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6EF0E2166BA5; Mon, 13 Aug 2018 16:00:50 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id E17D32166BA0 for ; Mon, 13 Aug 2018 16:00:49 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 17:59:49 +0200 Message-Id: <61ae65b05513836e64c927ee4ddda67abf6a28d4.1534173735.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 15/62] tests: qemuxml2argv: Fork CAPS_LATEST test cases for 'blockdev' 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.84 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Mon, 13 Aug 2018 16:01:11 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The blockdev support will change existing approach to add disks to VMs so all tests using the DO_TEST_CAPS_LATEST approach which have any disks need to be forked so that the changes can be applied. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- tests/qemuxml2argvdata/disk-aio.x86_64-2.12.0.args | 37 +++++++++++++ .../qemuxml2argvdata/disk-cache.x86_64-2.12.0.args | 50 +++++++++++++++++ .../disk-cdrom-network.x86_64-2.12.0.args | 41 ++++++++++++++ .../disk-cdrom-tray.x86_64-2.12.0.args | 39 ++++++++++++++ .../qemuxml2argvdata/disk-cdrom.x86_64-2.12.0.args | 35 ++++++++++++ .../disk-copy_on_read.x86_64-2.12.0.args | 41 ++++++++++++++ .../disk-detect-zeroes.x86_64-2.12.0.args | 37 +++++++++++++ .../disk-error-policy.x86_64-2.12.0.args | 41 ++++++++++++++ .../disk-floppy-q35-2_11.x86_64-2.12.0.args | 35 ++++++++++++ .../disk-floppy-q35-2_9.x86_64-2.12.0.args | 35 ++++++++++++ .../disk-floppy.x86_64-2.12.0.args | 35 ++++++++++++ .../disk-network-gluster.x86_64-2.12.0.args | 44 +++++++++++++++ .../disk-network-iscsi.x86_64-2.12.0.args | 63 ++++++++++++++++++= ++++ .../disk-network-nbd.x86_64-2.12.0.args | 46 ++++++++++++++++ .../disk-network-rbd.x86_64-2.12.0.args | 61 ++++++++++++++++++= +++ .../disk-network-sheepdog.x86_64-2.12.0.args | 35 ++++++++++++ .../disk-network-source-auth.x86_64-2.12.0.args | 47 ++++++++++++++++ .../disk-network-tlsx509.x86_64-2.12.0.args | 59 ++++++++++++++++++= ++ .../disk-readonly-disk.x86_64-2.12.0.args | 34 ++++++++++++ .../disk-shared.x86_64-2.12.0.args | 37 +++++++++++++ ...isk-virtio-scsi-reservations.x86_64-2.12.0.args | 43 +++++++++++++++ .../floppy-drive-fat.x86_64-2.12.0.args | 33 ++++++++++++ tests/qemuxml2argvtest.c | 22 ++++++++ 23 files changed, 950 insertions(+) create mode 100644 tests/qemuxml2argvdata/disk-aio.x86_64-2.12.0.args create mode 100644 tests/qemuxml2argvdata/disk-cache.x86_64-2.12.0.args create mode 100644 tests/qemuxml2argvdata/disk-cdrom-network.x86_64-2.12.0= .args create mode 100644 tests/qemuxml2argvdata/disk-cdrom-tray.x86_64-2.12.0.ar= gs create mode 100644 tests/qemuxml2argvdata/disk-cdrom.x86_64-2.12.0.args create mode 100644 tests/qemuxml2argvdata/disk-copy_on_read.x86_64-2.12.0.= args create mode 100644 tests/qemuxml2argvdata/disk-detect-zeroes.x86_64-2.12.0= .args create mode 100644 tests/qemuxml2argvdata/disk-error-policy.x86_64-2.12.0.= args create mode 100644 tests/qemuxml2argvdata/disk-floppy-q35-2_11.x86_64-2.12= .0.args create mode 100644 tests/qemuxml2argvdata/disk-floppy-q35-2_9.x86_64-2.12.= 0.args create mode 100644 tests/qemuxml2argvdata/disk-floppy.x86_64-2.12.0.args create mode 100644 tests/qemuxml2argvdata/disk-network-gluster.x86_64-2.12= .0.args create mode 100644 tests/qemuxml2argvdata/disk-network-iscsi.x86_64-2.12.0= .args create mode 100644 tests/qemuxml2argvdata/disk-network-nbd.x86_64-2.12.0.a= rgs create mode 100644 tests/qemuxml2argvdata/disk-network-rbd.x86_64-2.12.0.a= rgs create mode 100644 tests/qemuxml2argvdata/disk-network-sheepdog.x86_64-2.1= 2.0.args create mode 100644 tests/qemuxml2argvdata/disk-network-source-auth.x86_64-= 2.12.0.args create mode 100644 tests/qemuxml2argvdata/disk-network-tlsx509.x86_64-2.12= .0.args create mode 100644 tests/qemuxml2argvdata/disk-readonly-disk.x86_64-2.12.0= .args create mode 100644 tests/qemuxml2argvdata/disk-shared.x86_64-2.12.0.args create mode 100644 tests/qemuxml2argvdata/disk-virtio-scsi-reservations.x8= 6_64-2.12.0.args create mode 100644 tests/qemuxml2argvdata/floppy-drive-fat.x86_64-2.12.0.a= rgs diff --git a/tests/qemuxml2argvdata/disk-aio.x86_64-2.12.0.args b/tests/qem= uxml2argvdata/disk-aio.x86_64-2.12.0.args new file mode 100644 index 0000000000..1dfade0882 --- /dev/null +++ b/tests/qemuxml2argvdata/disk-aio.x86_64-2.12.0.args @@ -0,0 +1,37 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-i686 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc-i440fx-2.12,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ +-drive file=3D/dev/HostVG/QEMUGuest1,format=3Dqcow2,if=3Dnone,id=3Ddrive-i= de0-0-0,\ +cache=3Dnone,aio=3Dnative \ +-device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1,\ +write-cache=3Don \ +-drive file=3D/dev/HostVG/QEMUGuest2,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-1-0,\ +readonly=3Don,aio=3Dthreads \ +-device ide-cd,bus=3Dide.1,unit=3D0,drive=3Ddrive-ide0-1-0,id=3Dide0-1-0 \ +-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-cache.x86_64-2.12.0.args b/tests/q= emuxml2argvdata/disk-cache.x86_64-2.12.0.args new file mode 100644 index 0000000000..9220e6bee9 --- /dev/null +++ b/tests/qemuxml2argvdata/disk-cache.x86_64-2.12.0.args @@ -0,0 +1,50 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-i686 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc-i440fx-2.6,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ +-device lsi,id=3Dscsi0,bus=3Dpci.0,addr=3D0x2 \ +-drive file=3D/dev/HostVG/QEMUGuest1,format=3Dqcow2,if=3Dnone,id=3Ddrive-i= de0-0-0,\ +cache=3Dwriteback \ +-device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1,\ +write-cache=3Don \ +-drive file=3D/dev/HostVG/QEMUGuest1,format=3Dqcow2,if=3Dnone,id=3Ddrive-i= de0-0-1,\ +cache=3Dunsafe \ +-device ide-hd,bus=3Dide.0,unit=3D1,drive=3Ddrive-ide0-0-1,id=3Dide0-0-1,\ +write-cache=3Don \ +-drive file=3D/dev/HostVG/QEMUGuest1,format=3Dqcow2,if=3Dnone,id=3Ddrive-s= csi0-0-0,\ +cache=3Dnone \ +-device scsi-hd,bus=3Dscsi0.0,scsi-id=3D0,drive=3Ddrive-scsi0-0-0,id=3Dscs= i0-0-0,\ +write-cache=3Don \ +-drive file=3D/dev/HostVG/QEMUGuest1,format=3Dqcow2,if=3Dnone,id=3Ddrive-v= irtio-disk0,\ +cache=3Dwritethrough \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x3,drive=3Ddrive-vir= tio-disk0,\ +id=3Dvirtio-disk0,write-cache=3Doff \ +-drive file=3D/dev/HostVG/QEMUGuest1,format=3Dqcow2,if=3Dnone,id=3Ddrive-u= sb-disk1,\ +cache=3Ddirectsync \ +-device usb-storage,bus=3Dusb.0,port=3D1,drive=3Ddrive-usb-disk1,id=3Dusb-= disk1,\ +removable=3Doff,write-cache=3Doff \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/disk-cdrom-network.x86_64-2.12.0.args b= /tests/qemuxml2argvdata/disk-cdrom-network.x86_64-2.12.0.args new file mode 100644 index 0000000000..0ce8497840 --- /dev/null +++ b/tests/qemuxml2argvdata/disk-cdrom-network.x86_64-2.12.0.args @@ -0,0 +1,41 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc-1.2,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ +-m 1024 \ +-realtime mlock=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,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot strict=3Don \ +-device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ +-drive file=3Dftp://host.name:21/url/path/file.iso,format=3Draw,if=3Dnone,\ +id=3Ddrive-ide0-0-0,readonly=3Don \ +-device ide-cd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ +-drive file=3Dftps://host.name:990/url/path/file.iso,format=3Draw,if=3Dnon= e,\ +id=3Ddrive-ide0-0-1,readonly=3Don \ +-device ide-cd,bus=3Dide.0,unit=3D1,drive=3Ddrive-ide0-0-1,id=3Dide0-0-1 \ +-drive file=3Dhttps://host.name:443/url/path/file.iso,format=3Draw,if=3Dno= ne,\ +id=3Ddrive-ide0-1-0,readonly=3Don \ +-device ide-cd,bus=3Dide.1,unit=3D0,drive=3Ddrive-ide0-1-0,id=3Dide0-1-0 \ +-drive file=3Dtftp://host.name:69/url/path/file.iso,format=3Draw,if=3Dnone= ,\ +id=3Ddrive-ide0-1-1,readonly=3Don \ +-device ide-cd,bus=3Dide.1,unit=3D1,drive=3Ddrive-ide0-1-1,id=3Dide0-1-1 \ +-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-cdrom-tray.x86_64-2.12.0.args b/te= sts/qemuxml2argvdata/disk-cdrom-tray.x86_64-2.12.0.args new file mode 100644 index 0000000000..79863e456d --- /dev/null +++ b/tests/qemuxml2argvdata/disk-cdrom-tray.x86_64-2.12.0.args @@ -0,0 +1,39 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +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-0.13,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 1024 \ +-realtime mlock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid 3fa02811-7832-34bd-004d-1ff56a9286ff \ +-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 \ +-drive file=3D/var/lib/libvirt/images/f14.img,format=3Dqcow2,if=3Dnone,\ +id=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 \ +-device ide-cd,bus=3Dide.1,unit=3D0,drive=3Ddrive-ide0-1-0,id=3Dide0-1-0,b= ootindex=3D1 \ +-drive if=3Dnone,id=3Ddrive-ide0-1-1,readonly=3Don \ +-device ide-cd,bus=3Dide.1,unit=3D1,drive=3Ddrive-ide0-1-1,id=3Dide0-1-1 \ +-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-cdrom.x86_64-2.12.0.args b/tests/q= emuxml2argvdata/disk-cdrom.x86_64-2.12.0.args new file mode 100644 index 0000000000..59607258eb --- /dev/null +++ b/tests/qemuxml2argvdata/disk-cdrom.x86_64-2.12.0.args @@ -0,0 +1,35 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-i686 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc-i440fx-2.12,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ +-drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ +-device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ +-drive file=3D/root/boot.iso,format=3Draw,if=3Dnone,id=3Ddrive-ide0-1-0,re= adonly=3Don \ +-device ide-cd,bus=3Dide.1,unit=3D0,drive=3Ddrive-ide0-1-0,id=3Dide0-1-0 \ +-drive if=3Dnone,id=3Ddrive-ide0-1-1,readonly=3Don \ +-device ide-cd,bus=3Dide.1,unit=3D1,drive=3Ddrive-ide0-1-1,id=3Dide0-1-1 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/disk-copy_on_read.x86_64-2.12.0.args b/= tests/qemuxml2argvdata/disk-copy_on_read.x86_64-2.12.0.args new file mode 100644 index 0000000000..f2b5dbe050 --- /dev/null +++ b/tests/qemuxml2argvdata/disk-copy_on_read.x86_64-2.12.0.args @@ -0,0 +1,41 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +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-0.13,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 1024 \ +-realtime mlock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid 468404ad-d49c-40f2-9e14-02294f9c1be3 \ +-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 \ +-device virtio-serial-pci,id=3Dvirtio-serial0,bus=3Dpci.0,addr=3D0x6 \ +-drive file=3D/var/lib/libvirt/images/f14.img,format=3Dqcow2,if=3Dnone,\ +id=3Ddrive-virtio-disk0,copy-on-read=3Don \ +-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 \ +-device ide-cd,bus=3Dide.1,unit=3D0,drive=3Ddrive-ide0-1-0,id=3Dide0-1-0,b= ootindex=3D1 \ +-netdev user,id=3Dhostnet0 \ +-device virtio-net-pci,tx=3Dbh,netdev=3Dhostnet0,id=3Dnet0,mac=3D52:54:00:= e5:48:58,\ +bus=3Dpci.0,addr=3D0x2 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don 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 new file mode 100644 index 0000000000..101c0f2e65 --- /dev/null +++ b/tests/qemuxml2argvdata/disk-detect-zeroes.x86_64-2.12.0.args @@ -0,0 +1,37 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +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-0.13,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 1024 \ +-realtime mlock=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 \ +-drive file=3D/var/lib/libvirt/images/f14.img,format=3Dqcow2,if=3Dnone,\ +id=3Ddrive-virtio-disk0,discard=3Dunmap,detect-zeroes=3Dunmap \ +-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,detect-zeroes=3Don \ +-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 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/disk-error-policy.x86_64-2.12.0.args b/= tests/qemuxml2argvdata/disk-error-policy.x86_64-2.12.0.args new file mode 100644 index 0000000000..ebdddfd43a --- /dev/null +++ b/tests/qemuxml2argvdata/disk-error-policy.x86_64-2.12.0.args @@ -0,0 +1,41 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-i686 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc-i440fx-2.12,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ +-drive file=3D/dev/HostVG/QEMUGuest1,format=3Dqcow2,if=3Dnone,id=3Ddrive-i= de0-0-0,\ +werror=3Dstop,rerror=3Dstop,cache=3Dnone \ +-device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1,\ +write-cache=3Don \ +-drive file=3D/dev/HostVG/QEMUGuest2,format=3Dqcow2,if=3Dnone,id=3Ddrive-i= de0-0-1,\ +werror=3Denospc,cache=3Dnone \ +-device ide-hd,bus=3Dide.0,unit=3D1,drive=3Ddrive-ide0-0-1,id=3Dide0-0-1,\ +write-cache=3Don \ +-drive file=3D/dev/HostVG/QEMUGuest3,format=3Dqcow2,if=3Dnone,id=3Ddrive-i= de0-1-0,\ +werror=3Dreport,rerror=3Dignore,cache=3Dnone \ +-device ide-hd,bus=3Dide.1,unit=3D0,drive=3Ddrive-ide0-1-0,id=3Dide0-1-0,\ +write-cache=3Don \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/disk-floppy-q35-2_11.x86_64-2.12.0.args= b/tests/qemuxml2argvdata/disk-floppy-q35-2_11.x86_64-2.12.0.args new file mode 100644 index 0000000000..17abe9a989 --- /dev/null +++ b/tests/qemuxml2argvdata/disk-floppy-q35-2_11.x86_64-2.12.0.args @@ -0,0 +1,35 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc-q35-2.11,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device pcie-root-port,port=3D0x8,chassis=3D1,id=3Dpci.1,bus=3Dpcie.0,mult= ifunction=3Don,\ +addr=3D0x1 \ +-device pcie-root-port,port=3D0x9,chassis=3D2,id=3Dpci.2,bus=3Dpcie.0,addr= =3D0x1.0x1 \ +-device qemu-xhci,id=3Dusb,bus=3Dpci.1,addr=3D0x0 \ +-drive file=3D/tmp/firmware.img,format=3Draw,if=3Dnone,id=3Ddrive-fdc0-0-0= \ +-drive file=3D/tmp/data.img,format=3Dqcow2,if=3Dnone,id=3Ddrive-fdc0-0-1 \ +-device isa-fdc,driveA=3Ddrive-fdc0-0-0,bootindexA=3D1,driveB=3Ddrive-fdc0= -0-1 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/disk-floppy-q35-2_9.x86_64-2.12.0.args = b/tests/qemuxml2argvdata/disk-floppy-q35-2_9.x86_64-2.12.0.args new file mode 100644 index 0000000000..e4ece864fe --- /dev/null +++ b/tests/qemuxml2argvdata/disk-floppy-q35-2_9.x86_64-2.12.0.args @@ -0,0 +1,35 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc-q35-2.9,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device pcie-root-port,port=3D0x8,chassis=3D1,id=3Dpci.1,bus=3Dpcie.0,mult= ifunction=3Don,\ +addr=3D0x1 \ +-device pcie-root-port,port=3D0x9,chassis=3D2,id=3Dpci.2,bus=3Dpcie.0,addr= =3D0x1.0x1 \ +-device qemu-xhci,id=3Dusb,bus=3Dpci.1,addr=3D0x0 \ +-drive file=3D/tmp/firmware.img,format=3Draw,if=3Dnone,id=3Ddrive-fdc0-0-0= \ +-drive file=3D/tmp/data.img,format=3Dqcow2,if=3Dnone,id=3Ddrive-fdc0-0-1 \ +-device isa-fdc,driveA=3Ddrive-fdc0-0-0,bootindexA=3D1,driveB=3Ddrive-fdc0= -0-1 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/disk-floppy.x86_64-2.12.0.args b/tests/= qemuxml2argvdata/disk-floppy.x86_64-2.12.0.args new file mode 100644 index 0000000000..6265ae23c7 --- /dev/null +++ b/tests/qemuxml2argvdata/disk-floppy.x86_64-2.12.0.args @@ -0,0 +1,35 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-i686 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc-i440fx-2.12,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ +-drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ +-device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ +-drive file=3D/dev/fd0,format=3Draw,if=3Dnone,id=3Ddrive-fdc0-0-0 \ +-drive file=3D/tmp/firmware.img,format=3Draw,if=3Dnone,id=3Ddrive-fdc0-0-1= \ +-global isa-fdc.driveA=3Ddrive-fdc0-0-0 \ +-global isa-fdc.driveB=3Ddrive-fdc0-0-1 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/disk-network-gluster.x86_64-2.12.0.args= b/tests/qemuxml2argvdata/disk-network-gluster.x86_64-2.12.0.args new file mode 100644 index 0000000000..c463db0ed5 --- /dev/null +++ b/tests/qemuxml2argvdata/disk-network-gluster.x86_64-2.12.0.args @@ -0,0 +1,44 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-i686 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc-i440fx-2.12,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ +-drive file=3Dgluster://example.org:6000/Volume1/Image,file.debug=3D4,form= at=3Draw,\ +if=3Dnone,id=3Ddrive-virtio-disk0 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x2,drive=3Ddrive-vir= tio-disk0,\ +id=3Dvirtio-disk0,bootindex=3D1 \ +-drive 'file=3Dgluster+unix:///Volume2/Image?socket=3D/path/to/sock,file.d= ebug=3D4,\ +format=3Draw,if=3Dnone,id=3Ddrive-virtio-disk1' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x3,drive=3Ddrive-vir= tio-disk1,\ +id=3Dvirtio-disk1 \ +-drive file.driver=3Dgluster,file.volume=3DVolume3,file.path=3DImage.qcow2= ,\ +file.server.0.type=3Dtcp,file.server.0.host=3Dexample.org,file.server.0.po= rt=3D6000,\ +file.server.1.type=3Dtcp,file.server.1.host=3Dexample.org,file.server.1.po= rt=3D24007,\ +file.server.2.type=3Dunix,file.server.2.socket=3D/path/to/sock,file.debug= =3D4,\ +format=3Dqcow2,if=3Dnone,id=3Ddrive-virtio-disk2 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x4,drive=3Ddrive-vir= tio-disk2,\ +id=3Dvirtio-disk2 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/disk-network-iscsi.x86_64-2.12.0.args b= /tests/qemuxml2argvdata/disk-network-iscsi.x86_64-2.12.0.args new file mode 100644 index 0000000000..4b648a985d --- /dev/null +++ b/tests/qemuxml2argvdata/disk-network-iscsi.x86_64-2.12.0.args @@ -0,0 +1,63 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-i686 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc-i440fx-2.12,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ +-device virtio-scsi-pci,id=3Dscsi0,bus=3Dpci.0,addr=3D0x2 \ +-drive file.driver=3Discsi,file.portal=3Dexample.org:6000,\ +file.target=3Diqn.1992-01.com.example,file.lun=3D0,file.transport=3Dtcp,fo= rmat=3Draw,\ +if=3Dnone,id=3Ddrive-virtio-disk0 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x3,drive=3Ddrive-vir= tio-disk0,\ +id=3Dvirtio-disk0,bootindex=3D1 \ +-drive file.driver=3Discsi,file.portal=3Dexample.org:6000,\ +file.target=3Diqn.1992-01.com.example,file.lun=3D1,file.transport=3Dtcp,fo= rmat=3Draw,\ +if=3Dnone,id=3Ddrive-virtio-disk1 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x4,drive=3Ddrive-vir= tio-disk1,\ +id=3Dvirtio-disk1 \ +-object secret,id=3Dvirtio-disk2-secret0,\ +data=3D9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\ +keyid=3DmasterKey0,iv=3DAAECAwQFBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ +-drive file.driver=3Discsi,file.portal=3Dexample.org:6000,\ +file.target=3Diqn.1992-01.com.example:storage,file.lun=3D1,file.transport= =3Dtcp,\ +file.user=3Dmyname,file.password-secret=3Dvirtio-disk2-secret0,format=3Dra= w,if=3Dnone,\ +id=3Ddrive-virtio-disk2 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x5,drive=3Ddrive-vir= tio-disk2,\ +id=3Dvirtio-disk2 \ +-object secret,id=3Dvirtio-disk3-secret0,\ +data=3D9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\ +keyid=3DmasterKey0,iv=3DAAECAwQFBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ +-drive file.driver=3Discsi,file.portal=3Dexample.org:6000,\ +file.target=3Diqn.1992-01.com.example:storage,file.lun=3D2,file.transport= =3Dtcp,\ +file.user=3Dmyname,file.password-secret=3Dvirtio-disk3-secret0,format=3Dra= w,if=3Dnone,\ +id=3Ddrive-virtio-disk3 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x6,drive=3Ddrive-vir= tio-disk3,\ +id=3Dvirtio-disk3 \ +-drive file.driver=3Discsi,file.portal=3Dexample.org:3260,\ +file.target=3Diqn.1992-01.com.example,file.lun=3D0,file.transport=3Dtcp,fo= rmat=3Draw,\ +if=3Dnone,id=3Ddrive-scsi0-0-0-0 \ +-device scsi-block,bus=3Dscsi0.0,channel=3D0,scsi-id=3D0,lun=3D0,\ +drive=3Ddrive-scsi0-0-0-0,id=3Dscsi0-0-0-0 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/disk-network-nbd.x86_64-2.12.0.args b/t= ests/qemuxml2argvdata/disk-network-nbd.x86_64-2.12.0.args new file mode 100644 index 0000000000..86bde153ee --- /dev/null +++ b/tests/qemuxml2argvdata/disk-network-nbd.x86_64-2.12.0.args @@ -0,0 +1,46 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-i686 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc-i440fx-2.12,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ +-drive file=3Dnbd:example.org:6000,format=3Draw,if=3Dnone,id=3Ddrive-virti= o-disk0 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x2,drive=3Ddrive-vir= tio-disk0,\ +id=3Dvirtio-disk0,bootindex=3D1 \ +-drive file=3Dnbd:example.org:6000:exportname=3Dbar,format=3Draw,if=3Dnone= ,\ +id=3Ddrive-virtio-disk1 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x3,drive=3Ddrive-vir= tio-disk1,\ +id=3Dvirtio-disk1 \ +-drive 'file=3Dnbd://[::1]:6000,format=3Draw,if=3Dnone,id=3Ddrive-virtio-d= isk2' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x4,drive=3Ddrive-vir= tio-disk2,\ +id=3Dvirtio-disk2 \ +-drive 'file=3Dnbd://[::1]:6000/bar,format=3Draw,if=3Dnone,id=3Ddrive-virt= io-disk3' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x5,drive=3Ddrive-vir= tio-disk3,\ +id=3Dvirtio-disk3 \ +-drive file=3Dnbd:unix:/var/run/nbdsock:exportname=3Dbar,format=3Draw,if= =3Dnone,\ +id=3Ddrive-virtio-disk4 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x6,drive=3Ddrive-vir= tio-disk4,\ +id=3Dvirtio-disk4 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/disk-network-rbd.x86_64-2.12.0.args b/t= ests/qemuxml2argvdata/disk-network-rbd.x86_64-2.12.0.args new file mode 100644 index 0000000000..aa562b7afc --- /dev/null +++ b/tests/qemuxml2argvdata/disk-network-rbd.x86_64-2.12.0.args @@ -0,0 +1,61 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-i686 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc-i440fx-2.12,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ +-drive 'file=3Drbd:pool/image:auth_supported=3Dnone:mon_host=3Dmon1.exampl= e.org\:\ +6321\;mon2.example.org\:6322\;mon3.example.org\:6322,format=3Draw,if=3Dnon= e,\ +id=3Ddrive-virtio-disk0' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x2,drive=3Ddrive-vir= tio-disk0,\ +id=3Dvirtio-disk0,bootindex=3D1 \ +-drive file=3Drbd:pool/image@asdf:auth_supported=3Dnone,format=3Draw,if=3D= none,\ +id=3Ddrive-virtio-disk1 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x3,drive=3Ddrive-vir= tio-disk1,\ +id=3Dvirtio-disk1 \ +-drive 'file=3Drbd:pool/image@foo:auth_supported=3Dnone:mon_host=3Dmon1.ex= ample.org\:\ +6321\;mon2.example.org\:6322\;mon3.example.org\:6322,format=3Draw,if=3Dnon= e,\ +id=3Ddrive-virtio-disk2' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x4,drive=3Ddrive-vir= tio-disk2,\ +id=3Dvirtio-disk2 \ +-drive file=3Drbd:pool/image@foo:auth_supported=3Dnone:conf=3D/blah/test.c= onf,\ +format=3Draw,if=3Dnone,id=3Ddrive-virtio-disk3 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x5,drive=3Ddrive-vir= tio-disk3,\ +id=3Dvirtio-disk3 \ +-object secret,id=3Dvirtio-disk4-secret0,\ +data=3D9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\ +keyid=3DmasterKey0,iv=3DAAECAwQFBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ +-drive 'file=3Drbd:pool/image:id=3Dmyname:auth_supported=3Dcephx\;none:\ +mon_host=3Dmon1.example.org\:6321\;mon2.example.org\:6322\;mon3.example.or= g\:\ +6322,file.password-secret=3Dvirtio-disk4-secret0,format=3Draw,if=3Dnone,\ +id=3Ddrive-virtio-disk4' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x6,drive=3Ddrive-vir= tio-disk4,\ +id=3Dvirtio-disk4 \ +-drive 'file=3Drbd:pool/image:auth_supported=3Dnone:mon_host=3D[\:\:1]\:\ +6321\;example.org\:6789\;[ffff\:1234\:567\:abc\:\:0f]\:6322\;[2001\:db8\:\= :\ +ff00\:42\:8329]\:6322,format=3Draw,if=3Dnone,id=3Ddrive-virtio-disk5' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x7,drive=3Ddrive-vir= tio-disk5,\ +id=3Dvirtio-disk5 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/disk-network-sheepdog.x86_64-2.12.0.arg= s b/tests/qemuxml2argvdata/disk-network-sheepdog.x86_64-2.12.0.args new file mode 100644 index 0000000000..9ade05b3ba --- /dev/null +++ b/tests/qemuxml2argvdata/disk-network-sheepdog.x86_64-2.12.0.args @@ -0,0 +1,35 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-i686 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc-i440fx-2.12,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ +-drive file=3D/dev/HostVG/QEMU,,Guest,,,,1,format=3Draw,if=3Dnone,id=3Ddri= ve-ide0-0-0 \ +-device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ +-drive file=3Dsheepdog:example.org:6000:image,,with,,commas,format=3Draw,i= f=3Dnone,\ +id=3Ddrive-virtio-disk0 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x2,drive=3Ddrive-vir= tio-disk0,\ +id=3Dvirtio-disk0 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/disk-network-source-auth.x86_64-2.12.0.= args b/tests/qemuxml2argvdata/disk-network-source-auth.x86_64-2.12.0.args new file mode 100644 index 0000000000..a585b0350d --- /dev/null +++ b/tests/qemuxml2argvdata/disk-network-source-auth.x86_64-2.12.0.args @@ -0,0 +1,47 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-i686 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc-i440fx-2.12,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ +-object secret,id=3Dvirtio-disk0-secret0,\ +data=3D9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\ +keyid=3DmasterKey0,iv=3DAAECAwQFBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ +-drive file.driver=3Discsi,file.portal=3Dexample.org:6000,\ +file.target=3Diqn.1992-01.com.example:storage,file.lun=3D1,file.transport= =3Dtcp,\ +file.user=3Dmyname,file.password-secret=3Dvirtio-disk0-secret0,format=3Dra= w,if=3Dnone,\ +id=3Ddrive-virtio-disk0 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x2,drive=3Ddrive-vir= tio-disk0,\ +id=3Dvirtio-disk0,bootindex=3D1 \ +-object secret,id=3Dvirtio-disk1-secret0,\ +data=3D9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\ +keyid=3DmasterKey0,iv=3DAAECAwQFBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ +-drive 'file=3Drbd:pool/image:id=3Dmyname:auth_supported=3Dcephx\;none:\ +mon_host=3Dmon1.example.org\:6321\;mon2.example.org\:6322\;mon3.example.or= g\:\ +6322,file.password-secret=3Dvirtio-disk1-secret0,format=3Draw,if=3Dnone,\ +id=3Ddrive-virtio-disk1' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x3,drive=3Ddrive-vir= tio-disk1,\ +id=3Dvirtio-disk1 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/disk-network-tlsx509.x86_64-2.12.0.args= b/tests/qemuxml2argvdata/disk-network-tlsx509.x86_64-2.12.0.args new file mode 100644 index 0000000000..5752685514 --- /dev/null +++ b/tests/qemuxml2argvdata/disk-network-tlsx509.x86_64-2.12.0.args @@ -0,0 +1,59 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc-i440fx-2.12,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu32 \ +-m 214 \ +-realtime mlock=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,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ +-object tls-creds-x509,id=3Dobjvirtio-disk0_tls0,dir=3D/etc/pki/libvirt-vx= hs/dummy,\ +,path,endpoint=3Dclient,verify-peer=3Dyes \ +-drive file.driver=3Dvxhs,file.tls-creds=3Dobjvirtio-disk0_tls0,\ +file.vdisk-id=3Deb90327c-8302-4725-9e1b-4e85ed4dc251,\ +file.server.host=3D192.168.0.1,file.server.port=3D9999,format=3Draw,if=3Dn= one,\ +id=3Ddrive-virtio-disk0,cache=3Dnone \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x4,drive=3Ddrive-vir= tio-disk0,\ +id=3Dvirtio-disk0,bootindex=3D1,write-cache=3Don,\ +serial=3Deb90327c-8302-4725-9e1b-4e85ed4dc251 \ +-object tls-creds-x509,id=3Dobjvirtio-disk1_tls0,dir=3D/etc/pki/libvirt-vx= hs/dummy,\ +,path,endpoint=3Dclient,verify-peer=3Dyes \ +-drive file.driver=3Dvxhs,file.tls-creds=3Dobjvirtio-disk1_tls0,\ +file.vdisk-id=3Deb90327c-8302-4725-9e1b-4e85ed4dc252,\ +file.server.host=3D192.168.0.2,file.server.port=3D9999,format=3Draw,if=3Dn= one,\ +id=3Ddrive-virtio-disk1,cache=3Dnone \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x5,drive=3Ddrive-vir= tio-disk1,\ +id=3Dvirtio-disk1,write-cache=3Don,serial=3Deb90327c-8302-4725-9e1b-4e85ed= 4dc252 \ +-drive file.driver=3Dvxhs,file.vdisk-id=3Deb90327c-8302-4725-9e1b-4e85ed4d= c253,\ +file.server.host=3D192.168.0.3,file.server.port=3D9999,format=3Draw,if=3Dn= one,\ +id=3Ddrive-virtio-disk2,cache=3Dnone \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x6,drive=3Ddrive-vir= tio-disk2,\ +id=3Dvirtio-disk2,write-cache=3Don,serial=3Deb90327c-8302-4725-9e1b-4e85ed= 4dc252 \ +-object tls-creds-x509,id=3Dobjvirtio-disk3_tls0,dir=3D/etc/pki/libvirt-nb= d/dummy,,\ +path,endpoint=3Dclient,verify-peer=3Dyes \ +-drive file.driver=3Dnbd,file.server.type=3Dinet,file.server.host=3Dexampl= e.com,\ +file.server.port=3D1234,file.tls-creds=3Dobjvirtio-disk3_tls0,format=3Draw= ,if=3Dnone,\ +id=3Ddrive-virtio-disk3,cache=3Dnone \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x7,drive=3Ddrive-vir= tio-disk3,\ +id=3Dvirtio-disk3,write-cache=3Don \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/disk-readonly-disk.x86_64-2.12.0.args b= /tests/qemuxml2argvdata/disk-readonly-disk.x86_64-2.12.0.args new file mode 100644 index 0000000000..5c33067c83 --- /dev/null +++ b/tests/qemuxml2argvdata/disk-readonly-disk.x86_64-2.12.0.args @@ -0,0 +1,34 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-i686 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc-i440fx-2.12,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ +-drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ +-device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ +-drive file=3D/dev/sr0,format=3Draw,if=3Dnone,id=3Ddrive-ide0-1-0,readonly= =3Don \ +-device ide-cd,bus=3Dide.1,unit=3D0,drive=3Ddrive-ide0-1-0,id=3Dide0-1-0 \ +-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-shared.x86_64-2.12.0.args b/tests/= qemuxml2argvdata/disk-shared.x86_64-2.12.0.args new file mode 100644 index 0000000000..96d8063abb --- /dev/null +++ b/tests/qemuxml2argvdata/disk-shared.x86_64-2.12.0.args @@ -0,0 +1,37 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-i686 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc-i440fx-2.12,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ +-drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0,\ +cache=3Dnone \ +-device ide-hd,bus=3Dide.0,unit=3D0,share-rw=3Don,drive=3Ddrive-ide0-0-0,i= d=3Dide0-0-0,\ +bootindex=3D1,write-cache=3Don,serial=3DXYZXYZXYZYXXYZYZYXYZY \ +-drive file=3D/dev/HostVG/QEMUGuest2,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-1-0,\ +readonly=3Don \ +-device ide-cd,bus=3Dide.1,unit=3D0,drive=3Ddrive-ide0-1-0,id=3Dide0-1-0 \ +-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-virtio-scsi-reservations.x86_64-2.= 12.0.args b/tests/qemuxml2argvdata/disk-virtio-scsi-reservations.x86_64-2.1= 2.0.args new file mode 100644 index 0000000000..1173dac674 --- /dev/null +++ b/tests/qemuxml2argvdata/disk-virtio-scsi-reservations.x86_64-2.12.0.ar= gs @@ -0,0 +1,43 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-i686 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-object pr-manager-helper,id=3Dpr-helper0,\ +path=3D/tmp/lib/domain--1-QEMUGuest1/pr-helper0.sock \ +-machine pc-i440fx-2.12,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=3Doff \ +-smp 8,sockets=3D8,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-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 strict=3Don \ +-device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ +-device virtio-scsi-pci,id=3Dscsi0,num_queues=3D8,bus=3Dpci.0,addr=3D0x3 \ +-drive file=3D/dev/HostVG/QEMUGuest1,file.pr-manager=3Dpr-helper0,format= =3Draw,\ +if=3Dnone,id=3Ddrive-scsi0-0-0-0 \ +-device scsi-block,bus=3Dscsi0.0,channel=3D0,scsi-id=3D0,lun=3D0,\ +drive=3Ddrive-scsi0-0-0-0,id=3Dscsi0-0-0-0,bootindex=3D1 \ +-object pr-manager-helper,id=3Dpr-helper-scsi0-0-0-1,\ +path=3D/path/to/qemu-pr-helper.sock \ +-drive file=3D/dev/HostVG/QEMUGuest2,file.pr-manager=3Dpr-helper-scsi0-0-0= -1,\ +format=3Draw,if=3Dnone,id=3Ddrive-scsi0-0-0-1 \ +-device scsi-block,bus=3Dscsi0.0,channel=3D0,scsi-id=3D0,lun=3D1,\ +drive=3Ddrive-scsi0-0-0-1,id=3Dscsi0-0-0-1 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x4 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/floppy-drive-fat.x86_64-2.12.0.args b/t= ests/qemuxml2argvdata/floppy-drive-fat.x86_64-2.12.0.args new file mode 100644 index 0000000000..70b373c016 --- /dev/null +++ b/tests/qemuxml2argvdata/floppy-drive-fat.x86_64-2.12.0.args @@ -0,0 +1,33 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-i686 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc-i440fx-2.12,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ +-drive file=3Dfat:floppy:/var/somefiles,if=3Dnone,id=3Ddrive-fdc0-0-0,read= only=3Don \ +-global isa-fdc.driveA=3Ddrive-fdc0-0-0 \ +-global isa-fdc.bootindexA=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 96482a84a1..068a6421e4 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -996,16 +996,22 @@ mymain(void) QEMU_CAPS_VIRTIO_SCSI); DO_TEST("nosharepages", QEMU_CAPS_MEM_MERGE); DO_TEST("disk-cdrom", NONE); + DO_TEST_CAPS_VER("disk-cdrom", "2.12.0"); DO_TEST_CAPS_LATEST("disk-cdrom"); DO_TEST("disk-iscsi", NONE); DO_TEST("disk-cdrom-network", QEMU_CAPS_KVM); + DO_TEST_CAPS_VER("disk-cdrom-network", "2.12.0"); DO_TEST_CAPS_LATEST("disk-cdrom-network"); DO_TEST("disk-cdrom-tray", QEMU_CAPS_VIRTIO_TX_ALG); + DO_TEST_CAPS_VER("disk-cdrom-tray", "2.12.0"); DO_TEST_CAPS_LATEST("disk-cdrom-tray"); DO_TEST("disk-floppy", NONE); + DO_TEST_CAPS_VER("disk-floppy", "2.12.0"); DO_TEST_CAPS_LATEST("disk-floppy"); + DO_TEST_CAPS_VER("disk-floppy-q35-2_9", "2.12.0"); DO_TEST_CAPS_LATEST("disk-floppy-q35-2_9"); + DO_TEST_CAPS_VER("disk-floppy-q35-2_11", "2.12.0"); DO_TEST_CAPS_LATEST("disk-floppy-q35-2_11"); DO_TEST_FAILURE("disk-floppy-pseries", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE); @@ -1025,49 +1031,61 @@ mymain(void) DO_TEST("disk-boot-disk", NONE); DO_TEST("disk-boot-cdrom", NONE); DO_TEST("floppy-drive-fat", NONE); + DO_TEST_CAPS_VER("floppy-drive-fat", "2.12.0"); DO_TEST_CAPS_LATEST("floppy-drive-fat"); DO_TEST("disk-readonly-disk", NONE); + DO_TEST_CAPS_VER("disk-readonly-disk", "2.12.0"); DO_TEST_CAPS_LATEST("disk-readonly-disk"); DO_TEST("disk-fmt-qcow", NONE); DO_TEST_PARSE_ERROR("disk-fmt-cow", NONE); DO_TEST_PARSE_ERROR("disk-fmt-dir", NONE); DO_TEST_PARSE_ERROR("disk-fmt-iso", NONE); DO_TEST("disk-shared", NONE); + DO_TEST_CAPS_VER("disk-shared", "2.12.0"); DO_TEST_CAPS_LATEST("disk-shared"); DO_TEST_PARSE_ERROR("disk-shared-qcow", NONE); DO_TEST("disk-shared-locking", QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_DISK_SHARE_RW); DO_TEST("disk-error-policy", NONE); + DO_TEST_CAPS_VER("disk-error-policy", "2.12.0"); DO_TEST_CAPS_LATEST("disk-error-policy"); DO_TEST("disk-cache", QEMU_CAPS_SCSI_LSI, QEMU_CAPS_DEVICE_USB_STORAGE= ); DO_TEST_CAPS_VER("disk-cache", "2.6.0"); DO_TEST_CAPS_VER("disk-cache", "2.7.0"); + DO_TEST_CAPS_VER("disk-cache", "2.12.0"); DO_TEST_CAPS_LATEST("disk-cache"); DO_TEST("disk-network-nbd", NONE); + DO_TEST_CAPS_VER("disk-network-nbd", "2.12.0"); DO_TEST_CAPS_LATEST("disk-network-nbd"); DO_TEST("disk-network-iscsi", QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_SCSI_BL= OCK); DO_TEST("disk-network-iscsi-modern", QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_SCSI_BLOCK, QEMU_CAPS_ISCSI_PASSWORD_SECRET); + DO_TEST_CAPS_VER("disk-network-iscsi", "2.12.0"); DO_TEST_CAPS_LATEST("disk-network-iscsi"); DO_TEST_PARSE_ERROR("disk-network-iscsi-auth-secrettype-invalid", NONE= ); DO_TEST_PARSE_ERROR("disk-network-iscsi-auth-wrong-secrettype", NONE); DO_TEST_PARSE_ERROR("disk-network-source-auth-both", NONE); DO_TEST("disk-network-gluster", QEMU_CAPS_GLUSTER_DEBUG_LEVEL); + DO_TEST_CAPS_VER("disk-network-gluster", "2.12.0"); DO_TEST_CAPS_LATEST("disk-network-gluster"); DO_TEST_CAPS_VER("disk-network-rbd", "2.5.0"); + DO_TEST_CAPS_VER("disk-network-rbd", "2.12.0"); DO_TEST_CAPS_LATEST("disk-network-rbd"); DO_TEST_FAILURE("disk-network-rbd-no-colon", NONE); DO_TEST("disk-network-sheepdog", NONE); + DO_TEST_CAPS_VER("disk-network-sheepdog", "2.12.0"); DO_TEST_CAPS_LATEST("disk-network-sheepdog"); DO_TEST("disk-network-source-auth", NONE); + DO_TEST_CAPS_VER("disk-network-source-auth", "2.12.0"); DO_TEST_CAPS_LATEST("disk-network-source-auth"); DO_TEST("disk-network-vxhs", QEMU_CAPS_VXHS); driver.config->vxhsTLS =3D 1; DO_TEST("disk-network-tlsx509", QEMU_CAPS_VXHS, QEMU_CAPS_OBJECT_TLS_CREDS_X509, QEMU_CAPS_NBD_TLS); + DO_TEST_CAPS_VER("disk-network-tlsx509", "2.12.0"); DO_TEST_CAPS_LATEST("disk-network-tlsx509"); driver.config->vxhsTLS =3D 0; VIR_FREE(driver.config->vxhsTLSx509certdir); @@ -1116,6 +1134,7 @@ mymain(void) DO_TEST("disk-sata-device", QEMU_CAPS_ICH9_AHCI); DO_TEST("disk-aio", NONE); + DO_TEST_CAPS_VER("disk-aio", "2.12.0"); DO_TEST_CAPS_LATEST("disk-aio"); DO_TEST("disk-source-pool", NONE); DO_TEST("disk-source-pool-mode", NONE); @@ -1126,12 +1145,14 @@ mymain(void) DO_TEST("disk-copy_on_read", QEMU_CAPS_VIRTIO_TX_ALG, 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-detect-zeroes", "2.12.0"); DO_TEST_CAPS_LATEST("disk-detect-zeroes"); DO_TEST("disk-snapshot", NONE); DO_TEST_PARSE_ERROR("disk-same-targets", @@ -2892,6 +2913,7 @@ mymain(void) QEMU_CAPS_PIIX_DISABLE_S3, QEMU_CAPS_PIIX_DISABLE_S4, QEMU_CAPS_ICH9_USB_EHCI1); + DO_TEST_CAPS_VER("disk-virtio-scsi-reservations", "2.12.0"); DO_TEST_CAPS_LATEST("disk-virtio-scsi-reservations"); DO_TEST_CAPS_LATEST("tseg-explicit-size"); --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176078994424.2506031195669; Mon, 13 Aug 2018 09:01:18 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3D165A203E; Mon, 13 Aug 2018 16:01:16 +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 CA2AA18B42; Mon, 13 Aug 2018 16:01:15 +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 78AFA3F601; Mon, 13 Aug 2018 16:01:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG0pmI001320 for ; Mon, 13 Aug 2018 12:00:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1F9A72166BA5; Mon, 13 Aug 2018 16:00:51 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id AF3392166BA0 for ; Mon, 13 Aug 2018 16:00:50 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 17:59:50 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 16/62] tests: qemu: Add test data for backing chains and indexes 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 13 Aug 2018 16:01:17 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Add test data for nested backing chains with/without indexes (used in status XMLs) which will excercise blockdev and the related work. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- .../disk-backing-chains-index.x86_64-2.12.0.args | 1 + .../disk-backing-chains-index.x86_64-latest.args | 1 + .../qemuxml2argvdata/disk-backing-chains-index.xml | 145 +++++++++++++++++= ++++ .../disk-backing-chains-noindex.x86_64-2.12.0.args | 58 +++++++++ .../disk-backing-chains-noindex.x86_64-latest.args | 58 +++++++++ .../disk-backing-chains-noindex.xml | 145 +++++++++++++++++= ++++ tests/qemuxml2argvtest.c | 4 + .../disk-backing-chains-index-active.xml | 76 +++++++++++ .../disk-backing-chains-index-inactive.xml | 76 +++++++++++ .../disk-backing-chains-noindex-active.xml | 76 +++++++++++ .../disk-backing-chains-noindex-inactive.xml | 76 +++++++++++ tests/qemuxml2xmltest.c | 2 + 12 files changed, 718 insertions(+) create mode 120000 tests/qemuxml2argvdata/disk-backing-chains-index.x86_64= -2.12.0.args create mode 120000 tests/qemuxml2argvdata/disk-backing-chains-index.x86_64= -latest.args create mode 100644 tests/qemuxml2argvdata/disk-backing-chains-index.xml create mode 100644 tests/qemuxml2argvdata/disk-backing-chains-noindex.x86_= 64-2.12.0.args create mode 100644 tests/qemuxml2argvdata/disk-backing-chains-noindex.x86_= 64-latest.args create mode 100644 tests/qemuxml2argvdata/disk-backing-chains-noindex.xml create mode 100644 tests/qemuxml2xmloutdata/disk-backing-chains-index-acti= ve.xml create mode 100644 tests/qemuxml2xmloutdata/disk-backing-chains-index-inac= tive.xml create mode 100644 tests/qemuxml2xmloutdata/disk-backing-chains-noindex-ac= tive.xml create mode 100644 tests/qemuxml2xmloutdata/disk-backing-chains-noindex-in= active.xml diff --git a/tests/qemuxml2argvdata/disk-backing-chains-index.x86_64-2.12.0= .args b/tests/qemuxml2argvdata/disk-backing-chains-index.x86_64-2.12.0.args new file mode 120000 index 0000000000..3f4cd9040d --- /dev/null +++ b/tests/qemuxml2argvdata/disk-backing-chains-index.x86_64-2.12.0.args @@ -0,0 +1 @@ +disk-backing-chains-noindex.x86_64-2.12.0.args \ No newline at end of file diff --git a/tests/qemuxml2argvdata/disk-backing-chains-index.x86_64-latest= .args b/tests/qemuxml2argvdata/disk-backing-chains-index.x86_64-latest.args new file mode 120000 index 0000000000..549eb65512 --- /dev/null +++ b/tests/qemuxml2argvdata/disk-backing-chains-index.x86_64-latest.args @@ -0,0 +1 @@ +disk-backing-chains-noindex.x86_64-latest.args \ No newline at end of file diff --git a/tests/qemuxml2argvdata/disk-backing-chains-index.xml b/tests/q= emuxml2argvdata/disk-backing-chains-index.xml new file mode 100644 index 0000000000..95b8a64cf8 --- /dev/null +++ b/tests/qemuxml2argvdata/disk-backing-chains-index.xml @@ -0,0 +1,145 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/qemuxml2argvdata/disk-backing-chains-noindex.x86_64-2.12= .0.args b/tests/qemuxml2argvdata/disk-backing-chains-noindex.x86_64-2.12.0.= args new file mode 100644 index 0000000000..dea109b13a --- /dev/null +++ b/tests/qemuxml2argvdata/disk-backing-chains-noindex.x86_64-2.12.0.args @@ -0,0 +1,58 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-i686 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc-i440fx-2.12,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ +-drive 'file=3Dgluster+unix:///Volume2/Image?socket=3D/path/to/sock,file.d= ebug=3D4,\ +format=3Dqcow2,if=3Dnone,id=3Ddrive-virtio-disk0' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x2,drive=3Ddrive-vir= tio-disk0,\ +id=3Dvirtio-disk0,bootindex=3D1 \ +-drive file=3Dnbd:unix:/var/run/nbdsock:exportname=3Dbar,format=3Dqcow2,if= =3Dnone,\ +id=3Ddrive-virtio-disk1 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x3,drive=3Ddrive-vir= tio-disk1,\ +id=3Dvirtio-disk1 \ +-drive file=3Dgluster://example.org:6000/Volume1/Image,file.debug=3D4,form= at=3Draw,\ +if=3Dnone,id=3Ddrive-virtio-disk2 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x4,drive=3Ddrive-vir= tio-disk2,\ +id=3Dvirtio-disk2 \ +-object secret,id=3Dvirtio-disk3-secret0,\ +data=3D9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\ +keyid=3DmasterKey0,iv=3DAAECAwQFBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ +-drive 'file=3Drbd:pool/image:id=3Dmyname:auth_supported=3Dcephx\;none:\ +mon_host=3Dmon1.example.org\:6321\;mon2.example.org\:6322\;mon3.example.or= g\:\ +6322,file.password-secret=3Dvirtio-disk3-secret0,format=3Dqcow2,if=3Dnone,\ +id=3Ddrive-virtio-disk3' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x5,drive=3Ddrive-vir= tio-disk3,\ +id=3Dvirtio-disk3 \ +-drive file=3D/dev/HostVG/QEMUGuest11,format=3Dqcow2,if=3Dnone,id=3Ddrive-= virtio-disk4 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x6,drive=3Ddrive-vir= tio-disk4,\ +id=3Dvirtio-disk4 \ +-drive file=3D/var/lib/libvirt/images/rhel7.1484071880,format=3Dqcow2,if= =3Dnone,\ +id=3Ddrive-virtio-disk5 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x7,drive=3Ddrive-vir= tio-disk5,\ +id=3Dvirtio-disk5 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x8 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/disk-backing-chains-noindex.x86_64-late= st.args b/tests/qemuxml2argvdata/disk-backing-chains-noindex.x86_64-latest.= args new file mode 100644 index 0000000000..afe078adcc --- /dev/null +++ b/tests/qemuxml2argvdata/disk-backing-chains-noindex.x86_64-latest.args @@ -0,0 +1,58 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-i686 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=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,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ +-drive 'file=3Dgluster+unix:///Volume2/Image?socket=3D/path/to/sock,file.d= ebug=3D4,\ +format=3Dqcow2,if=3Dnone,id=3Ddrive-virtio-disk0' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x2,drive=3Ddrive-vir= tio-disk0,\ +id=3Dvirtio-disk0,bootindex=3D1 \ +-drive file=3Dnbd:unix:/var/run/nbdsock:exportname=3Dbar,format=3Dqcow2,if= =3Dnone,\ +id=3Ddrive-virtio-disk1 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x3,drive=3Ddrive-vir= tio-disk1,\ +id=3Dvirtio-disk1 \ +-drive file=3Dgluster://example.org:6000/Volume1/Image,file.debug=3D4,form= at=3Draw,\ +if=3Dnone,id=3Ddrive-virtio-disk2 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x4,drive=3Ddrive-vir= tio-disk2,\ +id=3Dvirtio-disk2 \ +-object secret,id=3Dvirtio-disk3-secret0,\ +data=3D9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\ +keyid=3DmasterKey0,iv=3DAAECAwQFBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ +-drive 'file=3Drbd:pool/image:id=3Dmyname:auth_supported=3Dcephx\;none:\ +mon_host=3Dmon1.example.org\:6321\;mon2.example.org\:6322\;mon3.example.or= g\:\ +6322,file.password-secret=3Dvirtio-disk3-secret0,format=3Dqcow2,if=3Dnone,\ +id=3Ddrive-virtio-disk3' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x5,drive=3Ddrive-vir= tio-disk3,\ +id=3Dvirtio-disk3 \ +-drive file=3D/dev/HostVG/QEMUGuest11,format=3Dqcow2,if=3Dnone,id=3Ddrive-= virtio-disk4 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x6,drive=3Ddrive-vir= tio-disk4,\ +id=3Dvirtio-disk4 \ +-drive file=3D/var/lib/libvirt/images/rhel7.1484071880,format=3Dqcow2,if= =3Dnone,\ +id=3Ddrive-virtio-disk5 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x7,drive=3Ddrive-vir= tio-disk5,\ +id=3Dvirtio-disk5 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x8 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/disk-backing-chains-noindex.xml b/tests= /qemuxml2argvdata/disk-backing-chains-noindex.xml new file mode 100644 index 0000000000..1336d0fdd6 --- /dev/null +++ b/tests/qemuxml2argvdata/disk-backing-chains-noindex.xml @@ -0,0 +1,145 @@ + + 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 068a6421e4..b043274c8e 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1185,6 +1185,10 @@ mymain(void) QEMU_CAPS_ICH9_AHCI); DO_TEST_PARSE_ERROR("disk-scsi-incompatible-address", QEMU_CAPS_VIRTIO_SCSI); + DO_TEST_CAPS_VER("disk-backing-chains-index", "2.12.0"); + DO_TEST_CAPS_LATEST("disk-backing-chains-index"); + DO_TEST_CAPS_VER("disk-backing-chains-noindex", "2.12.0"); + DO_TEST_CAPS_LATEST("disk-backing-chains-noindex"); DO_TEST("graphics-egl-headless", QEMU_CAPS_EGL_HEADLESS, diff --git a/tests/qemuxml2xmloutdata/disk-backing-chains-index-active.xml = b/tests/qemuxml2xmloutdata/disk-backing-chains-index-active.xml new file mode 100644 index 0000000000..db70ae2b53 --- /dev/null +++ b/tests/qemuxml2xmloutdata/disk-backing-chains-index-active.xml @@ -0,0 +1,76 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ + + + + + + + + + + + +
+ + + + + +
+ + + + + +
+ + +
+ + + + + +
+ + + diff --git a/tests/qemuxml2xmloutdata/disk-backing-chains-index-inactive.xm= l b/tests/qemuxml2xmloutdata/disk-backing-chains-index-inactive.xml new file mode 100644 index 0000000000..db70ae2b53 --- /dev/null +++ b/tests/qemuxml2xmloutdata/disk-backing-chains-index-inactive.xml @@ -0,0 +1,76 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ + + + + + + + + + + + +
+ + + + + +
+ + + + + +
+ + +
+ + + + + +
+ + + diff --git a/tests/qemuxml2xmloutdata/disk-backing-chains-noindex-active.xm= l b/tests/qemuxml2xmloutdata/disk-backing-chains-noindex-active.xml new file mode 100644 index 0000000000..db70ae2b53 --- /dev/null +++ b/tests/qemuxml2xmloutdata/disk-backing-chains-noindex-active.xml @@ -0,0 +1,76 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ + + + + + + + + + + + +
+ + + + + +
+ + + + + +
+ + +
+ + + + + +
+ + + diff --git a/tests/qemuxml2xmloutdata/disk-backing-chains-noindex-inactive.= xml b/tests/qemuxml2xmloutdata/disk-backing-chains-noindex-inactive.xml new file mode 100644 index 0000000000..db70ae2b53 --- /dev/null +++ b/tests/qemuxml2xmloutdata/disk-backing-chains-noindex-inactive.xml @@ -0,0 +1,76 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ + + + + + + + + + + + +
+ + + + + +
+ + + + + +
+ + +
+ + + + + +
+ + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 7fe5043519..c1efd821b3 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -989,6 +989,8 @@ mymain(void) DO_TEST("panic-no-address", NONE); DO_TEST("disk-backing-chains", NONE); + DO_TEST("disk-backing-chains-index", NONE); + DO_TEST("disk-backing-chains-noindex", NONE); DO_TEST("chardev-label", NONE); --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176109183860.444487811006; Mon, 13 Aug 2018 09:01:49 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3B3A3C050DF9; Mon, 13 Aug 2018 16:01:47 +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 DE98A60BE7; Mon, 13 Aug 2018 16:01:46 +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 6C84724B79; Mon, 13 Aug 2018 16:01:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG0ptV001330 for ; Mon, 13 Aug 2018 12:00:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id C17222166BA5; Mon, 13 Aug 2018 16:00:51 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5F1FA2166BA0 for ; Mon, 13 Aug 2018 16:00:51 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 17:59:51 +0200 Message-Id: <855c39a04dd3e6fc76777d83ea72da7c2e2d3ede.1534173735.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 17/62] qemu: hotplug: Don't generate alias when detaching disk 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 13 Aug 2018 16:01:48 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" It should be impossible to lack an alias in the domain definition. Other disk types don't generate it so remove it here as well. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/qemu/qemu_hotplug.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 87bc63e5e1..53ee01bc54 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -4915,11 +4915,6 @@ qemuDomainDetachVirtioDiskDevice(virQEMUDriverPtr dr= iver, goto cleanup; } - if (!detach->info.alias) { - if (qemuAssignDeviceDiskAlias(vm->def, detach) < 0) - goto cleanup; - } - if (!async) qemuDomainMarkDeviceForRemoval(vm, &detach->info); --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176085714281.58275244330514; Mon, 13 Aug 2018 09:01:25 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9EE2130BB341; Mon, 13 Aug 2018 16:01:22 +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 59171AC339; Mon, 13 Aug 2018 16:01:22 +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 94B8A18037F8; Mon, 13 Aug 2018 16:01:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG0qd3001340 for ; Mon, 13 Aug 2018 12:00:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7163A2166BA5; Mon, 13 Aug 2018 16:00:52 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0E54E2166BA0 for ; Mon, 13 Aug 2018 16:00:51 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 17:59:52 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 18/62] util: virqemu: Simplify debugging if building QOM object with missing args 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.84 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Mon, 13 Aug 2018 16:01:24 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Print the values so it's simpler to debug. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/util/virqemu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util/virqemu.c b/src/util/virqemu.c index bc788538af..13ad7410b4 100644 --- a/src/util/virqemu.c +++ b/src/util/virqemu.c @@ -235,8 +235,9 @@ virQEMUBuildObjectCommandlineFromJSONInternal(virBuffer= Ptr buf, virJSONValuePtr props) { if (!type || !alias) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("missing 'type' or 'alias' field of QOM 'object'"= )); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("missing 'type'(%s) or 'alias'(%s) field of QOM '= object'"), + NULLSTR(type), NULLSTR(alias)); return -1; } --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176116115813.5557997759203; Mon, 13 Aug 2018 09:01:56 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 36BCF8F264; Mon, 13 Aug 2018 16:01:53 +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 EF198AC331; Mon, 13 Aug 2018 16:01:52 +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 8913024602; Mon, 13 Aug 2018 16:01:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG0rJv001353 for ; Mon, 13 Aug 2018 12:00:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2CCD22166BA5; Mon, 13 Aug 2018 16:00:53 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id BEE202166BA0 for ; Mon, 13 Aug 2018 16:00:52 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 17:59:53 +0200 Message-Id: <21505431d69c03606e50294765d18832c24d55db.1534173735.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 19/62] qemu: caps: Add capability for using the blockdev infrastructure 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.84 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 13 Aug 2018 16:01:54 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The capability currently is not enabled so that we can add individual bits first. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/qemu/qemu_capabilities.c | 1 + src/qemu/qemu_capabilities.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index e6e199b2c6..f8c5967655 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -507,6 +507,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, /* 315 */ "vfio-pci.display", + "blockdev", ); diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 26813a908c..ece5771cc2 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -491,6 +491,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for = syntax-check */ /* 315 */ QEMU_CAPS_VFIO_PCI_DISPLAY, /* -device vfio-pci.display */ + QEMU_CAPS_BLOCKDEV, /* -blockdev and blockdev-add are supported */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176095612317.27409776724323; Mon, 13 Aug 2018 09:01:35 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2796C31500A5; Mon, 13 Aug 2018 16:01: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 F30811108754; Mon, 13 Aug 2018 16:01:29 +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 55E7C18037F2; Mon, 13 Aug 2018 16:01:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG0rvY001368 for ; Mon, 13 Aug 2018 12:00:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id CFDF42166BA5; Mon, 13 Aug 2018 16:00:53 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6D65E2166BA0 for ; Mon, 13 Aug 2018 16:00:53 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 17:59:54 +0200 Message-Id: <06fb8c767bc6f70e8ae159a31f60bdbf57f28df3.1534173735.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 20/62] qemu: process: clear QEMU_CAPS_BLOCKDEV for VMs with SD card 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Mon, 13 Aug 2018 16:01:34 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" SD cards are currently passed by using -drive only which would not be compatible with using -blockdev fully. Clear QEMU_CAPS_BLOCKDEV if the VM has such devices. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/qemu/qemu_process.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index c1a8dfda29..38e88404aa 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5882,6 +5882,15 @@ qemuProcessPrepareDomain(virQEMUDriverPtr driver, qemuProcessPrepareAllowReboot(vm); + /* clear the 'blockdev' capability for VMs which have disks that need + * -drive or which have floppies where we can't reliably get the QOM p= ath */ + for (i =3D 0; i < vm->def->ndisks; i++) { + if (qemuDiskBusNeedsDriveArg(vm->def->disks[i]->bus)) { + virQEMUCapsClear(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); + break; + } + } + /* * Normally PCI addresses are assigned in the virDomainCreate * or virDomainDefine methods. We might still need to assign --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176121301402.33560691760806; Mon, 13 Aug 2018 09:02:01 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0BF393082149; Mon, 13 Aug 2018 16:01:59 +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 A7558709EC; Mon, 13 Aug 2018 16:01:58 +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 E41151800FD9; Mon, 13 Aug 2018 16:01:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG0sV1001383 for ; Mon, 13 Aug 2018 12:00:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7F0842166BA5; Mon, 13 Aug 2018 16:00:54 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1CA022166BA0 for ; Mon, 13 Aug 2018 16:00:53 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 17:59:55 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 21/62] qemu: domain: Don't redetect backing chain when using -blockdev 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Mon, 13 Aug 2018 16:02:00 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We need to load the backing chain from the XML when using -blockdev. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/qemu/qemu_process.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 38e88404aa..d9acb4bd68 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6024,8 +6024,10 @@ qemuProcessPrepareHostStorage(virQEMUDriverPtr drive= r, virDomainObjPtr vm, unsigned int flags) { + qemuDomainObjPrivatePtr priv =3D vm->privateData; size_t i; bool cold_boot =3D flags & VIR_QEMU_PROCESS_START_COLD; + bool blockdev =3D virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); for (i =3D vm->def->ndisks; i > 0; i--) { size_t idx =3D i - 1; @@ -6034,7 +6036,9 @@ qemuProcessPrepareHostStorage(virQEMUDriverPtr driver, if (virStorageSourceIsEmpty(disk->src)) continue; - virStorageSourceBackingStoreClear(disk->src); + /* backing chain needs to be redetected if we aren't using blockde= v */ + if (!blockdev) + virStorageSourceBackingStoreClear(disk->src); if (qemuDomainDetermineDiskChain(driver, vm, disk, true) >=3D 0) continue; @@ -7710,7 +7714,8 @@ qemuProcessReconnect(void *opaque) goto error; /* backing chains need to be refreshed only if they could change */ - if (priv->reconnectBlockjobs !=3D VIR_TRISTATE_BOOL_NO) { + if (priv->reconnectBlockjobs !=3D VIR_TRISTATE_BOOL_NO && + !virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV)) { /* This should be the only place that calls * qemuDomainDetermineDiskChain with @report_broken =3D=3D fal= se * to guarantee best-effort domain reconnect */ --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176127319686.2918482712346; Mon, 13 Aug 2018 09:02:07 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 18468308404B; Mon, 13 Aug 2018 16:02:05 +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 C06BC3083322; Mon, 13 Aug 2018 16:02:04 +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 62A7114B0E; Mon, 13 Aug 2018 16:02:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG0tWJ001394 for ; Mon, 13 Aug 2018 12:00:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2D1E62166BA5; Mon, 13 Aug 2018 16:00:55 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id BF7C92166BA0 for ; Mon, 13 Aug 2018 16:00:54 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 17:59:56 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 22/62] qemu: process: Don't detect nodenames when we support -blockdev 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.84 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Mon, 13 Aug 2018 16:02:06 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We'll specify them ourselves so it's pointless to attempt to redetect them. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/qemu/qemu_process.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index d9acb4bd68..ff4d992ff1 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -7804,7 +7804,8 @@ qemuProcessReconnect(void *opaque) if (qemuProcessRefreshDisks(driver, obj, QEMU_ASYNC_JOB_NONE) < 0) goto error; - if (qemuBlockNodeNamesDetect(driver, obj, QEMU_ASYNC_JOB_NONE) < 0) + if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV) && + qemuBlockNodeNamesDetect(driver, obj, QEMU_ASYNC_JOB_NONE) < 0) goto error; if (qemuRefreshVirtioChannelState(driver, obj, QEMU_ASYNC_JOB_NONE) < = 0) --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176133898932.5518569490225; Mon, 13 Aug 2018 09:02:13 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4233961477; Mon, 13 Aug 2018 16:02:11 +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 EB98917A77; Mon, 13 Aug 2018 16:02:10 +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 6D04E1800BDD; Mon, 13 Aug 2018 16:02:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG0uLe001405 for ; Mon, 13 Aug 2018 12:00:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6AF222166BA5; Mon, 13 Aug 2018 16:00:56 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0780A2166BA0 for ; Mon, 13 Aug 2018 16:00:55 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 17:59:57 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 23/62] conf: domain: Format out user provided backing chains in XML 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 13 Aug 2018 16:02:12 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" If a user configures the backing chain in the XML we should not ignore it. We already do parse it but don't format it out. As a safety-precaution don't attempt to format detected chain into the inactive XML. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/conf/domain_conf.c | 8 ++- .../disk-backing-chains-inactive.xml | 35 ++++++++++ .../disk-backing-chains-index-active.xml | 80 ++++++++++++++++++= ++++ .../disk-backing-chains-index-inactive.xml | 80 ++++++++++++++++++= ++++ .../disk-backing-chains-noindex-active.xml | 80 ++++++++++++++++++= ++++ .../disk-backing-chains-noindex-inactive.xml | 80 ++++++++++++++++++= ++++ tests/qemuxml2xmloutdata/disk-mirror-inactive.xml | 4 ++ .../disk-mirror-old-inactive.xml | 4 ++ 8 files changed, 369 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index f0d44bb75d..93d745bb74 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -23797,10 +23797,15 @@ virDomainDiskBackingStoreFormat(virBufferPtr buf, unsigned int flags) { const char *format; + bool inactive =3D flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE; if (!backingStore) return 0; + /* don't write detected backing chain members to inactive xml */ + if (inactive && backingStore->detected) + return 0; + if (backingStore->type =3D=3D VIR_STORAGE_TYPE_NONE) { virBufferAddLit(buf, "\n"); return 0; @@ -24066,8 +24071,7 @@ virDomainDiskDefFormat(virBufferPtr buf, /* Don't format backingStore to inactive XMLs until the code for * persistent storage of backing chains is ready. */ - if (!(flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE) && - virDomainDiskBackingStoreFormat(buf, def->src->backingStore, + if (virDomainDiskBackingStoreFormat(buf, def->src->backingStore, xmlopt, flags) < 0) return -1; diff --git a/tests/qemuxml2xmloutdata/disk-backing-chains-inactive.xml b/te= sts/qemuxml2xmloutdata/disk-backing-chains-inactive.xml index a9db12ba4d..c1af58ff6f 100644 --- a/tests/qemuxml2xmloutdata/disk-backing-chains-inactive.xml +++ b/tests/qemuxml2xmloutdata/disk-backing-chains-inactive.xml @@ -19,6 +19,10 @@ + + + +
@@ -27,6 +31,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
@@ -35,6 +64,7 @@ +
@@ -48,6 +78,11 @@ + + + + +
diff --git a/tests/qemuxml2xmloutdata/disk-backing-chains-index-active.xml = b/tests/qemuxml2xmloutdata/disk-backing-chains-index-active.xml index db70ae2b53..724afa4e83 100644 --- a/tests/qemuxml2xmloutdata/disk-backing-chains-index-active.xml +++ b/tests/qemuxml2xmloutdata/disk-backing-chains-index-active.xml @@ -19,6 +19,10 @@ + + + +
@@ -27,6 +31,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
@@ -35,6 +64,7 @@ +
@@ -48,6 +78,11 @@ + + + + +
@@ -60,6 +95,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/tests/qemuxml2xmloutdata/disk-backing-chains-index-inactive.xm= l b/tests/qemuxml2xmloutdata/disk-backing-chains-index-inactive.xml index db70ae2b53..29d1ad002d 100644 --- a/tests/qemuxml2xmloutdata/disk-backing-chains-index-inactive.xml +++ b/tests/qemuxml2xmloutdata/disk-backing-chains-index-inactive.xml @@ -19,6 +19,10 @@ + + + +
@@ -27,6 +31,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
@@ -35,6 +64,7 @@ +
@@ -48,6 +78,11 @@ + + + + +
@@ -60,6 +95,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/tests/qemuxml2xmloutdata/disk-backing-chains-noindex-active.xm= l b/tests/qemuxml2xmloutdata/disk-backing-chains-noindex-active.xml index db70ae2b53..29d1ad002d 100644 --- a/tests/qemuxml2xmloutdata/disk-backing-chains-noindex-active.xml +++ b/tests/qemuxml2xmloutdata/disk-backing-chains-noindex-active.xml @@ -19,6 +19,10 @@ + + + +
@@ -27,6 +31,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
@@ -35,6 +64,7 @@ +
@@ -48,6 +78,11 @@ + + + + +
@@ -60,6 +95,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/tests/qemuxml2xmloutdata/disk-backing-chains-noindex-inactive.= xml b/tests/qemuxml2xmloutdata/disk-backing-chains-noindex-inactive.xml index db70ae2b53..29d1ad002d 100644 --- a/tests/qemuxml2xmloutdata/disk-backing-chains-noindex-inactive.xml +++ b/tests/qemuxml2xmloutdata/disk-backing-chains-noindex-inactive.xml @@ -19,6 +19,10 @@ + + + +
@@ -27,6 +31,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
@@ -35,6 +64,7 @@ +
@@ -48,6 +78,11 @@ + + + + +
@@ -60,6 +95,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/tests/qemuxml2xmloutdata/disk-mirror-inactive.xml b/tests/qemu= xml2xmloutdata/disk-mirror-inactive.xml index cc7aed0873..5c9b72738d 100644 --- a/tests/qemuxml2xmloutdata/disk-mirror-inactive.xml +++ b/tests/qemuxml2xmloutdata/disk-mirror-inactive.xml @@ -17,12 +17,14 @@ +
+
@@ -30,12 +32,14 @@ +
+
diff --git a/tests/qemuxml2xmloutdata/disk-mirror-old-inactive.xml b/tests/= qemuxml2xmloutdata/disk-mirror-old-inactive.xml index cc7aed0873..5c9b72738d 100644 --- a/tests/qemuxml2xmloutdata/disk-mirror-old-inactive.xml +++ b/tests/qemuxml2xmloutdata/disk-mirror-old-inactive.xml @@ -17,12 +17,14 @@ +
+
@@ -30,12 +32,14 @@ +
+
--=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176102247412.02045306688956; Mon, 13 Aug 2018 09:01:42 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 0BC2A3078AA5; Mon, 13 Aug 2018 16:01:40 +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 3AC367A2F7; Mon, 13 Aug 2018 16:01:39 +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 389E518037F2; Mon, 13 Aug 2018 16:01:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG0vvY001413 for ; Mon, 13 Aug 2018 12:00:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1A9D52166BA5; Mon, 13 Aug 2018 16:00:57 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id AAC202166BA0 for ; Mon, 13 Aug 2018 16:00:56 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 17:59:58 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 24/62] qemu: domain: Add infrastructure to generate block node names 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Mon, 13 Aug 2018 16:01:41 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Node names for block objects in qemu need to be unique for an instance of the qemu process. Add a counter to generate objects sequentially and store it in the status XML so that we can restore it. The helpers added allow to create new node names and reset the counter after the VM process terminates. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/qemu/qemu_domain.c | 38 ++++++++++++++++++++++++++++++++++++++ src/qemu/qemu_domain.h | 6 ++++++ src/qemu/qemu_process.c | 3 +++ 3 files changed, 47 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index e5f055f203..032ad80baa 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2438,6 +2438,9 @@ qemuDomainObjPrivateXMLFormat(virBufferPtr buf, qemuDomainObjPrivateXMLFormatPR(buf, priv); + if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV)) + virBufferAsprintf(buf, "\n", priv->nodena= meindex); + if (qemuDomainObjPrivateXMLFormatBlockjobs(buf, vm) < 0) return -1; @@ -2933,6 +2936,14 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, if (qemuDomainObjPrivateXMLParseBlockjobs(priv, ctxt) < 0) goto error; + qemuDomainStorageIdReset(priv); + if (virXPathULongLong("string(./nodename/@next)", ctxt, + &priv->nodenameindex) =3D=3D -2) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("failed to parse node name index")); + goto error; + } + return 0; error: @@ -13179,3 +13190,30 @@ qemuDomainGetManagedPRSocketPath(qemuDomainObjPriv= atePtr priv) return ret; } + + +/** + * qemuDomainStorageIdNew: + * @priv: qemu VM private data object. + * + * Generate a new unique id for a storage object. Useful for node name gen= eration. + */ +unsigned int +qemuDomainStorageIdNew(qemuDomainObjPrivatePtr priv) +{ + return ++priv->nodenameindex; +} + + +/** + * qemuDomainStorageIdReset: + * @priv: qemu VM private data object. + * + * Resets the data for the node name generator. The node names need to be = unique + * for a single instance, so can be reset on VM shutdown. + */ +void +qemuDomainStorageIdReset(qemuDomainObjPrivatePtr priv) +{ + priv->nodenameindex =3D 0; +} diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 7b79d77257..5dcbdfbbe1 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -363,6 +363,9 @@ struct _qemuDomainObjPrivate { /* true if qemu-pr-helper process is running for the domain */ bool prDaemonRunning; + + /* counter for generating node names for qemu disks */ + unsigned long long nodenameindex; }; # define QEMU_DOMAIN_PRIVATE(vm) \ @@ -1063,4 +1066,7 @@ qemuDomainDiskCachemodeFlags(int cachemode, char * qemuDomainGetManagedPRSocketPath(qemuDomainObjPrivatePtr priv); +unsigned int qemuDomainStorageIdNew(qemuDomainObjPrivatePtr priv); +void qemuDomainStorageIdReset(qemuDomainObjPrivatePtr priv); + #endif /* __QEMU_DOMAIN_H__ */ diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index ff4d992ff1..0bf8245173 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -7154,6 +7154,9 @@ void qemuProcessStop(virQEMUDriverPtr driver, /* clear all private data entries which are no longer needed */ qemuDomainObjPrivateDataClear(priv); + /* reset node name allocator */ + qemuDomainStorageIdReset(priv); + /* The "release" hook cleans up additional resources */ if (virHookPresent(VIR_HOOK_DRIVER_QEMU)) { char *xml =3D qemuDomainDefFormatXML(driver, vm->def, 0); --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176100519511.50552828635034; Mon, 13 Aug 2018 09:01:40 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8A50C80F8F; Mon, 13 Aug 2018 16:01:37 +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 10B8B60BE7; Mon, 13 Aug 2018 16:01:37 +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 9215D24F5F; Mon, 13 Aug 2018 16:01:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG0vBh001421 for ; Mon, 13 Aug 2018 12:00:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id BDF1D2166BA5; Mon, 13 Aug 2018 16:00:57 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5BC3A2166BA0 for ; Mon, 13 Aug 2018 16:00:57 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 17:59:59 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 25/62] conf: Implement private data formatting and parsing for disks 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 13 Aug 2018 16:01:39 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Allow storing of private data in the status XML for disks. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/conf/domain_conf.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++= ++++ src/conf/domain_conf.h | 7 ++++++ 2 files changed, 67 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 93d745bb74..c10e0a9eca 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9676,6 +9676,30 @@ virDomainDiskDefDriverParseXML(virDomainDiskDefPtr d= ef, } +static int +virDomainDiskDefParsePrivateData(xmlXPathContextPtr ctxt, + virDomainDiskDefPtr disk, + virDomainXMLOptionPtr xmlopt) +{ + xmlNodePtr save_node =3D ctxt->node; + int ret =3D 0; + + if (!xmlopt || + !xmlopt->privateData.diskParse) + return 0; + + if (!(ctxt->node =3D virXPathNode("./privateData", ctxt))) + goto cleanup; + + if (xmlopt->privateData.diskParse(ctxt, disk) < 0) + ret =3D -1; + + cleanup: + ctxt->node =3D save_node; + return ret; +} + + #define VENDOR_LEN 8 #define PRODUCT_LEN 16 @@ -10091,6 +10115,10 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xml= opt, goto error; } + if (flags & VIR_DOMAIN_DEF_PARSE_STATUS && + virDomainDiskDefParsePrivateData(ctxt, def, xmlopt) < 0) + goto error; + if (virDomainDiskDefParseValidate(def, vmSeclabels, nvmSeclabels) < 0) goto error; @@ -24006,6 +24034,35 @@ virDomainDiskDefFormatMirror(virBufferPtr buf, } +static int +virDomainDiskDefFormatPrivateData(virBufferPtr buf, + virDomainDiskDefPtr disk, + unsigned int flags, + virDomainXMLOptionPtr xmlopt) +{ + virBuffer childBuf =3D VIR_BUFFER_INITIALIZER; + + if (!(flags & VIR_DOMAIN_DEF_FORMAT_STATUS) || + !xmlopt || + !xmlopt->privateData.diskFormat) + return 0; + + virBufferSetChildIndent(&childBuf, buf); + + if (xmlopt->privateData.diskFormat(disk, &childBuf) < 0) + goto error; + + if (virXMLFormatElement(buf, "privateData", NULL, &childBuf) < 0) + goto error; + + return 0; + + error: + virBufferFreeAndReset(&childBuf); + return -1; +} + + static int virDomainDiskDefFormat(virBufferPtr buf, virDomainDiskDefPtr def, @@ -24119,6 +24176,9 @@ virDomainDiskDefFormat(virBufferPtr buf, virDomainDeviceInfoFormat(buf, &def->info, flags | VIR_DOMAIN_DEF_FORMAT_ALLOW_BOOT); + if (virDomainDiskDefFormatPrivateData(buf, def, flags, xmlopt) < 0) + return -1; + virBufferAdjustIndent(buf, -2); virBufferAddLit(buf, "\n"); return 0; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index c1dfa37fdf..50d2ead607 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2735,6 +2735,11 @@ typedef int (*virDomainXMLPrivateDataParseFunc)(xmlX= PathContextPtr, typedef void *(*virDomainXMLPrivateDataGetParseOpaqueFunc)(virDomainObjPtr= vm); +typedef int (*virDomainXMLPrivateDataDiskParseFunc)(xmlXPathContextPtr ctx= t, + virDomainDiskDefPtr di= sk); +typedef int (*virDomainXMLPrivateDataDiskFormatFunc)(virDomainDiskDefPtr d= isk, + virBufferPtr buf); + typedef int (*virDomainXMLPrivateDataStorageSourceParseFunc)(xmlXPathConte= xtPtr ctxt, virStorageSou= rcePtr src); typedef int (*virDomainXMLPrivateDataStorageSourceFormatFunc)(virStorageSo= urcePtr src, @@ -2749,6 +2754,8 @@ struct _virDomainXMLPrivateDataCallbacks { /* note that private data for devices are not copied when using * virDomainDefCopy and similar functions */ virDomainXMLPrivateDataNewFunc diskNew; + virDomainXMLPrivateDataDiskParseFunc diskParse; + virDomainXMLPrivateDataDiskFormatFunc diskFormat; virDomainXMLPrivateDataNewFunc vcpuNew; virDomainXMLPrivateDataNewFunc chrSourceNew; virDomainXMLPrivateDataNewFunc vsockNew; --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176107751191.57366690535014; Mon, 13 Aug 2018 09:01:47 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7B442307CF30; Mon, 13 Aug 2018 16:01:44 +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 1F26260BE7; Mon, 13 Aug 2018 16:01:44 +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 99E8318037FC; Mon, 13 Aug 2018 16:01:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG0whJ001433 for ; Mon, 13 Aug 2018 12:00:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6C77E2166BA5; Mon, 13 Aug 2018 16:00:58 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0A8582166BA0 for ; Mon, 13 Aug 2018 16:00:57 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:00 +0200 Message-Id: <1ef0695a7d3ec153707a0bae2b7629c7c99aeaed.1534173735.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 26/62] conf: Allow formatting and parsing of 'index' for disk source image 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Mon, 13 Aug 2018 16:01:46 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Similarly to backing store indexes which will become stable eventually we need also to be able to format and store in the status XML for later use the index for the top level of the backing chain. Add XML formatter, parser, schema and docs. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- docs/formatdomain.html.in | 7 ++++++- docs/schemas/domaincommon.rng | 19 +++++++++++++++++= ++ src/conf/domain_conf.c | 21 +++++++++++++++++= ---- .../qemuxml2argvdata/disk-backing-chains-index.xml | 12 ++++++------ .../disk-backing-chains-index-active.xml | 12 ++++++------ 5 files changed, 54 insertions(+), 17 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 34664f7903..231e74e6b8 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -2962,6 +2962,11 @@ is only valid when the specified storage volume is of 'file' or 'block' type).

+ The source element may also have the index + attribute with same semantics the + index attribute of backingStore +

+

The source element may contain the following sub elem= ents:

@@ -3170,7 +3175,7 @@ by the backing store, see disk type attribute above for more details and possible values. -
index
+
index
This attribute is only valid in output (and ignored on input) = and it can be used to refer to a specific part of the disk chain w= hen diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 1a786968cc..e98f71536f 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -1528,6 +1528,14 @@ + + + + + + + + @@ -1551,6 +1559,7 @@ + @@ -1575,6 +1584,7 @@ + @@ -1600,6 +1610,7 @@ + @@ -1653,6 +1664,7 @@ rbd + @@ -1692,6 +1704,7 @@ iscsi + @@ -1714,6 +1727,7 @@ + @@ -1732,6 +1746,7 @@ + @@ -1752,6 +1767,7 @@ + @@ -1765,6 +1781,7 @@ gluster + @@ -1782,6 +1799,7 @@ + @@ -1826,6 +1844,7 @@ + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index c10e0a9eca..72602fb48c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9805,6 +9805,13 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlop= t, startupPolicy =3D virXMLPropString(cur, "startupPolicy"); + if (!(flags & VIR_DOMAIN_DEF_PARSE_INACTIVE) && + (tmp =3D virXMLPropString(cur, "index")) && + virStrToLong_uip(tmp, NULL, 10, &def->src->id) < 0) { + virReportError(VIR_ERR_XML_ERROR, _("invalid disk index '%= s'"), tmp); + goto error; + } + VIR_FREE(tmp); } else if (!target && virXMLNodeNameEqual(cur, "target")) { target =3D virXMLPropString(cur, "dev"); @@ -23776,6 +23783,7 @@ virDomainDiskSourceFormatInternal(virBufferPtr buf, int policy, unsigned int flags, bool skipSeclabels, + bool attrIndex, virDomainXMLOptionPtr xmlopt) { virBuffer attrBuf =3D VIR_BUFFER_INITIALIZER; @@ -23792,6 +23800,9 @@ virDomainDiskSourceFormatInternal(virBufferPtr buf, virBufferEscapeString(&attrBuf, " startupPolicy=3D'%s'", virDomainStartupPolicyTypeToString(policy)); + if (attrIndex && src->id !=3D 0) + virBufferAsprintf(&attrBuf, " index=3D'%u'", src->id); + if (virDomainDiskSourceFormatPrivateData(&childBuf, src, flags, xmlopt= ) < 0) goto cleanup; @@ -23814,7 +23825,8 @@ virDomainDiskSourceFormat(virBufferPtr buf, unsigned int flags, virDomainXMLOptionPtr xmlopt) { - return virDomainDiskSourceFormatInternal(buf, src, policy, flags, fals= e, xmlopt); + return virDomainDiskSourceFormatInternal(buf, src, policy, flags, fals= e, + false, xmlopt); } @@ -23856,7 +23868,8 @@ virDomainDiskBackingStoreFormat(virBufferPtr buf, virBufferAsprintf(buf, "\n", format); /* We currently don't output seclabels for backing chain element */ - if (virDomainDiskSourceFormatInternal(buf, backingStore, 0, flags, tru= e, xmlopt) < 0 || + if (virDomainDiskSourceFormatInternal(buf, backingStore, 0, flags, tru= e, + false, xmlopt) < 0 || virDomainDiskBackingStoreFormat(buf, backingStore->backingStore, xmlopt, flags) < 0) return -1; @@ -24122,8 +24135,8 @@ virDomainDiskDefFormat(virBufferPtr buf, if (def->src->auth && !def->src->authInherited) virStorageAuthDefFormat(buf, def->src->auth); - if (virDomainDiskSourceFormat(buf, def->src, def->startupPolicy, - flags, xmlopt) < 0) + if (virDomainDiskSourceFormatInternal(buf, def->src, def->startupPolic= y, + flags, false, true, xmlopt) < 0) return -1; /* Don't format backingStore to inactive XMLs until the code for diff --git a/tests/qemuxml2argvdata/disk-backing-chains-index.xml b/tests/q= emuxml2argvdata/disk-backing-chains-index.xml index 95b8a64cf8..5e0a03fbc4 100644 --- a/tests/qemuxml2argvdata/disk-backing-chains-index.xml +++ b/tests/qemuxml2argvdata/disk-backing-chains-index.xml @@ -16,7 +16,7 @@ /usr/bin/qemu-system-i686 - + @@ -27,7 +27,7 @@ - + @@ -61,7 +61,7 @@ - + @@ -71,7 +71,7 @@ - + @@ -85,12 +85,12 @@ - + - + diff --git a/tests/qemuxml2xmloutdata/disk-backing-chains-index-active.xml = b/tests/qemuxml2xmloutdata/disk-backing-chains-index-active.xml index 724afa4e83..2b5bc9e1b4 100644 --- a/tests/qemuxml2xmloutdata/disk-backing-chains-index-active.xml +++ b/tests/qemuxml2xmloutdata/disk-backing-chains-index-active.xml @@ -16,7 +16,7 @@ /usr/bin/qemu-system-i686 - + @@ -28,7 +28,7 @@ - + @@ -61,7 +61,7 @@ - + @@ -73,7 +73,7 @@ - + @@ -88,13 +88,13 @@ - +
- + --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176104298684.8081454211467; Mon, 13 Aug 2018 09:01:44 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2240830B9303; Mon, 13 Aug 2018 16:01:42 +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 CA612308BDA6; Mon, 13 Aug 2018 16:01:41 +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 3F40D18037F8; Mon, 13 Aug 2018 16:01:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG0xf3001443 for ; Mon, 13 Aug 2018 12:00:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1C5E02166BA5; Mon, 13 Aug 2018 16:00:59 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id ACFA82166BA0 for ; Mon, 13 Aug 2018 16:00:58 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:01 +0200 Message-Id: <20733c2784e31a6e5ad2977758ac9bea92104ce4.1534173735.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 27/62] qemu: Use proper backingIndex when reporting stats for backing chain 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.84 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Mon, 13 Aug 2018 16:01:43 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Use the index stored in virStorageSource struct rather than recalculating it. Currently we'd report proper numbers but that will change with blockdev. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/qemu/qemu_driver.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 7456db6468..7b9c19087e 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -20033,7 +20033,6 @@ qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver, virDomainDiskDefPtr disk, virStorageSourcePtr src, size_t block_idx, - unsigned int backing_idx, virHashTablePtr stats, virHashTablePtr nodedata) { @@ -20042,16 +20041,16 @@ qemuDomainGetStatsOneBlock(virQEMUDriverPtr drive= r, char *alias =3D NULL; if (disk->info.alias) - alias =3D qemuDomainStorageAlias(disk->info.alias, backing_idx); + alias =3D qemuDomainStorageAlias(disk->info.alias, src->id); QEMU_ADD_NAME_PARAM(record, maxparams, "block", "name", block_idx, disk->dst); if (virStorageSourceIsLocalStorage(src) && src->path) QEMU_ADD_NAME_PARAM(record, maxparams, "block", "path", block_idx, src->path); - if (backing_idx) + if (src->id) QEMU_ADD_BLOCK_PARAM_UI(record, maxparams, block_idx, "backingInde= x", - backing_idx); + src->id); /* the VM is offline so we have to go and load the stast from the disk= by * ourselves */ @@ -20168,16 +20167,14 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver, for (i =3D 0; i < dom->def->ndisks; i++) { virDomainDiskDefPtr disk =3D dom->def->disks[i]; virStorageSourcePtr src =3D disk->src; - unsigned int backing_idx =3D 0; while (virStorageSourceIsBacking(src) && - (backing_idx =3D=3D 0 || visitBacking)) { + (src =3D=3D disk->src || visitBacking)) { if (qemuDomainGetStatsOneBlock(driver, cfg, dom, record, maxpa= rams, - disk, src, visited, backing_idx, + disk, src, visited, stats, nodestats) < 0) goto cleanup; visited++; - backing_idx++; src =3D src->backingStore; } } --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176111292192.0070128697979; Mon, 13 Aug 2018 09:01:51 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6C520A1026; Mon, 13 Aug 2018 16:01:48 +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 0C75E308BDA6; Mon, 13 Aug 2018 16:01:48 +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 86FFE18037FD; Mon, 13 Aug 2018 16:01:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG0xOq001456 for ; Mon, 13 Aug 2018 12:00:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id BCE692166BA5; Mon, 13 Aug 2018 16:00:59 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5B9132166BA0 for ; Mon, 13 Aug 2018 16:00:59 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:02 +0200 Message-Id: <5926cdd358a21dfc58e19c62daa24d86bbfc31d4.1534173735.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 28/62] qemu: Add field to store QDEV path of a disk in private data 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.84 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 13 Aug 2018 16:01:50 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" When using -blockdev you need to use the qdev path to refer to the disk fronends. Add means for storing the path and getting it after restart. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 27 +++++++++++++++++++++++++++ src/qemu/qemu_domain.h | 2 ++ tests/qemustatusxml2xmldata/modern-in.xml | 3 +++ 3 files changed, 32 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 032ad80baa..3058ceca79 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1065,6 +1065,7 @@ qemuDomainDiskPrivateDispose(void *obj) VIR_FREE(priv->blockJobError); virStorageSourceFree(priv->migrSource); + VIR_FREE(priv->backendQomName); } static virClassPtr qemuDomainStorageSourcePrivateClass; @@ -2123,6 +2124,30 @@ qemuStorageSourcePrivateDataFormat(virStorageSourceP= tr src, } +static int +qemuDomainDiskPrivateParse(xmlXPathContextPtr ctxt, + virDomainDiskDefPtr disk) +{ + qemuDomainDiskPrivatePtr priv =3D QEMU_DOMAIN_DISK_PRIVATE(disk); + + priv->backendQomName =3D virXPathString("string(./qom/@backend)", ctxt= ); + + return 0; +} + + +static int +qemuDomainDiskPrivateFormat(virDomainDiskDefPtr disk, + virBufferPtr buf) +{ + qemuDomainDiskPrivatePtr priv =3D QEMU_DOMAIN_DISK_PRIVATE(disk); + + virBufferEscapeString(buf, "\n", priv->backendQom= Name); + + return 0; +} + + static void qemuDomainObjPrivateXMLFormatVcpus(virBufferPtr buf, virDomainDefPtr def) @@ -2973,6 +2998,8 @@ virDomainXMLPrivateDataCallbacks virQEMUDriverPrivate= DataCallbacks =3D { .alloc =3D qemuDomainObjPrivateAlloc, .free =3D qemuDomainObjPrivateFree, .diskNew =3D qemuDomainDiskPrivateNew, + .diskParse =3D qemuDomainDiskPrivateParse, + .diskFormat =3D qemuDomainDiskPrivateFormat, .vcpuNew =3D qemuDomainVcpuPrivateNew, .chrSourceNew =3D qemuDomainChrSourcePrivateNew, .vsockNew =3D qemuDomainVsockPrivateNew, diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 5dcbdfbbe1..7d0b304727 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -396,6 +396,8 @@ struct _qemuDomainDiskPrivate { /* information about the device */ bool tray; /* device has tray */ bool removable; /* device media can be removed/changed */ + + char *backendQomName; /* QOM path to the eligible block backend */ }; # define QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src) \ diff --git a/tests/qemustatusxml2xmldata/modern-in.xml b/tests/qemustatusxm= l2xmldata/modern-in.xml index 4fb5f326c2..21d4faca66 100644 --- a/tests/qemustatusxml2xmldata/modern-in.xml +++ b/tests/qemustatusxml2xmldata/modern-in.xml @@ -331,6 +331,9 @@
+ + + --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176117311952.0382354544793; Mon, 13 Aug 2018 09:01:57 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 125ED5D5E8; Mon, 13 Aug 2018 16:01:55 +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 C310F5D750; Mon, 13 Aug 2018 16:01:54 +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 603AF245FE; Mon, 13 Aug 2018 16:01:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG103v001468 for ; Mon, 13 Aug 2018 12:01:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6B5342166BA5; Mon, 13 Aug 2018 16:01:00 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 093C62166BA0 for ; Mon, 13 Aug 2018 16:00:59 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:03 +0200 Message-Id: <8ca33a7e8c8cddfd42ece6e3a6ce2b033001376a.1534173735.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 29/62] qemu: alias: Generate QDEV name of the block backend for disks 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 13 Aug 2018 16:01:56 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" When we stop using -drive qemu stops reporting it in some of the monitor commands. To allow referring the disk frontends and the corresponding block backends we need to know these names. Unfortunately different buses require different names. Signed-off-by: Peter Krempa --- src/qemu/qemu_alias.c | 86 +++++++++++++++++++++++++++++++++++----------= ---- src/qemu/qemu_alias.h | 3 +- src/qemu/qemu_hotplug.c | 2 +- 3 files changed, 65 insertions(+), 26 deletions(-) diff --git a/src/qemu/qemu_alias.c b/src/qemu/qemu_alias.c index 80d9b6cf46..e66a8a5c1d 100644 --- a/src/qemu/qemu_alias.c +++ b/src/qemu/qemu_alias.c @@ -175,44 +175,82 @@ qemuAssignDeviceControllerAlias(virDomainDefPtr domai= nDef, } -/* Our custom -drive naming scheme used with id=3D */ int qemuAssignDeviceDiskAlias(virDomainDefPtr def, - virDomainDiskDefPtr disk) + virDomainDiskDefPtr disk, + virQEMUCapsPtr qemuCaps) { + qemuDomainDiskPrivatePtr diskPriv =3D QEMU_DOMAIN_DISK_PRIVATE(disk); const char *prefix =3D virDomainDiskBusTypeToString(disk->bus); int controllerModel =3D -1; if (disk->info.alias) return 0; - if (disk->info.type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE) { - if (disk->bus =3D=3D VIR_DOMAIN_DISK_BUS_SCSI) { - controllerModel =3D qemuDomainFindSCSIControllerModel(def, - &disk->inf= o); - if (controllerModel < 0) + if (!disk->info.alias) { + if (disk->info.type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE) { + if (disk->bus =3D=3D VIR_DOMAIN_DISK_BUS_SCSI) { + controllerModel =3D qemuDomainFindSCSIControllerModel(def, + &disk-= >info); + if (controllerModel < 0) + return -1; + } + + if (disk->bus !=3D VIR_DOMAIN_DISK_BUS_SCSI || + controllerModel =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LS= ILOGIC) { + if (virAsprintf(&disk->info.alias, "%s%d-%d-%d", prefix, + disk->info.addr.drive.controller, + disk->info.addr.drive.bus, + disk->info.addr.drive.unit) < 0) + return -1; + } else { + if (virAsprintf(&disk->info.alias, "%s%d-%d-%d-%d", prefix, + disk->info.addr.drive.controller, + disk->info.addr.drive.bus, + disk->info.addr.drive.target, + disk->info.addr.drive.unit) < 0) + return -1; + } + } else { + int idx =3D virDiskNameToIndex(disk->dst); + if (virAsprintf(&disk->info.alias, "%s-disk%d", prefix, idx) <= 0) return -1; } + } - if (disk->bus !=3D VIR_DOMAIN_DISK_BUS_SCSI || - controllerModel =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSILOG= IC) { - if (virAsprintf(&disk->info.alias, "%s%d-%d-%d", prefix, - disk->info.addr.drive.controller, - disk->info.addr.drive.bus, - disk->info.addr.drive.unit) < 0) + /* For -blockdev we need to know the QDEV ids of the block backend of = the + * disk. The QDEV id used by qemu is based on the alias so we generate= them + * here. */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) { + switch ((virDomainDiskBus) disk->bus) { + case VIR_DOMAIN_DISK_BUS_FDC: + case VIR_DOMAIN_DISK_BUS_IDE: + case VIR_DOMAIN_DISK_BUS_SATA: + case VIR_DOMAIN_DISK_BUS_SCSI: + if (VIR_STRDUP(diskPriv->backendQomName, disk->info.alias) < 0) return -1; - } else { - if (virAsprintf(&disk->info.alias, "%s%d-%d-%d-%d", prefix, - disk->info.addr.drive.controller, - disk->info.addr.drive.bus, - disk->info.addr.drive.target, - disk->info.addr.drive.unit) < 0) + break; + + case VIR_DOMAIN_DISK_BUS_VIRTIO: + if (virAsprintf(&diskPriv->backendQomName, + "/machine/peripheral/%s/virtio-backend", + disk->info.alias) < 0) return -1; + break; + + case VIR_DOMAIN_DISK_BUS_USB: + if (virAsprintf(&diskPriv->backendQomName, + "/machine/peripheral/%s/%s.0/legacy[0]", + disk->info.alias, disk->info.alias) < 0) + return -1; + break; + + case VIR_DOMAIN_DISK_BUS_XEN: + case VIR_DOMAIN_DISK_BUS_UML: + case VIR_DOMAIN_DISK_BUS_SD: + case VIR_DOMAIN_DISK_BUS_LAST: + break; } - } else { - int idx =3D virDiskNameToIndex(disk->dst); - if (virAsprintf(&disk->info.alias, "%s-disk%d", prefix, idx) < 0) - return -1; } return 0; @@ -551,7 +589,7 @@ qemuAssignDeviceAliases(virDomainDefPtr def, virQEMUCap= sPtr qemuCaps) size_t i; for (i =3D 0; i < def->ndisks; i++) { - if (qemuAssignDeviceDiskAlias(def, def->disks[i]) < 0) + if (qemuAssignDeviceDiskAlias(def, def->disks[i], qemuCaps) < 0) return -1; } for (i =3D 0; i < def->nnets; i++) { diff --git a/src/qemu/qemu_alias.h b/src/qemu/qemu_alias.h index 7bfebff968..33b9937ea4 100644 --- a/src/qemu/qemu_alias.h +++ b/src/qemu/qemu_alias.h @@ -39,7 +39,8 @@ int qemuAssignDeviceControllerAlias(virDomainDefPtr domai= nDef, virDomainControllerDefPtr controller); int qemuAssignDeviceDiskAlias(virDomainDefPtr def, - virDomainDiskDefPtr disk); + virDomainDiskDefPtr disk, + virQEMUCapsPtr qemuCaps); int qemuAssignDeviceHostdevAlias(virDomainDefPtr def, char **alias, diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 53ee01bc54..32d0c3862e 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -645,7 +645,7 @@ qemuDomainAttachDiskGeneric(virQEMUDriverPtr driver, if (qemuHotplugPrepareDiskAccess(driver, vm, disk, NULL, false) < 0) goto cleanup; - if (qemuAssignDeviceDiskAlias(vm->def, disk) < 0) + if (qemuAssignDeviceDiskAlias(vm->def, disk, priv->qemuCaps) < 0) goto error; if (!(diskdata =3D qemuHotplugDiskSourceAttachPrepare(disk, priv->qemu= Caps))) --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176139060274.8211236113665; Mon, 13 Aug 2018 09:02:19 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F0A9ECCB90; Mon, 13 Aug 2018 16:02:16 +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 755633001A60; Mon, 13 Aug 2018 16:02:16 +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 0610B1800B73; Mon, 13 Aug 2018 16:02:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG111d001478 for ; Mon, 13 Aug 2018 12:01:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1A9112166BA5; Mon, 13 Aug 2018 16:01:01 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id AC27A2166BA0 for ; Mon, 13 Aug 2018 16:01:00 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:04 +0200 Message-Id: <25a2d0375e7bb7afa6e5f668f9f87786df649cb0.1534173735.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 30/62] qemu: command: Setup floppy drives via -device for blockdev 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.84 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 13 Aug 2018 16:02:17 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" To allow referring to the drives via the QOM id we need to setup the floppy drives with a proper ID. This means that -device should be used for them. There are the following quirks: - FDC needs to be instantiated prior to any floppy device - floppy drive specified via -device does not support 'bootindex' (hacked around by passing bootindexA=3D1 to the FDC) Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 42 +++++++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index a3fadc505d..72fdffa92a 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -2060,6 +2060,10 @@ qemuBuildDiskDeviceStr(const virDomainDef *def, goto error; break; + case VIR_DOMAIN_DISK_BUS_FDC: + virBufferAsprintf(&opt, "floppy,unit=3D%d", disk->info.addr.drive.= unit); + break; + default: virReportError(VIR_ERR_INTERNAL_ERROR, _("unsupported disk bus '%s' with device setup"), b= us); @@ -2181,17 +2185,20 @@ qemuBuildFloppyCommandLineControllerOptions(virComm= andPtr cmd, else driveLetter =3D 'A'; - if (qemuDomainDiskGetBackendAlias(disk, qemuCaps, &backendAlias) <= 0) - goto cleanup; - - if (backendAlias && - virAsprintf(&backendStr, "drive%c=3D%s", driveLetter, backendA= lias) < 0) - goto cleanup; - if (bootindex && virAsprintf(&bootindexStr, "bootindex%c=3D%u", driveLetter, bo= otindex) < 0) goto cleanup; + /* with -blockdev we setup the floppy device and it's backend with= -device */ + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) { + if (qemuDomainDiskGetBackendAlias(disk, qemuCaps, &backendAlia= s) < 0) + goto cleanup; + + if (backendAlias && + virAsprintf(&backendStr, "drive%c=3D%s", driveLetter, back= endAlias) < 0) + goto cleanup; + } + if (!explicitfdc) { if (backendStr) { virCommandAddArg(cmd, "-global"); @@ -2303,7 +2310,8 @@ qemuBuildDiskCommandLine(virCommandPtr cmd, return -1; if (!qemuDiskBusNeedsDriveArg(disk->bus)) { - if (disk->bus !=3D VIR_DOMAIN_DISK_BUS_FDC) { + if (disk->bus !=3D VIR_DOMAIN_DISK_BUS_FDC || + virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) { virCommandAddArg(cmd, "-device"); if (!(optstr =3D qemuBuildDiskDeviceStr(def, disk, bootindex, @@ -2327,6 +2335,7 @@ qemuBuildDisksCommandLine(virCommandPtr cmd, unsigned int bootCD =3D 0; unsigned int bootFloppy =3D 0; unsigned int bootDisk =3D 0; + bool blockdev =3D virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV); for (i =3D 0; i < def->os.nBootDevs; i++) { switch (def->os.bootDevs[i]) { @@ -2342,6 +2351,12 @@ qemuBuildDisksCommandLine(virCommandPtr cmd, } } + /* If we want to express the floppy drives via -device, the controller= needs + * to be instantiated prior to that */ + if (blockdev && + qemuBuildFloppyCommandLineControllerOptions(cmd, def, qemuCaps, bo= otFloppy) < 0) + return -1; + for (i =3D 0; i < def->ndisks; i++) { virDomainDiskDefPtr disk =3D def->disks[i]; unsigned int bootindex =3D 0; @@ -2362,12 +2377,17 @@ qemuBuildDisksCommandLine(virCommandPtr cmd, } } - if (qemuBuildDiskCommandLine(cmd, def, disk, qemuCaps, - bootindex) < 0) + /* The floppy device itself does not support the bootindex property + * so we need to set it up for the controller */ + if (disk->device =3D=3D VIR_DOMAIN_DISK_DEVICE_FLOPPY) + bootindex =3D 0; + + if (qemuBuildDiskCommandLine(cmd, def, disk, qemuCaps, bootindex) = < 0) return -1; } - if (qemuBuildFloppyCommandLineControllerOptions(cmd, def, qemuCaps, bo= otFloppy) < 0) + if (!blockdev && + qemuBuildFloppyCommandLineControllerOptions(cmd, def, qemuCaps, bo= otFloppy) < 0) return -1; return 0; --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176123836519.290467272606; Mon, 13 Aug 2018 09:02:03 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 8138CE8CD3; Mon, 13 Aug 2018 16:02:01 +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 06644171B2; Mon, 13 Aug 2018 16:02:01 +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 9B6641800C99; Mon, 13 Aug 2018 16:02:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG12lg001496 for ; Mon, 13 Aug 2018 12:01:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id BC8942166BA5; Mon, 13 Aug 2018 16:01:02 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5854D2166BA0 for ; Mon, 13 Aug 2018 16:01:01 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:05 +0200 Message-Id: <5b8a1a68604b1527e2e8011faa41d85504501644.1534173735.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 31/62] qemu: domain: Add field for storing node name for copy-on-read 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 13 Aug 2018 16:02:02 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The copy-on-read feature is expressed by adding a new node layer in qemu when using -blockdev. Since we will keep these per-disk (as opposed to per storage source) we need to store the appropriate node names in the disk definition. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 11 +++++++++++ src/qemu/qemu_domain.h | 1 + tests/qemustatusxml2xmldata/modern-in.xml | 3 +++ 3 files changed, 15 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 3058ceca79..e0dd3c0b15 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1066,6 +1066,7 @@ qemuDomainDiskPrivateDispose(void *obj) VIR_FREE(priv->blockJobError); virStorageSourceFree(priv->migrSource); VIR_FREE(priv->backendQomName); + VIR_FREE(priv->nodeCopyOnRead); } static virClassPtr qemuDomainStorageSourcePrivateClass; @@ -2131,6 +2132,7 @@ qemuDomainDiskPrivateParse(xmlXPathContextPtr ctxt, qemuDomainDiskPrivatePtr priv =3D QEMU_DOMAIN_DISK_PRIVATE(disk); priv->backendQomName =3D virXPathString("string(./qom/@backend)", ctxt= ); + priv->nodeCopyOnRead =3D virXPathString("string(./nodenames/nodename[@= type=3D'copyOnRead']/@name)", ctxt); return 0; } @@ -2144,6 +2146,15 @@ qemuDomainDiskPrivateFormat(virDomainDiskDefPtr disk, virBufferEscapeString(buf, "\n", priv->backendQom= Name); + if (priv->nodeCopyOnRead) { + virBufferAddLit(buf, "\n"); + virBufferAdjustIndent(buf, 2); + virBufferEscapeString(buf, "\n", + priv->nodeCopyOnRead); + virBufferAdjustIndent(buf, -2); + virBufferAddLit(buf, "\n"); + } + return 0; } diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 7d0b304727..d3147cb69a 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -398,6 +398,7 @@ struct _qemuDomainDiskPrivate { bool removable; /* device media can be removed/changed */ char *backendQomName; /* QOM path to the eligible block backend */ + char *nodeCopyOnRead; /* nodename of the disk-wide copy-on-read blockd= ev layer */ }; # define QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src) \ diff --git a/tests/qemustatusxml2xmldata/modern-in.xml b/tests/qemustatusxm= l2xmldata/modern-in.xml index 21d4faca66..612090786a 100644 --- a/tests/qemustatusxml2xmldata/modern-in.xml +++ b/tests/qemustatusxml2xmldata/modern-in.xml @@ -333,6 +333,9 @@
+ + + --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176145667706.2568033236588; Mon, 13 Aug 2018 09:02:25 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6B96E4E4E6; Mon, 13 Aug 2018 16:02:23 +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 1C321170E3; Mon, 13 Aug 2018 16:02:23 +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 A09E51800B7C; Mon, 13 Aug 2018 16:02:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG14Gb001509 for ; Mon, 13 Aug 2018 12:01:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id 39B432166BA5; Mon, 13 Aug 2018 16:01:04 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id CBF412166BA0 for ; Mon, 13 Aug 2018 16:01:02 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:06 +0200 Message-Id: <982bf52982af9d7a21d6a3a35e1c0e4823679158.1534173735.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 32/62] qemu: proces: assign node names for user defined backing chains 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 13 Aug 2018 16:02:24 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Prepare the full backing chain by instantiating authentication and TLS transport secrets and other necessary objects so that we can add the full backing chain explicitly to qemu. This also includes allocation of nodenames for the individual backing chain members. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++= ++-- 1 file changed, 75 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index e0dd3c0b15..fc2a3d9f60 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -137,6 +137,14 @@ static virClassPtr qemuDomainSaveCookieClass; static void qemuDomainLogContextDispose(void *obj); static void qemuDomainSaveCookieDispose(void *obj); + +static int +qemuDomainPrepareStorageSourceBlockdev(virDomainDiskDefPtr disk, + virStorageSourcePtr src, + qemuDomainObjPrivatePtr priv, + virQEMUDriverConfigPtr cfg); + + static int qemuDomainOnceInit(void) { @@ -8653,6 +8661,10 @@ qemuDomainDetermineDiskChain(virQEMUDriverPtr driver, if (qemuDomainPrepareDiskSourceData(disk, n, cfg, priv->qemuCaps) = < 0) goto cleanup; + + if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV) && + qemuDomainPrepareStorageSourceBlockdev(disk, n, priv, cfg) < 0) + goto cleanup; } ret =3D 0; @@ -13103,6 +13115,62 @@ qemuDomainPrepareDiskSourceLegacy(virDomainDiskDef= Ptr disk, } +static int +qemuDomainPrepareStorageSourceBlockdev(virDomainDiskDefPtr disk, + virStorageSourcePtr src, + qemuDomainObjPrivatePtr priv, + virQEMUDriverConfigPtr cfg) +{ + src->id =3D qemuDomainStorageIdNew(priv); + + if (virAsprintf(&src->nodestorage, "libvirt-%u-storage", src->id) < 0 = || + virAsprintf(&src->nodeformat, "libvirt-%u-format", src->id) < 0) + return -1; + + if (qemuDomainValidateStorageSource(src, priv->qemuCaps) < 0) + return -1; + + if (qemuDomainPrepareDiskSourceData(disk, src, cfg, priv->qemuCaps) < = 0) + return -1; + + if (qemuDomainSecretStorageSourcePrepare(priv, src, + src->nodestorage, + src->nodeformat) < 0) + return -1; + + if (qemuDomainPrepareStorageSourcePR(disk->src, priv, src->nodestorage= ) < 0) + return -1; + + if (qemuDomainPrepareStorageSourceTLS(disk->src, cfg, src->nodestorage, + priv->qemuCaps) < 0) + return -1; + + return 0; +} + + +static int +qemuDomainPrepareDiskSourceBlockdev(virDomainDiskDefPtr disk, + qemuDomainObjPrivatePtr priv, + virQEMUDriverConfigPtr cfg) +{ + qemuDomainDiskPrivatePtr diskPriv =3D QEMU_DOMAIN_DISK_PRIVATE(disk); + virStorageSourcePtr n; + + if (disk->copy_on_read =3D=3D VIR_TRISTATE_SWITCH_ON && + !diskPriv->nodeCopyOnRead && + virAsprintf(&diskPriv->nodeCopyOnRead, "libvirt-CoR-%s", disk->dst= ) < 0) + return -1; + + for (n =3D disk->src; virStorageSourceIsBacking(n); n =3D n->backingSt= ore) { + if (qemuDomainPrepareStorageSourceBlockdev(disk, n, priv, cfg) < 0) + return -1; + } + + return 0; +} + + int qemuDomainPrepareDiskSource(virDomainDiskDefPtr disk, qemuDomainObjPrivatePtr priv, @@ -13110,8 +13178,13 @@ qemuDomainPrepareDiskSource(virDomainDiskDefPtr di= sk, { qemuDomainPrepareDiskCachemode(disk); - if (qemuDomainPrepareDiskSourceLegacy(disk, priv, cfg) < 0) - return -1; + if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV)) { + if (qemuDomainPrepareDiskSourceBlockdev(disk, priv, cfg) < 0) + return -1; + } else { + if (qemuDomainPrepareDiskSourceLegacy(disk, priv, cfg) < 0) + return -1; + } return 0; } --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176152955574.053852909719; Mon, 13 Aug 2018 09:02:32 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AA1F236A5E6; Mon, 13 Aug 2018 16:02:28 +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 6256710493B4; Mon, 13 Aug 2018 16:02:28 +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 0DD7A18037F3; Mon, 13 Aug 2018 16:02:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG15ac001524 for ; Mon, 13 Aug 2018 12:01:05 -0400 Received: by smtp.corp.redhat.com (Postfix) id DD2F42166BA5; Mon, 13 Aug 2018 16:01:04 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 79ED02166BB1 for ; Mon, 13 Aug 2018 16:01:04 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:07 +0200 Message-Id: <5b10ab3f214c13b66d7379d517d31bc37f632f30.1534173735.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 33/62] qemu: block: Add generator for the 'copy-on-read' blockdev driver 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 13 Aug 2018 16:02:30 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The copy on read functionality is done using a separate layer in the backing chain. Add function to generate properties for it. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 22 ++++++++++++++++++++++ src/qemu/qemu_block.h | 2 ++ 2 files changed, 24 insertions(+) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index ccdd334367..5321dda316 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -1745,3 +1745,25 @@ qemuBlockSnapshotAddLegacy(virJSONValuePtr actions, VIR_FREE(source); return ret; } + + +/** + * qemuBlockStorageGetCopyOnReadProps: + * @disk: disk with copy-on-read enabled + * + * Creates blockdev properties for a disk copy-on-read layer. + */ +virJSONValuePtr +qemuBlockStorageGetCopyOnReadProps(virDomainDiskDefPtr disk) +{ + qemuDomainDiskPrivatePtr priv =3D QEMU_DOMAIN_DISK_PRIVATE(disk); + virJSONValuePtr ret =3D NULL; + + ignore_value(virJSONValueObjectCreate(&ret, + "s:driver", "copy-on-read", + "s:node-name", priv->nodeCopyOnR= ead, + "s:file", disk->src->nodeformat, + NULL)); + + return ret; +} diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h index fd8984e60b..62ed5027cb 100644 --- a/src/qemu/qemu_block.h +++ b/src/qemu/qemu_block.h @@ -67,6 +67,8 @@ qemuBlockStorageSourceGetURI(virStorageSourcePtr src); virJSONValuePtr qemuBlockStorageSourceGetBlockdevProps(virStorageSourcePtr src); +virJSONValuePtr +qemuBlockStorageGetCopyOnReadProps(virDomainDiskDefPtr disk); typedef struct qemuBlockStorageSourceAttachData qemuBlockStorageSourceAtta= chData; typedef qemuBlockStorageSourceAttachData *qemuBlockStorageSourceAttachData= Ptr; --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15341761294731014.0618385609046; Mon, 13 Aug 2018 09:02:09 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4D2EF85550; Mon, 13 Aug 2018 16:02:07 +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 13A72AC31B; Mon, 13 Aug 2018 16:02:07 +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 7FD4314B14; Mon, 13 Aug 2018 16:02:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG15Kr001534 for ; Mon, 13 Aug 2018 12:01:05 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8C5942166BA5; Mon, 13 Aug 2018 16:01:05 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2A6022166BA0 for ; Mon, 13 Aug 2018 16:01:05 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:08 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 34/62] qemu: domain: Prepare qemuDomainDiskGetBackendAlias for -blockdev 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.84 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 13 Aug 2018 16:02:08 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Pass in the node name as the backend alias when -blockdev is used. As copy-on-read is expressed by a separate -blockdev backing chain member we need to decide which node name to use here. For empty cdroms when using -blockdev there is no backend at all so NULL is returned. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index fc2a3d9f60..7ce4487b05 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -8691,12 +8691,29 @@ qemuDomainDetermineDiskChain(virQEMUDriverPtr drive= r, */ int qemuDomainDiskGetBackendAlias(virDomainDiskDefPtr disk, - virQEMUCapsPtr qemuCaps ATTRIBUTE_UNUSED, + virQEMUCapsPtr qemuCaps, char **backendAlias) { + qemuDomainDiskPrivatePtr priv =3D QEMU_DOMAIN_DISK_PRIVATE(disk); + const char *nodename =3D NULL; *backendAlias =3D NULL; - if (!(*backendAlias =3D qemuAliasDiskDriveFromDisk(disk))) + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) { + if (!(*backendAlias =3D qemuAliasDiskDriveFromDisk(disk))) + return -1; + + return 0; + } + + if (virStorageSourceIsEmpty(disk->src)) + return 0; + + if (disk->copy_on_read =3D=3D VIR_TRISTATE_SWITCH_ON) + nodename =3D priv->nodeCopyOnRead; + else + nodename =3D disk->src->nodeformat; + + if (VIR_STRDUP(*backendAlias, nodename) < 0) return -1; return 0; --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 153417611378935.60175314239359; Mon, 13 Aug 2018 09:01:53 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id D092730832ED; Mon, 13 Aug 2018 16:01:51 +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 915CA765AB; Mon, 13 Aug 2018 16:01:51 +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 25C8018037FE; Mon, 13 Aug 2018 16:01:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG16KR001545 for ; Mon, 13 Aug 2018 12:01:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3B3572166BA5; Mon, 13 Aug 2018 16:01:06 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id CCD542166BA0 for ; Mon, 13 Aug 2018 16:01:05 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:09 +0200 Message-Id: <70a0b06cf67835ddd32471c1ab117f64ab78fe3b.1534173735.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 35/62] qemu: command: format disk source commandline for -blockdev 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Mon, 13 Aug 2018 16:01:52 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Format the backing chain onto the commandline using the 'json' syntax with -blockdev. The command line formatter needs only minor tweaks to add the new entries but we now need to initialize the strucutres that are used for every layer of the backing chain. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 82 ++++++++++++++++++++++++++++++++++++++++++++-= ---- 1 file changed, 75 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 72fdffa92a..4a3dda28fe 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -2261,6 +2261,8 @@ static int qemuBuildBlockStorageSourceAttachDataCommandline(virCommandPtr cmd, qemuBlockStorageSourceAtt= achDataPtr data) { + char *tmp; + if (qemuBuildObjectCommandline(cmd, data->prmgrProps) < 0 || qemuBuildObjectCommandline(cmd, data->authsecretProps) < 0 || qemuBuildObjectCommandline(cmd, data->encryptsecretProps) < 0 || @@ -2270,6 +2272,22 @@ qemuBuildBlockStorageSourceAttachDataCommandline(vir= CommandPtr cmd, if (data->driveCmd) virCommandAddArgList(cmd, "-drive", data->driveCmd, NULL); + if (data->storageProps) { + if (!(tmp =3D virJSONValueToString(data->storageProps, false))) + return -1; + + virCommandAddArgList(cmd, "-blockdev", tmp, NULL); + VIR_FREE(tmp); + } + + if (data->formatProps) { + if (!(tmp =3D virJSONValueToString(data->formatProps, false))) + return -1; + + virCommandAddArgList(cmd, "-blockdev", tmp, NULL); + VIR_FREE(tmp); + } + return 0; } @@ -2279,20 +2297,70 @@ qemuBuildDiskSourceCommandLine(virCommandPtr cmd, virDomainDiskDefPtr disk, virQEMUCapsPtr qemuCaps) { - qemuBlockStorageSourceAttachDataPtr data =3D NULL; + qemuBlockStorageSourceAttachDataPtr *data =3D NULL; + size_t ndata =3D 0; + qemuBlockStorageSourceAttachDataPtr tmp =3D NULL; + virJSONValuePtr copyOnReadProps =3D NULL; + virStorageSourcePtr n; + char *str =3D NULL; + size_t i; int ret =3D -1; - if (!(data =3D qemuBuildStorageSourceAttachPrepareDrive(disk, qemuCaps= ))) - return -1; + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) { + if (virStorageSourceIsEmpty(disk->src)) { + ret =3D 0; + goto cleanup; + } - if (qemuBuildStorageSourceAttachPrepareCommon(disk->src, data, qemuCap= s) < 0 || - qemuBuildBlockStorageSourceAttachDataCommandline(cmd, data) < 0) - goto cleanup; + for (n =3D disk->src; virStorageSourceIsBacking(n); n =3D n->backi= ngStore) { + if (!(tmp =3D qemuBlockStorageSourceAttachPrepareBlockdev(n))) + goto cleanup; + + if (qemuBuildStorageSourceAttachPrepareCommon(n, tmp, qemuCaps= ) < 0) + goto cleanup; + + if (VIR_APPEND_ELEMENT(data, ndata, tmp) < 0) + goto cleanup; + } + + if (disk->copy_on_read =3D=3D VIR_TRISTATE_SWITCH_ON && + !(copyOnReadProps =3D qemuBlockStorageGetCopyOnReadProps(disk)= )) + goto cleanup; + } else { + if (!(tmp =3D qemuBuildStorageSourceAttachPrepareDrive(disk, qemuC= aps))) + goto cleanup; + + if (qemuBuildStorageSourceAttachPrepareCommon(disk->src, tmp, + qemuCaps) < 0) + goto cleanup; + + if (VIR_APPEND_ELEMENT(data, ndata, tmp) < 0) + goto cleanup; + } + + for (i =3D ndata; i > 0; i--) { + if (qemuBuildBlockStorageSourceAttachDataCommandline(cmd, + data[i - 1]) = < 0) + goto cleanup; + } + + if (copyOnReadProps) { + if (!(str =3D virJSONValueToString(copyOnReadProps, false))) + goto cleanup; + + virCommandAddArgList(cmd, "-blockdev", str, NULL); + VIR_FREE(str); + } ret =3D 0; cleanup: - qemuBlockStorageSourceAttachDataFree(data); + for (i =3D 0; i < ndata; i++) + qemuBlockStorageSourceAttachDataFree(data[i]); + VIR_FREE(data); + qemuBlockStorageSourceAttachDataFree(tmp); + virJSONValueFree(copyOnReadProps); + VIR_FREE(str); return ret; } --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 153417612007637.6998712640268; Mon, 13 Aug 2018 09:02:00 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 71D283001748; Mon, 13 Aug 2018 16:01:57 +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 274C745B8; Mon, 13 Aug 2018 16:01:57 +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 B300714B08; Mon, 13 Aug 2018 16:01:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG16uc001555 for ; Mon, 13 Aug 2018 12:01:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id DCA402166BA5; Mon, 13 Aug 2018 16:01:06 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7B7352166BA0 for ; Mon, 13 Aug 2018 16:01:06 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:10 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 36/62] qemu: command: Add helper to check if disk throttling is enabled 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Mon, 13 Aug 2018 16:01:58 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Add a helper which will use a collection of other helpers to determine whether a disk requires throttling to be enabled. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 10 ++++++++++ src/qemu/qemu_command.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 4a3dda28fe..613e4742af 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1031,6 +1031,16 @@ qemuDiskConfigBlkdeviotuneHasMaxLength(virDomainDisk= DefPtr disk) } +bool +qemuDiskConfigBlkdeviotuneEnabled(virDomainDiskDefPtr disk) +{ + return !!disk->blkdeviotune.group_name || + qemuDiskConfigBlkdeviotuneHasBasic(disk) || + qemuDiskConfigBlkdeviotuneHasMax(disk) || + qemuDiskConfigBlkdeviotuneHasMaxLength(disk); +} + + /** * qemuCheckDiskConfigBlkdeviotune: * @disk: disk configuration diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index 283bf3120d..13c5508ae8 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -180,6 +180,9 @@ int qemuGetDriveSourceString(virStorageSourcePtr src, qemuDomainSecretInfoPtr secinfo, char **source); +bool +qemuDiskConfigBlkdeviotuneEnabled(virDomainDiskDefPtr disk); + int qemuCheckDiskConfig(virDomainDiskDefPtr disk, virQEMUCapsPtr qemuCaps); --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 153417612658926.812350557444915; Mon, 13 Aug 2018 09:02:06 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 414A5307C701; Mon, 13 Aug 2018 16:02:04 +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 D673A3001A60; Mon, 13 Aug 2018 16:02:03 +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 36A2D14B0D; Mon, 13 Aug 2018 16:02:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG17Vh001566 for ; Mon, 13 Aug 2018 12:01:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8AE242166BA5; Mon, 13 Aug 2018 16:01:07 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 298692166BA0 for ; Mon, 13 Aug 2018 16:01:07 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:11 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 37/62] qemu: process: Setup disk io throttling for -blockdev 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.84 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Mon, 13 Aug 2018 16:02:05 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The proper way to do this would be to use the 'throttle' driver but unfortunately it can't change the 'throttle_group' so we can't provide feature parity. This hack uses the block_set_io_throttle command to do so until we can properly replace it. Signed-off-by: Peter Krempa --- src/qemu/qemu_process.c | 50 +++++++++++++++++++++++++++++++++++++++++++++= ++++ 1 file changed, 50 insertions(+) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 0bf8245173..3495733041 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6230,6 +6230,53 @@ qemuProcessGenID(virDomainObjPtr vm, } +/** + * qemuProcessSetupDiskThrottlingBlockdev: + * + * Sets up disk trottling for -blockdev via block_set_io_throttle monitor + * command. This hack should be replaced by proper use of the 'throttle' + * blockdev driver in qemu once it will support changing of the throttle g= roup. + */ +static int +qemuProcessSetupDiskThrottlingBlockdev(virQEMUDriverPtr driver, + virDomainObjPtr vm, + qemuDomainAsyncJob asyncJob) +{ + qemuDomainObjPrivatePtr priv =3D vm->privateData; + size_t i; + int ret =3D -1; + + if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV)) + return 0; + + VIR_DEBUG("Setting up disk throttling for -blockdev via block_set_io_t= hrottle"); + + if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) + return -1; + + for (i =3D 0; i < vm->def->ndisks; i++) { + virDomainDiskDefPtr disk =3D vm->def->disks[i]; + qemuDomainDiskPrivatePtr diskPriv =3D QEMU_DOMAIN_DISK_PRIVATE(dis= k); + + if (!qemuDiskConfigBlkdeviotuneEnabled(disk)) + continue; + + if (qemuMonitorSetBlockIoThrottle(qemuDomainGetMonitor(vm), NULL, + diskPriv->backendQomName, + &disk->blkdeviotune, + true, true, true) < 0) + goto cleanup; + } + + ret =3D 0; + + cleanup: + if (qemuDomainObjExitMonitor(driver, vm) < 0) + ret =3D -1; + return ret; +} + + /** * qemuProcessLaunch: * @@ -6548,6 +6595,9 @@ qemuProcessLaunch(virConnectPtr conn, if (qemuProcessSetupBalloon(driver, vm, asyncJob) < 0) goto cleanup; + if (qemuProcessSetupDiskThrottlingBlockdev(driver, vm, asyncJob) < 0) + goto cleanup; + /* Since CPUs were not started yet, the balloon could not return the m= emory * to the host and thus cur_balloon needs to be updated so that GetXML= desc * and friends return the correct size in case they can't grab the job= */ --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 153417613270626.930661893544197; Mon, 13 Aug 2018 09:02:12 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 94DD53004421; Mon, 13 Aug 2018 16:02:10 +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 3FE7860BE7; Mon, 13 Aug 2018 16:02:10 +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 B7D6D13475; Mon, 13 Aug 2018 16:02:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG18lE001573 for ; Mon, 13 Aug 2018 12:01:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id 396C52166BA5; Mon, 13 Aug 2018 16:01:08 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id CB8162166BA0 for ; Mon, 13 Aug 2018 16:01:07 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:12 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 38/62] qemu: driver: Use QOM backend name for disk IO throttling APIs 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Mon, 13 Aug 2018 16:02:11 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" With -blockdev the drive alias can't be used any more so we need to switch to the QOM name. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 7b9c19087e..fb09278112 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -18202,7 +18202,8 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, virDomainDefPtr def =3D NULL; virDomainDefPtr persistentDef =3D NULL; virDomainBlockIoTuneInfo info; - char *device =3D NULL; + char *drivealias =3D NULL; + const char *qdevid =3D NULL; int ret =3D -1; size_t i; virDomainDiskDefPtr conf_disk =3D NULL; @@ -18427,8 +18428,12 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, if (!(disk =3D qemuDomainDiskByName(def, path))) goto endjob; - if (!(device =3D qemuAliasDiskDriveFromDisk(disk))) - goto endjob; + if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV)) { + qdevid =3D QEMU_DOMAIN_DISK_PRIVATE(disk)->backendQomName; + } else { + if (!(drivealias =3D qemuAliasDiskDriveFromDisk(disk))) + goto endjob; + } if (qemuDomainSetBlockIoTuneDefaults(&info, &disk->blkdeviotune, set_fields) < 0) @@ -18474,7 +18479,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, * via the JSON error code from the block_set_io_throttle call */ qemuDomainObjEnterMonitor(driver, vm); - ret =3D qemuMonitorSetBlockIoThrottle(priv->mon, device, NULL, + ret =3D qemuMonitorSetBlockIoThrottle(priv->mon, drivealias, qdevi= d, &info, supportMaxOptions, set_fields & QEMU_BLOCK_IOTUNE= _SET_GROUP_NAME, supportMaxLengthOptions); @@ -18524,7 +18529,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, cleanup: VIR_FREE(info.group_name); - VIR_FREE(device); + VIR_FREE(drivealias); virDomainObjEndAPI(&vm); if (eventNparams) virTypedParamsFree(eventParams, eventNparams); @@ -18546,7 +18551,8 @@ qemuDomainGetBlockIoTune(virDomainPtr dom, virDomainDefPtr def =3D NULL; virDomainDefPtr persistentDef =3D NULL; virDomainBlockIoTuneInfo reply =3D {0}; - char *device =3D NULL; + char *drivealias =3D NULL; + const char *qdevid =3D NULL; int ret =3D -1; int maxparams; @@ -18600,10 +18606,14 @@ qemuDomainGetBlockIoTune(virDomainPtr dom, if (!(disk =3D qemuDomainDiskByName(def, path))) goto endjob; - if (!(device =3D qemuAliasDiskDriveFromDisk(disk))) - goto endjob; + if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV)) { + qdevid =3D QEMU_DOMAIN_DISK_PRIVATE(disk)->backendQomName; + } else { + if (!(drivealias =3D qemuAliasDiskDriveFromDisk(disk))) + goto endjob; + } qemuDomainObjEnterMonitor(driver, vm); - ret =3D qemuMonitorGetBlockIoThrottle(priv->mon, device, NULL, &re= ply); + ret =3D qemuMonitorGetBlockIoThrottle(priv->mon, drivealias, qdevi= d, &reply); if (qemuDomainObjExitMonitor(driver, vm) < 0) goto endjob; if (ret < 0) @@ -18678,7 +18688,7 @@ qemuDomainGetBlockIoTune(virDomainPtr dom, cleanup: VIR_FREE(reply.group_name); - VIR_FREE(device); + VIR_FREE(drivealias); virDomainObjEndAPI(&vm); return ret; } --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176138823689.0949077797547; Mon, 13 Aug 2018 09:02:18 -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 461FF81DFF; Mon, 13 Aug 2018 16:02:16 +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 BD5DE6FDB3; Mon, 13 Aug 2018 16:02:15 +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 18F211800B6F; Mon, 13 Aug 2018 16:02:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG18f3001578 for ; Mon, 13 Aug 2018 12:01:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id DB7142166BA5; Mon, 13 Aug 2018 16:01:08 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 79B772166BA0 for ; Mon, 13 Aug 2018 16:01:08 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:13 +0200 Message-Id: <2247e777202db083be427698d0eb0f661fdc2775.1534173735.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 39/62] qemu: driver: Prepare qemuDomainBlockResize for blockdev 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.25]); Mon, 13 Aug 2018 16:02:17 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Use the nodename to resize the device rather than the drive alias. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index fb09278112..f745a0392a 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -10945,6 +10945,7 @@ qemuDomainBlockResize(virDomainPtr dom, qemuDomainObjPrivatePtr priv; int ret =3D -1; char *device =3D NULL; + const char *nodename =3D NULL; virDomainDiskDefPtr disk =3D NULL; virCheckFlags(VIR_DOMAIN_BLOCK_RESIZE_BYTES, -1); @@ -10987,11 +10988,22 @@ qemuDomainBlockResize(virDomainPtr dom, disk->src->format =3D=3D VIR_STORAGE_FILE_QED) size =3D VIR_ROUND_UP(size, 512); - if (!(device =3D qemuAliasDiskDriveFromDisk(disk))) - goto endjob; + if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV)) { + if (virStorageSourceIsEmpty(disk->src) || disk->src->readonly) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, + _("can't resize empty or readonly disk '%s'"), + disk->dst); + goto endjob; + } + + nodename =3D disk->src->nodeformat; + } else { + if (!(device =3D qemuAliasDiskDriveFromDisk(disk))) + goto endjob; + } qemuDomainObjEnterMonitor(driver, vm); - if (qemuMonitorBlockResize(priv->mon, device, NULL, size) < 0) { + if (qemuMonitorBlockResize(priv->mon, device, nodename, size) < 0) { ignore_value(qemuDomainObjExitMonitor(driver, vm)); goto endjob; } --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176143902545.0079020670673; Mon, 13 Aug 2018 09:02:23 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7B806307C70C; Mon, 13 Aug 2018 16:02:21 +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 1B5D310016DC; Mon, 13 Aug 2018 16:02:21 +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 ADD8912E2F; Mon, 13 Aug 2018 16:02:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG19Sw001593 for ; Mon, 13 Aug 2018 12:01:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id 89DEE2166BA5; Mon, 13 Aug 2018 16:01:09 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 27B222166BA0 for ; Mon, 13 Aug 2018 16:01:09 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:14 +0200 Message-Id: <0b5a8386989b00344d306f463bcfaa695fcea531.1534173735.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 40/62] qemu: process: Add lookup via QOM id to qemuProcessFindDomainDiskByAlias 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Mon, 13 Aug 2018 16:02:22 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Allow looking up also via QOM id and rename the function accordingly. Also add documentation of the specifics. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 2 +- src/qemu/qemu_process.c | 42 +++++++++++++++++++++++++++++++----------- src/qemu/qemu_process.h | 5 +++-- 3 files changed, 35 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index f745a0392a..5dee701dc4 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -4727,7 +4727,7 @@ processBlockJobEvent(virQEMUDriverPtr driver, goto endjob; } - if ((disk =3D qemuProcessFindDomainDiskByAlias(vm, diskAlias))) + if ((disk =3D qemuProcessFindDomainDiskByAliasOrQOM(vm, diskAlias, NUL= L))) qemuBlockJobEventProcess(driver, vm, disk, QEMU_ASYNC_JOB_NONE, ty= pe, status); endjob: diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 3495733041..b713afa3a2 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -350,28 +350,48 @@ qemuProcessHandleMonitorError(qemuMonitorPtr mon ATTR= IBUTE_UNUSED, } +/** + * qemuProcessFindDomainDiskByAliasOrQOM: + * @vm: domain object to search for the disk + * @alias: -drive or -device alias of the disk + * @qomid: QOM tree device name + * + * Looks up a disk in the domain definition of @vm which either matches the + * -drive or -device alias used for the backend and frontend respectively = or the + * QOM name. If @alias is empty it's treated as NULL as it's a mandatory = field + * in some cases. + * + * Returns a disk from @vm or NULL if it could not be found. + */ virDomainDiskDefPtr -qemuProcessFindDomainDiskByAlias(virDomainObjPtr vm, - const char *alias) +qemuProcessFindDomainDiskByAliasOrQOM(virDomainObjPtr vm, + const char *alias, + const char *qomid) { size_t i; - alias =3D qemuAliasDiskDriveSkipPrefix(alias); + if (*alias =3D=3D '\0') + alias =3D NULL; + + if (alias) + alias =3D qemuAliasDiskDriveSkipPrefix(alias); for (i =3D 0; i < vm->def->ndisks; i++) { - virDomainDiskDefPtr disk; + virDomainDiskDefPtr disk =3D vm->def->disks[i]; + qemuDomainDiskPrivatePtr diskPriv =3D QEMU_DOMAIN_DISK_PRIVATE(dis= k); - disk =3D vm->def->disks[i]; - if (disk->info.alias !=3D NULL && STREQ(disk->info.alias, alias)) + if ((disk->info.alias && STREQ_NULLABLE(disk->info.alias, alias)) = || + (diskPriv->backendQomName && STREQ_NULLABLE(diskPriv->backendQ= omName, qomid))) return disk; } virReportError(VIR_ERR_INTERNAL_ERROR, - _("no disk found with alias %s"), - alias); + _("no disk found with alias '%s' or id '%s'"), + NULLSTR(alias), NULLSTR(qomid)); return NULL; } + static int qemuProcessHandleReset(qemuMonitorPtr mon ATTRIBUTE_UNUSED, virDomainObjPtr vm, @@ -849,7 +869,7 @@ qemuProcessHandleIOError(qemuMonitorPtr mon ATTRIBUTE_U= NUSED, virQEMUDriverConfigPtr cfg =3D virQEMUDriverGetConfig(driver); virObjectLock(vm); - disk =3D qemuProcessFindDomainDiskByAlias(vm, diskAlias); + disk =3D qemuProcessFindDomainDiskByAliasOrQOM(vm, diskAlias, NULL); if (disk) { srcPath =3D virDomainDiskGetSource(disk); @@ -912,7 +932,7 @@ qemuProcessHandleBlockJob(qemuMonitorPtr mon ATTRIBUTE_= UNUSED, VIR_DEBUG("Block job for device %s (domain: %p,%s) type %d status %d", diskAlias, vm, vm->def->name, type, status); - if (!(disk =3D qemuProcessFindDomainDiskByAlias(vm, diskAlias))) + if (!(disk =3D qemuProcessFindDomainDiskByAliasOrQOM(vm, diskAlias, NU= LL))) goto error; diskPriv =3D QEMU_DOMAIN_DISK_PRIVATE(disk); @@ -1050,7 +1070,7 @@ qemuProcessHandleTrayChange(qemuMonitorPtr mon ATTRIB= UTE_UNUSED, virQEMUDriverConfigPtr cfg =3D virQEMUDriverGetConfig(driver); virObjectLock(vm); - disk =3D qemuProcessFindDomainDiskByAlias(vm, devAlias); + disk =3D qemuProcessFindDomainDiskByAliasOrQOM(vm, devAlias, NULL); if (disk) { event =3D virDomainEventTrayChangeNewFromObj(vm, disk->info.alias,= reason); diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h index 07ce3a9915..c2f7c2b5d2 100644 --- a/src/qemu/qemu_process.h +++ b/src/qemu/qemu_process.h @@ -187,8 +187,9 @@ bool qemuProcessAutoDestroyActive(virQEMUDriverPtr driv= er, int qemuProcessSetSchedParams(int id, pid_t pid, size_t nsp, virDomainThreadSchedParamPtr sp); -virDomainDiskDefPtr qemuProcessFindDomainDiskByAlias(virDomainObjPtr vm, - const char *alias); +virDomainDiskDefPtr qemuProcessFindDomainDiskByAliasOrQOM(virDomainObjPtr = vm, + const char *alia= s, + const char *qomi= d); int qemuConnectAgent(virQEMUDriverPtr driver, virDomainObjPtr vm); --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176148562529.4607926245588; Mon, 13 Aug 2018 09:02:28 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9D99E30B8FB4; Mon, 13 Aug 2018 16:02:26 +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 630345B682; Mon, 13 Aug 2018 16:02:26 +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 E388441091; Mon, 13 Aug 2018 16:02:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG1AYr001599 for ; Mon, 13 Aug 2018 12:01:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 36E842166BA5; Mon, 13 Aug 2018 16:01:10 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id C980D2166BA0 for ; Mon, 13 Aug 2018 16:01:09 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:15 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 41/62] qemu: monitor: Handle TRAY_MOVED event correctly with -blockdev 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Mon, 13 Aug 2018 16:02:27 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Add handling of the 'id' field in the event which corresponds to the QDEV id of the device. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.c | 3 ++- src/qemu/qemu_monitor.h | 2 ++ src/qemu/qemu_monitor_json.c | 11 ++++++++--- src/qemu/qemu_process.c | 3 ++- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 4dcbd69dce..cdfcbcea0b 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -1460,13 +1460,14 @@ qemuMonitorEmitGraphics(qemuMonitorPtr mon, int qemuMonitorEmitTrayChange(qemuMonitorPtr mon, const char *devAlias, + const char *devid, int reason) { int ret =3D -1; VIR_DEBUG("mon=3D%p", mon); QEMU_MONITOR_CALLBACK(mon, ret, domainTrayChange, mon->vm, - devAlias, reason); + devAlias, devid, reason); return ret; } diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index f8f6969ddb..1c66459e69 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -181,6 +181,7 @@ typedef int (*qemuMonitorDomainBlockJobCallback)(qemuMo= nitorPtr mon, typedef int (*qemuMonitorDomainTrayChangeCallback)(qemuMonitorPtr mon, virDomainObjPtr vm, const char *devAlias, + const char *devid, int reason, void *opaque); typedef int (*qemuMonitorDomainPMWakeupCallback)(qemuMonitorPtr mon, @@ -397,6 +398,7 @@ int qemuMonitorEmitGraphics(qemuMonitorPtr mon, const char *saslUsername); int qemuMonitorEmitTrayChange(qemuMonitorPtr mon, const char *devAlias, + const char *devid, int reason); int qemuMonitorEmitPMWakeup(qemuMonitorPtr mon); int qemuMonitorEmitPMSuspend(qemuMonitorPtr mon); diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index de3fcd83d8..537cdfd19a 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -1031,11 +1031,16 @@ static void qemuMonitorJSONHandleTrayChange(qemuMonitorPtr mon, virJSONValuePtr data) { - const char *devAlias =3D NULL; + const char *devAlias =3D virJSONValueObjectGetString(data, "device"); + const char *devid =3D virJSONValueObjectGetString(data, "id"); bool trayOpened; int reason; - if ((devAlias =3D virJSONValueObjectGetString(data, "device")) =3D=3D = NULL) { + /* drive alias is always reported but empty for -blockdev */ + if (*devAlias =3D=3D '\0') + devAlias =3D NULL; + + if (!devAlias && !devid) { VIR_WARN("missing device in tray change event"); return; } @@ -1050,7 +1055,7 @@ qemuMonitorJSONHandleTrayChange(qemuMonitorPtr mon, else reason =3D VIR_DOMAIN_EVENT_TRAY_CHANGE_CLOSE; - qemuMonitorEmitTrayChange(mon, devAlias, reason); + qemuMonitorEmitTrayChange(mon, devAlias, devid, reason); } static void diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index b713afa3a2..40e2589b37 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -1061,6 +1061,7 @@ static int qemuProcessHandleTrayChange(qemuMonitorPtr mon ATTRIBUTE_UNUSED, virDomainObjPtr vm, const char *devAlias, + const char *devid, int reason, void *opaque) { @@ -1070,7 +1071,7 @@ qemuProcessHandleTrayChange(qemuMonitorPtr mon ATTRIB= UTE_UNUSED, virQEMUDriverConfigPtr cfg =3D virQEMUDriverGetConfig(driver); virObjectLock(vm); - disk =3D qemuProcessFindDomainDiskByAliasOrQOM(vm, devAlias, NULL); + disk =3D qemuProcessFindDomainDiskByAliasOrQOM(vm, devAlias, devid); if (disk) { event =3D virDomainEventTrayChangeNewFromObj(vm, disk->info.alias,= reason); --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176156839954.4731839948296; Mon, 13 Aug 2018 09:02:36 -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 B696FA8C18; Mon, 13 Aug 2018 16:02:34 +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 5873B6FDC3; Mon, 13 Aug 2018 16:02:34 +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 EF2CE18037FE; Mon, 13 Aug 2018 16:02:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG1AP7001607 for ; Mon, 13 Aug 2018 12:01:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id D93562166BA5; Mon, 13 Aug 2018 16:01:10 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 771192166BA0 for ; Mon, 13 Aug 2018 16:01:10 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:16 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 42/62] qemu: monitor: Handle BLOCK_IO_ERROR event properly with -blockdev 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.39]); Mon, 13 Aug 2018 16:02:35 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Use the 'node-name' provided in the event if 'device' is empty to look up the disk. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.c | 3 ++- src/qemu/qemu_monitor.h | 2 ++ src/qemu/qemu_monitor_json.c | 5 ++++- src/qemu/qemu_process.c | 12 +++++++++++- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index cdfcbcea0b..49dc478f5b 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -1421,6 +1421,7 @@ qemuMonitorEmitWatchdog(qemuMonitorPtr mon, int actio= n) int qemuMonitorEmitIOError(qemuMonitorPtr mon, const char *diskAlias, + const char *nodename, int action, const char *reason) { @@ -1428,7 +1429,7 @@ qemuMonitorEmitIOError(qemuMonitorPtr mon, VIR_DEBUG("mon=3D%p", mon); QEMU_MONITOR_CALLBACK(mon, ret, domainIOError, mon->vm, - diskAlias, action, reason); + diskAlias, nodename, action, reason); return ret; } diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 1c66459e69..70854497b2 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -155,6 +155,7 @@ typedef int (*qemuMonitorDomainWatchdogCallback)(qemuMo= nitorPtr mon, typedef int (*qemuMonitorDomainIOErrorCallback)(qemuMonitorPtr mon, virDomainObjPtr vm, const char *diskAlias, + const char *nodename, int action, const char *reason, void *opaque); @@ -383,6 +384,7 @@ int qemuMonitorEmitRTCChange(qemuMonitorPtr mon, long l= ong offset); int qemuMonitorEmitWatchdog(qemuMonitorPtr mon, int action); int qemuMonitorEmitIOError(qemuMonitorPtr mon, const char *diskAlias, + const char *nodename, int action, const char *reason); int qemuMonitorEmitGraphics(qemuMonitorPtr mon, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 537cdfd19a..2b168d96c2 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -765,6 +765,7 @@ static void qemuMonitorJSONHandleIOError(qemuMonitorPtr mon, virJSONValuePtr data) { const char *device; + const char *nodename; const char *action; const char *reason =3D ""; bool nospc =3D false; @@ -782,6 +783,8 @@ qemuMonitorJSONHandleIOError(qemuMonitorPtr mon, virJSO= NValuePtr data) if ((device =3D virJSONValueObjectGetString(data, "device")) =3D=3D NU= LL) VIR_WARN("missing device in disk io error event"); + nodename =3D virJSONValueObjectGetString(data, "node-name"); + if (virJSONValueObjectGetBoolean(data, "nospace", &nospc) =3D=3D 0 && = nospc) reason =3D "enospc"; @@ -790,7 +793,7 @@ qemuMonitorJSONHandleIOError(qemuMonitorPtr mon, virJSO= NValuePtr data) actionID =3D VIR_DOMAIN_EVENT_IO_ERROR_NONE; } - qemuMonitorEmitIOError(mon, device, actionID, reason); + qemuMonitorEmitIOError(mon, device, nodename, actionID, reason); } diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 40e2589b37..6e0b4b0027 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -855,6 +855,7 @@ static int qemuProcessHandleIOError(qemuMonitorPtr mon ATTRIBUTE_UNUSED, virDomainObjPtr vm, const char *diskAlias, + const char *nodename, int action, const char *reason, void *opaque) @@ -869,7 +870,16 @@ qemuProcessHandleIOError(qemuMonitorPtr mon ATTRIBUTE_= UNUSED, virQEMUDriverConfigPtr cfg =3D virQEMUDriverGetConfig(driver); virObjectLock(vm); - disk =3D qemuProcessFindDomainDiskByAliasOrQOM(vm, diskAlias, NULL); + + if (*diskAlias =3D=3D '\0') + diskAlias =3D NULL; + + if (diskAlias) + disk =3D qemuProcessFindDomainDiskByAliasOrQOM(vm, diskAlias, NULL= ); + else if (nodename) + disk =3D qemuDomainDiskLookupByNodename(vm->def, nodename, NULL, N= ULL); + else + disk =3D NULL; if (disk) { srcPath =3D virDomainDiskGetSource(disk); --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176153836277.8782444201777; Mon, 13 Aug 2018 09:02:33 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AFDA230A3AD1; Mon, 13 Aug 2018 16:02:31 +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 6D5003083322; Mon, 13 Aug 2018 16:02:31 +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 11CEE3FC9D; Mon, 13 Aug 2018 16:02:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG1C81001622 for ; Mon, 13 Aug 2018 12:01:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id E2C222166BA5; Mon, 13 Aug 2018 16:01:11 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 809EB2166BA0 for ; Mon, 13 Aug 2018 16:01:11 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:17 +0200 Message-Id: <22b57b1b4aff802389ae5b0e2469d3a7c0977b54.1534173735.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 43/62] qemu: hotplug: Prepare for blockdev-add/blockdev-del with backing chains 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.84 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Mon, 13 Aug 2018 16:02:32 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Initialize data for the whole backing chain when plugging in or removing disks when a machine supports -blockdev. Similarly to startup we need to prepare the structures for the whole backing chain and take care of the copy-on-read feature. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 77 +++++++++++++++++++++++++++++++++++++++------= ---- 1 file changed, 62 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 32d0c3862e..6fde7308f7 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -380,6 +380,10 @@ qemuHotplugRemoveManagedPR(virQEMUDriverPtr driver, struct _qemuHotplugDiskSourceData { qemuBlockStorageSourceAttachDataPtr *backends; size_t nbackends; + + /* disk copy-on-read object */ + virJSONValuePtr corProps; + char *corAlias; }; typedef struct _qemuHotplugDiskSourceData qemuHotplugDiskSourceData; typedef qemuHotplugDiskSourceData *qemuHotplugDiskSourceDataPtr; @@ -393,6 +397,9 @@ qemuHotplugDiskSourceDataFree(qemuHotplugDiskSourceData= Ptr data) if (!data) return; + virJSONValueFree(data->corProps); + VIR_FREE(data->corAlias); + for (i =3D 0; i < data->nbackends; i++) qemuBlockStorageSourceAttachDataFree(data->backends[i]); @@ -461,25 +468,40 @@ qemuHotplugRemoveStorageSourcePrepareData(virStorageS= ourcePtr src, static qemuHotplugDiskSourceDataPtr qemuHotplugDiskSourceRemovePrepare(virDomainDiskDefPtr disk, - virQEMUCapsPtr qemuCaps ATTRIBUTE_UNUSE= D) + virQEMUCapsPtr qemuCaps) { + qemuDomainDiskPrivatePtr diskPriv =3D QEMU_DOMAIN_DISK_PRIVATE(disk); qemuBlockStorageSourceAttachDataPtr backend =3D NULL; qemuHotplugDiskSourceDataPtr data =3D NULL; qemuHotplugDiskSourceDataPtr ret =3D NULL; char *drivealias =3D NULL; + virStorageSourcePtr n; if (VIR_ALLOC(data) < 0) return NULL; - if (!(drivealias =3D qemuAliasDiskDriveFromDisk(disk))) - goto cleanup; + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) { + if (VIR_STRDUP(data->corAlias, diskPriv->nodeCopyOnRead) < 0) + goto cleanup; - if (!(backend =3D qemuHotplugRemoveStorageSourcePrepareData(disk->src, - drivealias))) - goto cleanup; + for (n =3D disk->src; virStorageSourceIsBacking(n); n =3D n->backi= ngStore) { + if (!(backend =3D qemuHotplugRemoveStorageSourcePrepareData(n,= NULL))) + goto cleanup; - if (VIR_APPEND_ELEMENT(data->backends, data->nbackends, backend) < 0) - goto cleanup; + if (VIR_APPEND_ELEMENT(data->backends, data->nbackends, backen= d) < 0) + goto cleanup; + } + } else { + if (!(drivealias =3D qemuAliasDiskDriveFromDisk(disk))) + goto cleanup; + + if (!(backend =3D qemuHotplugRemoveStorageSourcePrepareData(disk->= src, + driveali= as))) + goto cleanup; + + if (VIR_APPEND_ELEMENT(data->backends, data->nbackends, backend) <= 0) + goto cleanup; + } VIR_STEAL_PTR(ret, data); @@ -502,21 +524,39 @@ static qemuHotplugDiskSourceDataPtr qemuHotplugDiskSourceAttachPrepare(virDomainDiskDefPtr disk, virQEMUCapsPtr qemuCaps) { - qemuBlockStorageSourceAttachDataPtr backend; + qemuBlockStorageSourceAttachDataPtr backend =3D NULL; qemuHotplugDiskSourceDataPtr data; qemuHotplugDiskSourceDataPtr ret =3D NULL; + virStorageSourcePtr n; if (VIR_ALLOC(data) < 0) return NULL; - if (!(backend =3D qemuBuildStorageSourceAttachPrepareDrive(disk, qemuC= aps))) - goto cleanup; + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) { + if (disk->copy_on_read =3D=3D VIR_TRISTATE_SWITCH_ON && + !(data->corProps =3D qemuBlockStorageGetCopyOnReadProps(disk))) + goto cleanup; - if (qemuBuildStorageSourceAttachPrepareCommon(disk->src, backend, qemu= Caps) < 0) - goto cleanup; + for (n =3D disk->src; virStorageSourceIsBacking(n); n =3D n->backi= ngStore) { + if (!(backend =3D qemuBlockStorageSourceAttachPrepareBlockdev(= n))) + goto cleanup; - if (VIR_APPEND_ELEMENT(data->backends, data->nbackends, backend) < 0) - goto cleanup; + if (qemuBuildStorageSourceAttachPrepareCommon(n, backend, qemu= Caps) < 0) + goto cleanup; + + if (VIR_APPEND_ELEMENT(data->backends, data->nbackends, backen= d) < 0) + goto cleanup; + } + } else { + if (!(backend =3D qemuBuildStorageSourceAttachPrepareDrive(disk, q= emuCaps))) + goto cleanup; + + if (qemuBuildStorageSourceAttachPrepareCommon(disk->src, backend, = qemuCaps) < 0) + goto cleanup; + + if (VIR_APPEND_ELEMENT(data->backends, data->nbackends, backend) <= 0) + goto cleanup; + } VIR_STEAL_PTR(ret, data); @@ -546,6 +586,10 @@ qemuHotplugDiskSourceAttach(qemuMonitorPtr mon, return -1; } + if (data->corProps && + qemuMonitorAddObject(mon, &data->corProps, &data->corAlias) < 0) + return -1; + return 0; } @@ -566,6 +610,9 @@ qemuHotplugDiskSourceRemove(qemuMonitorPtr mon, { size_t i; + if (data->corAlias) + ignore_value(qemuMonitorDelObject(mon, data->corAlias)); + for (i =3D 0; i < data->nbackends; i++) qemuBlockStorageSourceAttachRollback(mon, data->backends[i]); } --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176135559328.898870889068; Mon, 13 Aug 2018 09:02:15 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 5B10EC04BE14; Mon, 13 Aug 2018 16:02:13 +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 15584171B2; Mon, 13 Aug 2018 16:02:13 +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 A35101800B6C; Mon, 13 Aug 2018 16:02:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG1Ceh001632 for ; Mon, 13 Aug 2018 12:01:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id 921EE2166BA5; Mon, 13 Aug 2018 16:01:12 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2FC052166BA0 for ; Mon, 13 Aug 2018 16:01:12 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:18 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 44/62] qemu: monitor: Add APIs for cdrom tray handling for -blockdev 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 13 Aug 2018 16:02:14 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" With blockdev we can use the full range of commands to manipulate the tray and the medium separately. Implement monitor code for this. Schema testing done in the qemumonitorjsontest allows us to verify that we generate the commands correctly. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.c | 51 +++++++++++++++++++ src/qemu/qemu_monitor.h | 14 ++++++ src/qemu/qemu_monitor_json.c | 114 +++++++++++++++++++++++++++++++++++++++= ++++ src/qemu/qemu_monitor_json.h | 18 +++++++ tests/qemumonitorjsontest.c | 8 +++ 5 files changed, 205 insertions(+) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 49dc478f5b..0a29ad7502 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -4336,6 +4336,57 @@ qemuMonitorBlockdevDel(qemuMonitorPtr mon, return qemuMonitorJSONBlockdevDel(mon, nodename); } +int +qemuMonitorBlockdevTrayOpen(qemuMonitorPtr mon, + const char *id, + bool force) +{ + VIR_DEBUG("id=3D%s force=3D%d", id, force); + + QEMU_CHECK_MONITOR(mon); + + return qemuMonitorJSONBlockdevTrayOpen(mon, id, force); +} + + +int +qemuMonitorBlockdevTrayClose(qemuMonitorPtr mon, + const char *id) +{ + VIR_DEBUG("id=3D%s", id); + + QEMU_CHECK_MONITOR(mon); + + return qemuMonitorJSONBlockdevTrayClose(mon, id); +} + + +int +qemuMonitorBlockdevMediumRemove(qemuMonitorPtr mon, + const char *id) +{ + VIR_DEBUG("id=3D%s", id); + + QEMU_CHECK_MONITOR(mon); + + return qemuMonitorJSONBlockdevMediumRemove(mon, id); +} + + + +int +qemuMonitorBlockdevMediumInsert(qemuMonitorPtr mon, + const char *id, + const char *nodename) +{ + VIR_DEBUG("id=3D%s nodename=3D%s", id, nodename); + + QEMU_CHECK_MONITOR(mon); + + return qemuMonitorJSONBlockdevMediumInsert(mon, id, nodename); +} + + char * qemuMonitorGetSEVMeasurement(qemuMonitorPtr mon) { diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 70854497b2..649a925829 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1155,6 +1155,20 @@ int qemuMonitorBlockdevAdd(qemuMonitorPtr mon, int qemuMonitorBlockdevDel(qemuMonitorPtr mon, const char *nodename); +int qemuMonitorBlockdevTrayOpen(qemuMonitorPtr mon, + const char *id, + bool force); + +int qemuMonitorBlockdevTrayClose(qemuMonitorPtr mon, + const char *id); + +int qemuMonitorBlockdevMediumRemove(qemuMonitorPtr mon, + const char *id); + +int qemuMonitorBlockdevMediumInsert(qemuMonitorPtr mon, + const char *id, + const char *nodename); + char * qemuMonitorGetSEVMeasurement(qemuMonitorPtr mon); diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 2b168d96c2..3351d405f3 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -8012,6 +8012,120 @@ qemuMonitorJSONBlockdevDel(qemuMonitorPtr mon, return ret; } + +int +qemuMonitorJSONBlockdevTrayOpen(qemuMonitorPtr mon, + const char *id, + bool force) +{ + virJSONValuePtr cmd; + virJSONValuePtr reply =3D NULL; + int ret =3D -1; + + if (!(cmd =3D qemuMonitorJSONMakeCommand("blockdev-open-tray", + "s:id", id, + "b:force", force, NULL))) + return -1; + + if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) + goto cleanup; + + if (qemuMonitorJSONCheckError(cmd, reply) < 0) + goto cleanup; + + ret =3D 0; + + cleanup: + virJSONValueFree(cmd); + virJSONValueFree(reply); + return ret; +} + + +int +qemuMonitorJSONBlockdevTrayClose(qemuMonitorPtr mon, + const char *id) +{ + virJSONValuePtr cmd; + virJSONValuePtr reply =3D NULL; + int ret =3D -1; + + if (!(cmd =3D qemuMonitorJSONMakeCommand("blockdev-close-tray", + "s:id", id, NULL))) + return -1; + + if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) + goto cleanup; + + if (qemuMonitorJSONCheckError(cmd, reply) < 0) + goto cleanup; + + ret =3D 0; + + cleanup: + virJSONValueFree(cmd); + virJSONValueFree(reply); + return ret; +} + + +int +qemuMonitorJSONBlockdevMediumRemove(qemuMonitorPtr mon, + const char *id) +{ + virJSONValuePtr cmd; + virJSONValuePtr reply =3D NULL; + int ret =3D -1; + + if (!(cmd =3D qemuMonitorJSONMakeCommand("blockdev-remove-medium", + "s:id", id, NULL))) + return -1; + + if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) + goto cleanup; + + if (qemuMonitorJSONCheckError(cmd, reply) < 0) + goto cleanup; + + ret =3D 0; + + cleanup: + virJSONValueFree(cmd); + virJSONValueFree(reply); + return ret; +} + + +int +qemuMonitorJSONBlockdevMediumInsert(qemuMonitorPtr mon, + const char *id, + const char *nodename) +{ + virJSONValuePtr cmd; + virJSONValuePtr reply =3D NULL; + int ret =3D -1; + + if (!(cmd =3D qemuMonitorJSONMakeCommand("blockdev-insert-medium", + "s:id", id, + "s:node-name", nodename, + NULL))) + return -1; + + if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) + goto cleanup; + + if (qemuMonitorJSONCheckError(cmd, reply) < 0) + goto cleanup; + + ret =3D 0; + + cleanup: + virJSONValueFree(cmd); + virJSONValueFree(reply); + return ret; +} + + /** * The function is used to retrieve the measurement of a SEV guest. * The measurement is signature of the memory contents that was encrypted diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 19aebef5fb..3c5839db38 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -549,6 +549,24 @@ int qemuMonitorJSONBlockdevDel(qemuMonitorPtr mon, const char *nodename) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); +int qemuMonitorJSONBlockdevTrayOpen(qemuMonitorPtr mon, + const char *id, + bool force) + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); + +int qemuMonitorJSONBlockdevTrayClose(qemuMonitorPtr mon, + const char *id) + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); + +int qemuMonitorJSONBlockdevMediumRemove(qemuMonitorPtr mon, + const char *id) + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); + +int qemuMonitorJSONBlockdevMediumInsert(qemuMonitorPtr mon, + const char *id, + const char *nodename) + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); + int qemuMonitorJSONGetPRManagerInfo(qemuMonitorPtr mon, virHashTablePtr info) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 3da4d3076a..2859d3e82f 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1352,6 +1352,10 @@ GEN_TEST_FUNC(qemuMonitorJSONOpenGraphics, "spice", = "spicefd", false) GEN_TEST_FUNC(qemuMonitorJSONNBDServerStart, "localhost", 12345, "test-ali= as") GEN_TEST_FUNC(qemuMonitorJSONNBDServerAdd, "vda", true) GEN_TEST_FUNC(qemuMonitorJSONDetachCharDev, "serial1") +GEN_TEST_FUNC(qemuMonitorJSONBlockdevTrayOpen, "foodev", true) +GEN_TEST_FUNC(qemuMonitorJSONBlockdevTrayClose, "foodev") +GEN_TEST_FUNC(qemuMonitorJSONBlockdevMediumRemove, "foodev") +GEN_TEST_FUNC(qemuMonitorJSONBlockdevMediumInsert, "foodev", "newnode") static bool testQemuMonitorJSONqemuMonitorJSONQueryCPUsEqual(struct qemuMonitorQueryCp= usEntry *a, @@ -2992,6 +2996,10 @@ mymain(void) DO_TEST_GEN(qemuMonitorJSONNBDServerStart); DO_TEST_GEN(qemuMonitorJSONNBDServerAdd); DO_TEST_GEN(qemuMonitorJSONDetachCharDev); + DO_TEST_GEN(qemuMonitorJSONBlockdevTrayOpen); + DO_TEST_GEN(qemuMonitorJSONBlockdevTrayClose); + DO_TEST_GEN(qemuMonitorJSONBlockdevMediumRemove); + DO_TEST_GEN(qemuMonitorJSONBlockdevMediumInsert); DO_TEST(qemuMonitorJSONGetBalloonInfo); DO_TEST(qemuMonitorJSONGetBlockInfo); DO_TEST(qemuMonitorJSONGetAllBlockStatsInfo); --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176159219351.516825184959; Mon, 13 Aug 2018 09:02:39 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B088930A313B; Mon, 13 Aug 2018 16:02:36 +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 6BFD45B680; Mon, 13 Aug 2018 16:02:36 +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 1803C18033D1; Mon, 13 Aug 2018 16:02:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG1D5a001650 for ; Mon, 13 Aug 2018 12:01:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 419302166BA5; Mon, 13 Aug 2018 16:01:13 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id D35C82166BA0 for ; Mon, 13 Aug 2018 16:01:12 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:19 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 45/62] qemu: hotplug: Implement removable media change for -blockdev 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Mon, 13 Aug 2018 16:02:37 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Use the new APIs which allow to manipulate the tray and media separately and also allow using a nodename to refer to a media to implement media changing. With the new approach we don't have to call eject twice as the media is removed by calling qemuMonitorBlockdevMediumRemove. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 95 +++++++++++++++++++++++++++++++++++++++++++++= +++- 1 file changed, 94 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 6fde7308f7..9e57bffa48 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -618,6 +618,95 @@ qemuHotplugDiskSourceRemove(qemuMonitorPtr mon, } +/** + * qemuDomainChangeMediaBlockdev: + * @driver: qemu driver structure + * @vm: domain definition + * @disk: disk definition to change the source of + * @newsrc: new disk source to change to + * @force: force the change of media + * + * Change the media in an ejectable device to the one described by + * @newsrc. This function also removes the old source from the + * shared device table if appropriate. Note that newsrc is consumed + * on success and the old source is freed on success. + * + * Returns 0 on success, -1 on error and reports libvirt error + */ +static int +qemuDomainChangeMediaBlockdev(virQEMUDriverPtr driver, + virDomainObjPtr vm, + virDomainDiskDefPtr disk, + virStorageSourcePtr newsrc, + bool force) +{ + qemuDomainObjPrivatePtr priv =3D vm->privateData; + qemuDomainDiskPrivatePtr diskPriv =3D QEMU_DOMAIN_DISK_PRIVATE(disk); + qemuHotplugDiskSourceDataPtr newbackend =3D NULL; + qemuHotplugDiskSourceDataPtr oldbackend =3D NULL; + virStorageSourcePtr oldsrc =3D disk->src; + char *nodename =3D NULL; + int rc; + int ret =3D -1; + + if (!virStorageSourceIsEmpty(disk->src) && + !(oldbackend =3D qemuHotplugDiskSourceRemovePrepare(disk, priv->qe= muCaps))) + goto cleanup; + + disk->src =3D newsrc; + if (!virStorageSourceIsEmpty(disk->src)) { + if (!(newbackend =3D qemuHotplugDiskSourceAttachPrepare(disk, + priv->qemuCa= ps))) + goto cleanup; + + if (qemuDomainDiskGetBackendAlias(disk, priv->qemuCaps, &nodename)= < 0) + goto cleanup; + } + + if (diskPriv->tray && disk->tray_status !=3D VIR_DOMAIN_DISK_TRAY_OPEN= ) { + qemuDomainObjEnterMonitor(driver, vm); + rc =3D qemuMonitorBlockdevTrayOpen(priv->mon, diskPriv->backendQom= Name, force); + if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0) + goto cleanup; + + if (!force && qemuHotplugWaitForTrayEject(vm, disk) < 0) + goto cleanup; + } + + qemuDomainObjEnterMonitor(driver, vm); + + rc =3D qemuMonitorBlockdevMediumRemove(priv->mon, diskPriv->backendQom= Name); + + if (rc =3D=3D 0 && oldbackend) + qemuHotplugDiskSourceRemove(priv->mon, oldbackend); + + if (newbackend && nodename) { + if (rc =3D=3D 0) + rc =3D qemuHotplugDiskSourceAttach(priv->mon, newbackend); + + if (rc =3D=3D 0) + rc =3D qemuMonitorBlockdevMediumInsert(priv->mon, + diskPriv->backendQomName, + nodename); + } + + if (rc =3D=3D 0) + rc =3D qemuMonitorBlockdevTrayClose(priv->mon, diskPriv->backendQo= mName); + + if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0) + goto cleanup; + + ret =3D 0; + + cleanup: + qemuHotplugDiskSourceDataFree(newbackend); + qemuHotplugDiskSourceDataFree(oldbackend); + /* caller handles correct exchange of sources */ + disk->src =3D oldsrc; + return ret; +} + + /** * qemuDomainChangeEjectableMedia: * @driver: qemu driver structure @@ -640,6 +729,7 @@ qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver, virStorageSourcePtr newsrc, bool force) { + qemuDomainObjPrivatePtr priv =3D vm->privateData; int ret =3D -1; int rc; @@ -649,7 +739,10 @@ qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver, if (qemuHotplugAttachManagedPR(driver, vm, newsrc, QEMU_ASYNC_JOB_NONE= ) < 0) goto cleanup; - rc =3D qemuDomainChangeMediaLegacy(driver, vm, disk, newsrc, force); + if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV)) + rc =3D qemuDomainChangeMediaBlockdev(driver, vm, disk, newsrc, for= ce); + else + rc =3D qemuDomainChangeMediaLegacy(driver, vm, disk, newsrc, force= ); virDomainAuditDisk(vm, disk->src, newsrc, "update", rc >=3D 0); --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176164356678.1540546992668; Mon, 13 Aug 2018 09:02:44 -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 6A2D93002721; Mon, 13 Aug 2018 16:02:40 +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 DEDE16FDD1; Mon, 13 Aug 2018 16:02:39 +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 892A81800C9C; Mon, 13 Aug 2018 16:02:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG1EBi001660 for ; Mon, 13 Aug 2018 12:01:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id E430B2166BA5; Mon, 13 Aug 2018 16:01:13 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 820A02166BA0 for ; Mon, 13 Aug 2018 16:01:13 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:20 +0200 Message-Id: <63615cb38efa04b12a3655b2b25eb41225b18ba5.1534173735.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 46/62] qemu: driver: Don't copy disk alias in qemuDomainBlocksStatsGather 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.46]); Mon, 13 Aug 2018 16:02:42 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The string is not modified so it does not make sense to have a copy. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 5dee701dc4..f36d4dc37f 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -11071,7 +11071,7 @@ qemuDomainBlocksStatsGather(virQEMUDriverPtr driver, virHashTablePtr blockstats =3D NULL; qemuBlockStatsPtr stats; int nstats; - char *diskAlias =3D NULL; + const char *entryname =3D NULL; int ret =3D -1; if (*path) { @@ -11086,8 +11086,7 @@ qemuDomainBlocksStatsGather(virQEMUDriverPtr driver, goto cleanup; } - if (VIR_STRDUP(diskAlias, disk->info.alias) < 0) - goto cleanup; + entryname =3D disk->info.alias; } qemuDomainObjEnterMonitor(driver, vm); @@ -11103,10 +11102,10 @@ qemuDomainBlocksStatsGather(virQEMUDriverPtr driv= er, if (VIR_ALLOC(*retstats) < 0) goto cleanup; - if (diskAlias) { - if (!(stats =3D virHashLookup(blockstats, diskAlias))) { + if (entryname) { + if (!(stats =3D virHashLookup(blockstats, entryname))) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot find statistics for device '%s'"), di= skAlias); + _("cannot find statistics for device '%s'"), en= tryname); goto cleanup; } @@ -11118,7 +11117,6 @@ qemuDomainBlocksStatsGather(virQEMUDriverPtr driver, ret =3D nstats; cleanup: - VIR_FREE(diskAlias); virHashFree(blockstats); return ret; } --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176163674304.5343478361601; Mon, 13 Aug 2018 09:02:43 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9538F333B9; Mon, 13 Aug 2018 16:02:41 +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 53AD527095; Mon, 13 Aug 2018 16:02:41 +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 EEF391800BDD; Mon, 13 Aug 2018 16:02:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG1Ebt001678 for ; Mon, 13 Aug 2018 12:01:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id 93B8F2166BA5; Mon, 13 Aug 2018 16:01:14 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 30D1A2166BA0 for ; Mon, 13 Aug 2018 16:01:14 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:21 +0200 Message-Id: <63045ffe31c5d9af526f4cc0359a2f81d8738ae6.1534173735.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 47/62] qemu: Explicitly find disks for stats totals 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 13 Aug 2018 16:02:42 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Rather than totalling every entry from 'query-block' for stats provided by qemuDomainBlocksStatsGather total only stats for known disks. This will allow to return data for nodenames and qdevs in the same hash so that we can use them with -blockdev. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index f36d4dc37f..e18187b7bb 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -11023,13 +11023,9 @@ qemuDomainBlockResize(virDomainPtr dom, static int -qemuDomainBlockStatsGatherTotals(void *payload, - const void *name ATTRIBUTE_UNUSED, - void *opaque) +qemuDomainBlockStatsGatherTotals(qemuBlockStatsPtr data, + qemuBlockStatsPtr total) { - qemuBlockStatsPtr data =3D payload; - qemuBlockStatsPtr total =3D opaque; - #define QEMU_BLOCK_STAT_TOTAL(NAME) \ if (data->NAME > 0) \ total->NAME +=3D data->NAME @@ -11070,6 +11066,7 @@ qemuDomainBlocksStatsGather(virQEMUDriverPtr driver, virDomainDiskDefPtr disk; virHashTablePtr blockstats =3D NULL; qemuBlockStatsPtr stats; + size_t i; int nstats; const char *entryname =3D NULL; int ret =3D -1; @@ -11111,7 +11108,21 @@ qemuDomainBlocksStatsGather(virQEMUDriverPtr drive= r, **retstats =3D *stats; } else { - virHashForEach(blockstats, qemuDomainBlockStatsGatherTotals, *rets= tats); + for (i =3D 0; i < vm->def->ndisks; i++) { + disk =3D vm->def->disks[i]; + entryname =3D disk->info.alias; + + if (!entryname) + continue; + + if (!(stats =3D virHashLookup(blockstats, entryname))) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot find statistics for device '%s'")= , entryname); + goto cleanup; + } + + qemuDomainBlockStatsGatherTotals(stats, *retstats); + } } ret =3D nstats; --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 153417614158637.468835734607524; Mon, 13 Aug 2018 09:02:21 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0AF82307CF20; Mon, 13 Aug 2018 16:02:19 +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 B96B126FCC; Mon, 13 Aug 2018 16:02:18 +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 D240712D9A; Mon, 13 Aug 2018 16:02:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG1FJG001690 for ; Mon, 13 Aug 2018 12:01:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id 479612166BA5; Mon, 13 Aug 2018 16:01:15 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id D908E2166BA0 for ; Mon, 13 Aug 2018 16:01:14 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:22 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 48/62] qemu: monitor: Retrieve blockstats also by qdev and node-names 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Mon, 13 Aug 2018 16:02:20 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" For use with -blockdev we need to be able to retrieve the stats by 'qdev' for the frontend device stats since 'device' will be empty. Note that for non-blockdev case qdev and 'device' with 'drive-' skipped would be the same. Additionally so that we can report the highest written offset we need to also be able to access them by node-name for backing chain purposes. In cases when 'device' is empty it does not make sense to gather them. Allow arranging the stats simultaneously in all the above dimensions. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor_json.c | 55 ++++++++++++++++++++++++++++++++++++++++= ---- 1 file changed, 50 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 3351d405f3..670147ddb6 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2332,6 +2332,28 @@ qemuMonitorJSONBlockStatsCollectData(virJSONValuePtr= dev, } +static int +qemuMonitorJSONAddOneBlockStatsInfo(qemuBlockStatsPtr bstats, + const char *name, + virHashTablePtr stats) +{ + qemuBlockStatsPtr copy =3D NULL; + + if (VIR_ALLOC(copy) < 0) + return -1; + + if (bstats) + *copy =3D *bstats; + + if (virHashAddEntry(stats, name, copy) < 0) { + VIR_FREE(copy); + return -1; + } + + return 0; +} + + static int qemuMonitorJSONGetOneBlockStatsInfo(virJSONValuePtr dev, const char *dev_name, @@ -2342,18 +2364,38 @@ qemuMonitorJSONGetOneBlockStatsInfo(virJSONValuePtr= dev, qemuBlockStatsPtr bstats =3D NULL; int ret =3D -1; int nstats =3D 0; - char *entry_name =3D qemuDomainStorageAlias(dev_name, depth); + const char *qdevname =3D NULL; + const char *nodename =3D NULL; + char *devicename =3D NULL; virJSONValuePtr backing; - if (!entry_name) + if (dev_name && + !(devicename =3D qemuDomainStorageAlias(dev_name, depth))) goto cleanup; + qdevname =3D virJSONValueObjectGetString(dev, "qdev"); + nodename =3D virJSONValueObjectGetString(dev, "node-name"); + + if (!devicename && !qdevname && !nodename) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("blockstats device entry was not in expected form= at")); + goto cleanup; + } + if (!(bstats =3D qemuMonitorJSONBlockStatsCollectData(dev, &nstats))) goto cleanup; - if (virHashAddEntry(hash, entry_name, bstats) < 0) + if (devicename && + qemuMonitorJSONAddOneBlockStatsInfo(bstats, devicename, hash) < 0) + goto cleanup; + + if (qdevname && STRNEQ_NULLABLE(qdevname, devicename) && + qemuMonitorJSONAddOneBlockStatsInfo(bstats, qdevname, hash) < 0) + goto cleanup; + + if (nodename && + qemuMonitorJSONAddOneBlockStatsInfo(bstats, nodename, hash) < 0) goto cleanup; - bstats =3D NULL; if (backingChain && (backing =3D virJSONValueObjectGetObject(dev, "backing")) && @@ -2364,7 +2406,7 @@ qemuMonitorJSONGetOneBlockStatsInfo(virJSONValuePtr d= ev, ret =3D nstats; cleanup: VIR_FREE(bstats); - VIR_FREE(entry_name); + VIR_FREE(devicename); return ret; } @@ -2426,6 +2468,9 @@ qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mo= n, goto cleanup; } + if (*dev_name =3D=3D '\0') + dev_name =3D NULL; + rc =3D qemuMonitorJSONGetOneBlockStatsInfo(dev, dev_name, 0, hash, backingChain); --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176166506169.41340708094788; Mon, 13 Aug 2018 09:02:46 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3C14B81232; Mon, 13 Aug 2018 16:02:44 +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 E920260BE7; Mon, 13 Aug 2018 16:02:43 +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 978EB3D3C9; Mon, 13 Aug 2018 16:02:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG1GCs001703 for ; Mon, 13 Aug 2018 12:01:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id ED0462166BA5; Mon, 13 Aug 2018 16:01:15 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 895DF2166BA0 for ; Mon, 13 Aug 2018 16:01:15 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:23 +0200 Message-Id: <73a96829da72c7c18aa4cab7ad4adf009dc37968.1534173735.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 49/62] qemu: monitor: Add APIs for refreshing disk capacity when using -blockdev 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 13 Aug 2018 16:02:45 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Disk image size data are not contained in the reply of query-blockstats but need to be gathered from query-block. For use with -blockdev we really need to call 'query-named-block-nodes' and process it to retrieve the correct data. This patch introduces qemuMonitorBlockStatsUpdateCapacityBlockdev which updates the capacity data by nodename rather than device name. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.c | 11 +++++++++++ src/qemu/qemu_monitor.h | 4 ++++ src/qemu/qemu_monitor_json.c | 46 ++++++++++++++++++++++++++++++++++++++++= ++++ src/qemu/qemu_monitor_json.h | 3 +++ 4 files changed, 64 insertions(+) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 0a29ad7502..f5dca42b38 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2311,6 +2311,17 @@ qemuMonitorBlockStatsUpdateCapacity(qemuMonitorPtr m= on, } +int +qemuMonitorBlockStatsUpdateCapacityBlockdev(qemuMonitorPtr mon, + virHashTablePtr stats) +{ + VIR_DEBUG("stats=3D%p", stats); + + QEMU_CHECK_MONITOR(mon); + + return qemuMonitorJSONBlockStatsUpdateCapacityBlockdev(mon, stats); +} + int qemuMonitorBlockResize(qemuMonitorPtr mon, const char *device, diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 649a925829..f83a18f563 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -599,6 +599,10 @@ int qemuMonitorBlockStatsUpdateCapacity(qemuMonitorPtr= mon, bool backingChain) ATTRIBUTE_NONNULL(2); +int qemuMonitorBlockStatsUpdateCapacityBlockdev(qemuMonitorPtr mon, + virHashTablePtr stats) + ATTRIBUTE_NONNULL(2); + int qemuMonitorBlockResize(qemuMonitorPtr mon, const char *device, const char *nodename, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 670147ddb6..438864ac40 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2593,6 +2593,52 @@ qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitorP= tr mon, } +static int +qemuMonitorJSONBlockStatsUpdateCapacityBlockdevWorker(size_t pos ATTRIBUTE= _UNUSED, + virJSONValuePtr val, + void *opaque) +{ + virHashTablePtr stats =3D opaque; + virJSONValuePtr image; + const char *nodename; + + if (!(nodename =3D virJSONValueObjectGetString(val, "node-name")) || + !(image =3D virJSONValueObjectGetObject(val, "image"))) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("query-named-block-nodes entry was not in expecte= d format")); + return -1; + } + + if (qemuMonitorJSONBlockStatsUpdateCapacityData(image, nodename, stats= ) < 0) + return -1; + + return 1; /* we don't want to steal the value from the JSON array */ +} + + +int +qemuMonitorJSONBlockStatsUpdateCapacityBlockdev(qemuMonitorPtr mon, + virHashTablePtr stats) +{ + virJSONValuePtr nodes; + int ret =3D -1; + + if (!(nodes =3D qemuMonitorJSONQueryNamedBlockNodes(mon))) + return -1; + + if (virJSONValueArrayForeachSteal(nodes, + qemuMonitorJSONBlockStatsUpdateCapac= ityBlockdevWorker, + stats) < 0) + goto cleanup; + + ret =3D 0; + + cleanup: + virJSONValueFree(nodes); + return ret; +} + + int qemuMonitorJSONBlockResize(qemuMonitorPtr mon, const char *device, const char *nodename, diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 3c5839db38..51214e3797 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -93,6 +93,9 @@ int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mo= n, int qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitorPtr mon, virHashTablePtr stats, bool backingChain); +int qemuMonitorJSONBlockStatsUpdateCapacityBlockdev(qemuMonitorPtr mon, + virHashTablePtr stats); + int qemuMonitorJSONBlockResize(qemuMonitorPtr mon, const char *device, const char *nodename, --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176762115695.4320300058897; Mon, 13 Aug 2018 09:12:42 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id EEDBF804F1; Mon, 13 Aug 2018 16:12:38 +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 3C3C618766; Mon, 13 Aug 2018 16:12:37 +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 12E6C1800B7E; Mon, 13 Aug 2018 16:02:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG1GLL001711 for ; Mon, 13 Aug 2018 12:01:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9C8B32166BA5; Mon, 13 Aug 2018 16:01:16 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3A4B52166BA0 for ; Mon, 13 Aug 2018 16:01:16 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:24 +0200 Message-Id: <67d8d3f78372092c0e8b42fd579cb1e246c0c705.1534173735.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 50/62] qemu: driver: Don't pass 'virDomainDiskDefPtr' to qemuDomainGetStatsOneBlock 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 13 Aug 2018 16:12:40 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Allow reuse of qemuDomainGetStatsOneBlock to work with nodenames by removing the code that looks up the stats data to the caller. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index e18187b7bb..63ce68bd35 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -20061,7 +20061,8 @@ qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver, virDomainObjPtr dom, virDomainStatsRecordPtr record, int *maxparams, - virDomainDiskDefPtr disk, + const char *diskdst, + const char *entryname, virStorageSourcePtr src, size_t block_idx, virHashTablePtr stats, @@ -20069,13 +20070,9 @@ qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver, { qemuBlockStats *entry; int ret =3D -1; - char *alias =3D NULL; - if (disk->info.alias) - alias =3D qemuDomainStorageAlias(disk->info.alias, src->id); + QEMU_ADD_NAME_PARAM(record, maxparams, "block", "name", block_idx, dis= kdst); - QEMU_ADD_NAME_PARAM(record, maxparams, "block", "name", block_idx, - disk->dst); if (virStorageSourceIsLocalStorage(src) && src->path) QEMU_ADD_NAME_PARAM(record, maxparams, "block", "path", block_idx, src->path); @@ -20094,7 +20091,7 @@ qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver, /* In case where qemu didn't provide the stats we stop here rather than * trying to refresh the stats from the disk. Inability to provide sta= ts is * usually caused by blocked storage so this would make libvirtd hang = */ - if (!stats || !alias || !(entry =3D virHashLookup(stats, alias))) { + if (!stats || !entryname || !(entry =3D virHashLookup(stats, entryname= ))) { ret =3D 0; goto cleanup; } @@ -20140,7 +20137,6 @@ qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver, ret =3D 0; cleanup: - VIR_FREE(alias); return ret; } @@ -20165,6 +20161,7 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver, int count_index =3D -1; size_t visited =3D 0; bool visitBacking =3D !!(privflags & QEMU_DOMAIN_STATS_BACKING); + char *alias =3D NULL; if (HAVE_JOB(privflags) && virDomainObjIsActive(dom)) { qemuDomainObjEnterMonitor(driver, dom); @@ -20201,10 +20198,18 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver, while (virStorageSourceIsBacking(src) && (src =3D=3D disk->src || visitBacking)) { + + /* alias may be NULL if the VM is not running */ + if (disk->info.alias && + !(alias =3D qemuDomainStorageAlias(disk->info.alias, src->= id))) + goto cleanup; + if (qemuDomainGetStatsOneBlock(driver, cfg, dom, record, maxpa= rams, - disk, src, visited, + disk->dst, alias, src, visited, stats, nodestats) < 0) goto cleanup; + + VIR_FREE(alias); visited++; src =3D src->backingStore; } @@ -20214,6 +20219,7 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver, ret =3D 0; cleanup: + VIR_FREE(alias); virHashFree(stats); virHashFree(nodestats); virJSONValueFree(nodedata); --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176173857317.69070364408276; Mon, 13 Aug 2018 09:02:53 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 039963167E72; Mon, 13 Aug 2018 16:02:49 +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 ABAAF62689; Mon, 13 Aug 2018 16:02:48 +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 3E38C1800B80; Mon, 13 Aug 2018 16:02:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG1HUx001738 for ; Mon, 13 Aug 2018 12:01:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 538452166BA5; Mon, 13 Aug 2018 16:01:17 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id E44942166BA0 for ; Mon, 13 Aug 2018 16:01:16 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:25 +0200 Message-Id: <125fe71a2e3d2c165298517078eb35eff780484d.1534173735.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 51/62] qemu: monitor: Extract 'write-threshold' automatically for -blockdev 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Mon, 13 Aug 2018 16:02:52 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" In cases when -blockdev is used we need to use 'query-named-block-nodes' instead of 'query-block'. This means that we can extract the write-threshold variable right away. To keep compatibility with old VMs modify the code which was extracting the value previously so that it updates the stats structure and a single code path then can be used to extract the data. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 57 ++++++++++++++++++++++++++--------------= ---- src/qemu/qemu_monitor.h | 3 +++ src/qemu/qemu_monitor_json.c | 16 ++++++++++--- 3 files changed, 50 insertions(+), 26 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 63ce68bd35..688746c36f 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -20029,29 +20029,39 @@ qemuDomainGetStatsOneBlockFallback(virQEMUDriverP= tr driver, } -static int -qemuDomainGetStatsOneBlockNode(virDomainStatsRecordPtr record, - int *maxparams, - virStorageSourcePtr src, - size_t block_idx, - virHashTablePtr nodedata) +/** + * qemuDomainGetStatsOneBlockRefreshNamed: + * @src: disk source structure + * @alias: disk alias + * @stats: hash table containing stats for all disks + * @nodedata: reply containin 'query-named-block-nodes' data + * + * Refresh disk block stats data (qemuBlockStatsPtr) which are present only + * in the reply of 'query-named-block-nodes' in cases when the data was ga= thered + * by using qem-block originally. + */ +static void +qemuDomainGetStatsOneBlockRefreshNamed(virStorageSourcePtr src, + const char *alias, + virHashTablePtr stats, + virHashTablePtr nodedata) { + qemuBlockStatsPtr entry; + virJSONValuePtr data; unsigned long long tmp; - int ret =3D -1; - if (src->nodestorage && - (data =3D virHashLookup(nodedata, src->nodestorage))) { - if (virJSONValueObjectGetNumberUlong(data, "write_threshold", &tmp= ) =3D=3D 0 && - tmp > 0) - QEMU_ADD_BLOCK_PARAM_ULL(record, maxparams, block_idx, - "threshold", tmp); - } + if (!nodedata || !src->nodestorage) + return; - ret =3D 0; + if (!(entry =3D virHashLookup(stats, alias))) + return; - cleanup: - return ret; + if (!(data =3D virHashLookup(nodedata, src->nodestorage))) + return; + + if (virJSONValueObjectGetNumberUlong(data, "write_threshold", &tmp) = =3D=3D 0) + entry->write_threshold =3D tmp; } @@ -20065,8 +20075,7 @@ qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver, const char *entryname, virStorageSourcePtr src, size_t block_idx, - virHashTablePtr stats, - virHashTablePtr nodedata) + virHashTablePtr stats) { qemuBlockStats *entry; int ret =3D -1; @@ -20131,9 +20140,9 @@ qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver, } } - if (qemuDomainGetStatsOneBlockNode(record, maxparams, src, block_idx, - nodedata) < 0) - goto cleanup; + if (entry->write_threshold) + QEMU_ADD_BLOCK_PARAM_ULL(record, maxparams, block_idx, "threshold", + entry->write_threshold); ret =3D 0; cleanup: @@ -20204,9 +20213,11 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver, !(alias =3D qemuDomainStorageAlias(disk->info.alias, src->= id))) goto cleanup; + qemuDomainGetStatsOneBlockRefreshNamed(src, alias, stats, node= stats); + if (qemuDomainGetStatsOneBlock(driver, cfg, dom, record, maxpa= rams, disk->dst, alias, src, visited, - stats, nodestats) < 0) + stats) < 0) goto cleanup; VIR_FREE(alias); diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index f83a18f563..ae54b13a55 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -587,6 +587,9 @@ struct _qemuBlockStats { * if wr_highest_offset_valid is true */ unsigned long long wr_highest_offset; bool wr_highest_offset_valid; + + /* write_threshold is valid only if it's non-zero, conforming to qemu = semantics */ + unsigned long long write_threshold; }; int qemuMonitorGetAllBlockStatsInfo(qemuMonitorPtr mon, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 438864ac40..f98269b34a 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2492,7 +2492,8 @@ qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mo= n, static int qemuMonitorJSONBlockStatsUpdateCapacityData(virJSONValuePtr image, const char *name, - virHashTablePtr stats) + virHashTablePtr stats, + qemuBlockStatsPtr *entry) { qemuBlockStatsPtr bstats; @@ -2506,6 +2507,9 @@ qemuMonitorJSONBlockStatsUpdateCapacityData(virJSONVa= luePtr image, } } + if (entry) + *entry =3D bstats; + /* failures can be ignored after this point */ if (virJSONValueObjectGetNumberUlong(image, "virtual-size", &bstats->capacity) < 0) @@ -2531,7 +2535,8 @@ qemuMonitorJSONBlockStatsUpdateCapacityOne(virJSONVal= uePtr image, char *entry_name =3D qemuDomainStorageAlias(dev_name, depth); virJSONValuePtr backing; - if (qemuMonitorJSONBlockStatsUpdateCapacityData(image, entry_name, sta= ts) < 0) + if (qemuMonitorJSONBlockStatsUpdateCapacityData(image, entry_name, + stats, NULL) < 0) goto cleanup; if (backingChain && @@ -2601,6 +2606,7 @@ qemuMonitorJSONBlockStatsUpdateCapacityBlockdevWorker= (size_t pos ATTRIBUTE_UNUSE virHashTablePtr stats =3D opaque; virJSONValuePtr image; const char *nodename; + qemuBlockStatsPtr entry; if (!(nodename =3D virJSONValueObjectGetString(val, "node-name")) || !(image =3D virJSONValueObjectGetObject(val, "image"))) { @@ -2609,9 +2615,13 @@ qemuMonitorJSONBlockStatsUpdateCapacityBlockdevWorke= r(size_t pos ATTRIBUTE_UNUSE return -1; } - if (qemuMonitorJSONBlockStatsUpdateCapacityData(image, nodename, stats= ) < 0) + if (qemuMonitorJSONBlockStatsUpdateCapacityData(image, nodename, stats= , &entry) < 0) return -1; + if (entry) + ignore_value(virJSONValueObjectGetNumberUlong(val, "write_threshol= d", + &entry->write_thresh= old)); + return 1; /* we don't want to steal the value from the JSON array */ } --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:12 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176170516944.3317944266106; Mon, 13 Aug 2018 09:02:50 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F120281DE3; Mon, 13 Aug 2018 16:02:47 +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 AEF022010D95; Mon, 13 Aug 2018 16:02:47 +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 2ACE224F62; Mon, 13 Aug 2018 16:02:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG1IuE001802 for ; Mon, 13 Aug 2018 12:01:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 03C2E2166BA5; Mon, 13 Aug 2018 16:01:18 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9493F2166BA0 for ; Mon, 13 Aug 2018 16:01:17 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:26 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 52/62] qemu: Extract exporting of disk block statistics 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.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 13 Aug 2018 16:02:48 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Split out the code which converts the stats gathered in qemuDomainGetStatsBlock into typed parameters so that it will look less ugly when extending it. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 73 +++++++++++++++++++++++++++++++++-------------= ---- 1 file changed, 49 insertions(+), 24 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 688746c36f..ac9c7faf2e 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -20150,6 +20150,51 @@ qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver, } +static int +qemuDomainGetStatsBlockExportDisk(virDomainDiskDefPtr disk, + virHashTablePtr stats, + virHashTablePtr nodestats, + virDomainStatsRecordPtr records, + int *nrecords, + size_t *recordnr, + bool visitBacking, + virQEMUDriverPtr driver, + virQEMUDriverConfigPtr cfg, + virDomainObjPtr dom) + +{ + char *alias =3D NULL; + virStorageSourcePtr src =3D disk->src; + int ret =3D -1; + + while (virStorageSourceIsBacking(src) && + (src =3D=3D disk->src || visitBacking)) { + + /* alias may be NULL if the VM is not running */ + if (disk->info.alias && + !(alias =3D qemuDomainStorageAlias(disk->info.alias, src->id))) + goto cleanup; + + qemuDomainGetStatsOneBlockRefreshNamed(src, alias, stats, nodestat= s); + + if (qemuDomainGetStatsOneBlock(driver, cfg, dom, records, nrecords, + disk->dst, alias, src, *recordnr, + stats) < 0) + goto cleanup; + + VIR_FREE(alias); + (*recordnr)++; + src =3D src->backingStore; + } + + ret =3D 0; + + cleanup: + VIR_FREE(alias); + return ret; +} + + static int qemuDomainGetStatsBlock(virQEMUDriverPtr driver, virDomainObjPtr dom, @@ -20170,7 +20215,6 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver, int count_index =3D -1; size_t visited =3D 0; bool visitBacking =3D !!(privflags & QEMU_DOMAIN_STATS_BACKING); - char *alias =3D NULL; if (HAVE_JOB(privflags) && virDomainObjIsActive(dom)) { qemuDomainObjEnterMonitor(driver, dom); @@ -20202,35 +20246,16 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver, QEMU_ADD_COUNT_PARAM(record, maxparams, "block", 0); for (i =3D 0; i < dom->def->ndisks; i++) { - virDomainDiskDefPtr disk =3D dom->def->disks[i]; - virStorageSourcePtr src =3D disk->src; - - while (virStorageSourceIsBacking(src) && - (src =3D=3D disk->src || visitBacking)) { - - /* alias may be NULL if the VM is not running */ - if (disk->info.alias && - !(alias =3D qemuDomainStorageAlias(disk->info.alias, src->= id))) - goto cleanup; - - qemuDomainGetStatsOneBlockRefreshNamed(src, alias, stats, node= stats); - - if (qemuDomainGetStatsOneBlock(driver, cfg, dom, record, maxpa= rams, - disk->dst, alias, src, visited, - stats) < 0) - goto cleanup; - - VIR_FREE(alias); - visited++; - src =3D src->backingStore; - } + if (qemuDomainGetStatsBlockExportDisk(dom->def->disks[i], stats, n= odestats, + record, maxparams, &visited, + visitBacking, driver, cfg, d= om) < 0) + goto cleanup; } record->params[count_index].value.ui =3D visited; ret =3D 0; cleanup: - VIR_FREE(alias); virHashFree(stats); virHashFree(nodestats); virJSONValueFree(nodedata); --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:13 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176176714722.4082198843801; Mon, 13 Aug 2018 09:02:56 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E83AA81F0C; Mon, 13 Aug 2018 16:02:53 +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 A2DB7AC32E; Mon, 13 Aug 2018 16:02:53 +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 37C8C24F5C; Mon, 13 Aug 2018 16:02:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG1Ik3001911 for ; Mon, 13 Aug 2018 12:01:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id A75BA2166BA5; Mon, 13 Aug 2018 16:01:18 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 44CC82166BA0 for ; Mon, 13 Aug 2018 16:01:18 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:27 +0200 Message-Id: <29c5a3d9f7dfb5309b8fea6aca46cff38438b2ce.1534173735.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 53/62] qemu: Extract exporting of the header for block stats 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.84 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 13 Aug 2018 16:02:55 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Split out the header so that the loop can be refactored later. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index ac9c7faf2e..6ea86c8cbf 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -20071,7 +20071,6 @@ qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver, virDomainObjPtr dom, virDomainStatsRecordPtr record, int *maxparams, - const char *diskdst, const char *entryname, virStorageSourcePtr src, size_t block_idx, @@ -20080,14 +20079,6 @@ qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver, qemuBlockStats *entry; int ret =3D -1; - QEMU_ADD_NAME_PARAM(record, maxparams, "block", "name", block_idx, dis= kdst); - - if (virStorageSourceIsLocalStorage(src) && src->path) - QEMU_ADD_NAME_PARAM(record, maxparams, "block", "path", - block_idx, src->path); - if (src->id) - QEMU_ADD_BLOCK_PARAM_UI(record, maxparams, block_idx, "backingInde= x", - src->id); /* the VM is offline so we have to go and load the stast from the disk= by * ourselves */ @@ -20150,6 +20141,29 @@ qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver, } +static int +qemuDomainGetStatsBlockExportHeader(virDomainDiskDefPtr disk, + virStorageSourcePtr src, + size_t recordnr, + virDomainStatsRecordPtr records, + int *nrecords) +{ + int ret =3D -1; + + QEMU_ADD_NAME_PARAM(records, nrecords, "block", "name", recordnr, disk= ->dst); + + if (virStorageSourceIsLocalStorage(src) && src->path) + QEMU_ADD_NAME_PARAM(records, nrecords, "block", "path", recordnr, = src->path); + if (src->id) + QEMU_ADD_BLOCK_PARAM_UI(records, nrecords, recordnr, "backingIndex= ", + src->id); + + ret =3D 0; + cleanup: + return ret; +} + + static int qemuDomainGetStatsBlockExportDisk(virDomainDiskDefPtr disk, virHashTablePtr stats, @@ -20177,8 +20191,12 @@ qemuDomainGetStatsBlockExportDisk(virDomainDiskDef= Ptr disk, qemuDomainGetStatsOneBlockRefreshNamed(src, alias, stats, nodestat= s); + if (qemuDomainGetStatsBlockExportHeader(disk, src, *recordnr, + records, nrecords) < 0) + goto cleanup; + if (qemuDomainGetStatsOneBlock(driver, cfg, dom, records, nrecords, - disk->dst, alias, src, *recordnr, + alias, src, *recordnr, stats) < 0) goto cleanup; --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:13 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176175117686.8094942063319; Mon, 13 Aug 2018 09:02:55 -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 730193078AAB; Mon, 13 Aug 2018 16:02:52 +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 240216F975; Mon, 13 Aug 2018 16:02:52 +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 B2BCC1800B85; Mon, 13 Aug 2018 16:02:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG1Jnt001946 for ; Mon, 13 Aug 2018 12:01:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id 598562166BA5; Mon, 13 Aug 2018 16:01:19 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id E8D4C2166BA0 for ; Mon, 13 Aug 2018 16:01:18 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:28 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 54/62] qemu: Export stats relevant for the frontend separately 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.48]); Mon, 13 Aug 2018 16:02:53 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" While we report the read and written byte stats for every single layer of the backing chain, qemu in fact reports them only for the frontend. Split out the relevant stats into a separate function so that we can later fix this bug and stop reporting it for backing chain entries where they don't make sense. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 54 ++++++++++++++++++++++++++++++++++------------= ---- 1 file changed, 37 insertions(+), 17 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 6ea86c8cbf..479bf3adfe 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -20096,23 +20096,6 @@ qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver, goto cleanup; } - QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, block_idx, - "rd.reqs", entry->rd_req); - QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, block_idx, - "rd.bytes", entry->rd_bytes); - QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, block_idx, - "rd.times", entry->rd_total_times); - QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, block_idx, - "wr.reqs", entry->wr_req); - QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, block_idx, - "wr.bytes", entry->wr_bytes); - QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, block_idx, - "wr.times", entry->wr_total_times); - QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, block_idx, - "fl.reqs", entry->flush_req); - QEMU_ADD_BLOCK_PARAM_LL(record, maxparams, block_idx, - "fl.times", entry->flush_total_times); - QEMU_ADD_BLOCK_PARAM_ULL(record, maxparams, block_idx, "allocation", entry->wr_highest_offset); @@ -20141,6 +20124,39 @@ qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver, } +static int +qemuDomainGetStatsBlockExportFrontend(const char *frontendname, + virHashTablePtr stats, + size_t recordnr, + virDomainStatsRecordPtr records, + int *nrecords) +{ + qemuBlockStats *entry; + int ret =3D -1; + + /* In case where qemu didn't provide the stats we stop here rather than + * trying to refresh the stats from the disk. Inability to provide sta= ts is + * usually caused by blocked storage so this would make libvirtd hang = */ + if (!stats || !frontendname || !(entry =3D virHashLookup(stats, fronte= ndname))) { + ret =3D 0; + goto cleanup; + } + + QEMU_ADD_BLOCK_PARAM_LL(records, nrecords, recordnr, "rd.reqs", entry-= >rd_req); + QEMU_ADD_BLOCK_PARAM_LL(records, nrecords, recordnr, "rd.bytes", entry= ->rd_bytes); + QEMU_ADD_BLOCK_PARAM_LL(records, nrecords, recordnr, "rd.times", entry= ->rd_total_times); + QEMU_ADD_BLOCK_PARAM_LL(records, nrecords, recordnr, "wr.reqs", entry-= >wr_req); + QEMU_ADD_BLOCK_PARAM_LL(records, nrecords, recordnr, "wr.bytes", entry= ->wr_bytes); + QEMU_ADD_BLOCK_PARAM_LL(records, nrecords, recordnr, "wr.times", entry= ->wr_total_times); + QEMU_ADD_BLOCK_PARAM_LL(records, nrecords, recordnr, "fl.reqs", entry-= >flush_req); + QEMU_ADD_BLOCK_PARAM_LL(records, nrecords, recordnr, "fl.times", entry= ->flush_total_times); + + ret =3D 0; + cleanup: + return ret; +} + + static int qemuDomainGetStatsBlockExportHeader(virDomainDiskDefPtr disk, virStorageSourcePtr src, @@ -20195,6 +20211,10 @@ qemuDomainGetStatsBlockExportDisk(virDomainDiskDef= Ptr disk, records, nrecords) < 0) goto cleanup; + if (qemuDomainGetStatsBlockExportFrontend(alias, stats, *recordnr, + records, nrecords) < 0) + goto cleanup; + if (qemuDomainGetStatsOneBlock(driver, cfg, dom, records, nrecords, alias, src, *recordnr, stats) < 0) --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:13 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 153417615115249.506892998484545; Mon, 13 Aug 2018 09:02:31 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0F202E8B15; Mon, 13 Aug 2018 16:02:29 +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 C0A5D17A77; Mon, 13 Aug 2018 16:02:28 +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 677D518037F6; Mon, 13 Aug 2018 16:02:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG1KFI001981 for ; Mon, 13 Aug 2018 12:01:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0743D2166BA5; Mon, 13 Aug 2018 16:01:20 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 996202166BA0 for ; Mon, 13 Aug 2018 16:01:19 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:29 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 55/62] qemu: Refactor control flow in qemuDomainGetStatsBlockExportDisk 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 13 Aug 2018 16:02:29 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 479bf3adfe..e8e8bdbb14 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -20194,20 +20194,18 @@ qemuDomainGetStatsBlockExportDisk(virDomainDiskDe= fPtr disk, { char *alias =3D NULL; - virStorageSourcePtr src =3D disk->src; + virStorageSourcePtr n; int ret =3D -1; - while (virStorageSourceIsBacking(src) && - (src =3D=3D disk->src || visitBacking)) { - + for (n =3D disk->src; virStorageSourceIsBacking(n); n =3D n->backingSt= ore) { /* alias may be NULL if the VM is not running */ if (disk->info.alias && - !(alias =3D qemuDomainStorageAlias(disk->info.alias, src->id))) + !(alias =3D qemuDomainStorageAlias(disk->info.alias, n->id))) goto cleanup; - qemuDomainGetStatsOneBlockRefreshNamed(src, alias, stats, nodestat= s); + qemuDomainGetStatsOneBlockRefreshNamed(n, alias, stats, nodestats); - if (qemuDomainGetStatsBlockExportHeader(disk, src, *recordnr, + if (qemuDomainGetStatsBlockExportHeader(disk, n, *recordnr, records, nrecords) < 0) goto cleanup; @@ -20216,13 +20214,15 @@ qemuDomainGetStatsBlockExportDisk(virDomainDiskDe= fPtr disk, goto cleanup; if (qemuDomainGetStatsOneBlock(driver, cfg, dom, records, nrecords, - alias, src, *recordnr, + alias, n, *recordnr, stats) < 0) goto cleanup; VIR_FREE(alias); (*recordnr)++; - src =3D src->backingStore; + + if (!visitBacking) + break; } ret =3D 0; --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:13 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176156515587.5187499815706; Mon, 13 Aug 2018 09:02:36 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 42C5F80F95; Mon, 13 Aug 2018 16:02:34 +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 DCCF965978; Mon, 13 Aug 2018 16:02: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 7DCEE3F8F1; Mon, 13 Aug 2018 16:02:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG1K2e002012 for ; Mon, 13 Aug 2018 12:01:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id B69852166BA5; Mon, 13 Aug 2018 16:01:20 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5343E2166BA0 for ; Mon, 13 Aug 2018 16:01:20 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:30 +0200 Message-Id: <844f6ff299b4b3a85f6b7e70db41aa9e2a5b3dc6.1534173735.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 56/62] qemu: Report frontend stats only for the frontend entry 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 13 Aug 2018 16:02:35 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" When reporting stats for the backing chain some of them make sense only for the topmost entry as they are actually tied to the frontend device. We unfortunately can't change that fact, but we can stop reporting all zero stats for the backing chain members where they don't make any sense. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index e8e8bdbb14..c09108b57e 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -20209,9 +20209,12 @@ qemuDomainGetStatsBlockExportDisk(virDomainDiskDef= Ptr disk, records, nrecords) < 0) goto cleanup; - if (qemuDomainGetStatsBlockExportFrontend(alias, stats, *recordnr, - records, nrecords) < 0) - goto cleanup; + /* The following stats make sense only for the frontend device */ + if (n =3D=3D disk->src) { + if (qemuDomainGetStatsBlockExportFrontend(alias, stats, *recor= dnr, + records, nrecords) <= 0) + goto cleanup; + } if (qemuDomainGetStatsOneBlock(driver, cfg, dom, records, nrecords, alias, n, *recordnr, --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:13 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 153417617934145.344183816915574; Mon, 13 Aug 2018 09:02:59 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 341BA307C70B; Mon, 13 Aug 2018 16:02:57 +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 EB2883001A76; Mon, 13 Aug 2018 16:02:56 +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 945231800FED; Mon, 13 Aug 2018 16:02:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG1LaB002047 for ; Mon, 13 Aug 2018 12:01:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7509D2166BA5; Mon, 13 Aug 2018 16:01:21 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 10B3A2166BA0 for ; Mon, 13 Aug 2018 16:01:20 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:31 +0200 Message-Id: <9001aa9315d91678641dcaf78755c75668cec6ef.1534173735.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 57/62] qemu: Export stats relevant for the storage backend 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.84 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Mon, 13 Aug 2018 16:02:58 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Data relevant for the storage of a backing chain member will need to be reported separately when switching to blockdev. Prepare a function that extracts the appropriate data. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index c09108b57e..55bb8f71fe 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -20114,8 +20114,29 @@ qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver, } } + ret =3D 0; + cleanup: + return ret; +} + + +static int +qemuDomainGetStatsBlockExportBackendStorage(const char *entryname, + virHashTablePtr stats, + size_t recordnr, + virDomainStatsRecordPtr record= s, + int *nrecords) +{ + qemuBlockStats *entry; + int ret =3D -1; + + if (!stats || !entryname || !(entry =3D virHashLookup(stats, entryname= ))) { + ret =3D 0; + goto cleanup; + } + if (entry->write_threshold) - QEMU_ADD_BLOCK_PARAM_ULL(record, maxparams, block_idx, "threshold", + QEMU_ADD_BLOCK_PARAM_ULL(records, nrecords, recordnr, "threshold", entry->write_threshold); ret =3D 0; @@ -20221,6 +20242,11 @@ qemuDomainGetStatsBlockExportDisk(virDomainDiskDef= Ptr disk, stats) < 0) goto cleanup; + if (qemuDomainGetStatsBlockExportBackendStorage(alias, + stats, *recordnr, + records, nrecords)= < 0) + goto cleanup; + VIR_FREE(alias); (*recordnr)++; --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:13 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176161075741.4022172182767; Mon, 13 Aug 2018 09:02:41 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EE11C30A5696; Mon, 13 Aug 2018 16:02:38 +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 ADC012709D; Mon, 13 Aug 2018 16:02:38 +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 4B2173F7D2; Mon, 13 Aug 2018 16:02:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG1M90002082 for ; Mon, 13 Aug 2018 12:01:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2D03B2166BA5; Mon, 13 Aug 2018 16:01:22 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD5812166BA0 for ; Mon, 13 Aug 2018 16:01:21 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:32 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 58/62] qemu: monitor: Report data also for 'qdev' entry in qemuMonitorJSONGetBlockInfo 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Mon, 13 Aug 2018 16:02:39 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" With -blockdev qemu will not report any useful "device" for the data returned by 'query-block'. We need to start using the 'qdev' field to do so in cases when "device" is empty or it does not match the entry name. This patch adds data for the 'qdev' field into the returned data structure. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor_json.c | 69 +++++++++++++++++++++++++++++++++++-----= ---- 1 file changed, 55 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index f98269b34a..6f49de101f 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2209,6 +2209,38 @@ qemuMonitorJSONGetBlockDevDevice(virJSONValuePtr dev) } +static int +qemuMonitorJSONBlockInfoAdd(virHashTablePtr table, + struct qemuDomainDiskInfo *info, + const char *entryname) +{ + struct qemuDomainDiskInfo *tmp =3D NULL; + int ret =3D -1; + + if (VIR_ALLOC(tmp) < 0) + goto cleanup; + + *tmp =3D *info; + tmp->nodename =3D NULL; + + if (info->nodename && + VIR_STRDUP(tmp->nodename, info->nodename) < 0) + goto cleanup; + + if (virHashAddEntry(table, entryname, tmp) < 0) + goto cleanup; + + tmp =3D NULL; + ret =3D 0; + + cleanup: + if (tmp) + VIR_FREE(tmp->nodename); + VIR_FREE(tmp); + return ret; +} + + int qemuMonitorJSONGetBlockInfo(qemuMonitorPtr mon, virHashTablePtr table) { @@ -2223,10 +2255,10 @@ int qemuMonitorJSONGetBlockInfo(qemuMonitorPtr mon, for (i =3D 0; i < virJSONValueArraySize(devices); i++) { virJSONValuePtr dev; virJSONValuePtr image; - struct qemuDomainDiskInfo *info; + struct qemuDomainDiskInfo info =3D { false }; const char *thisdev; const char *status; - const char *nodename; + const char *qdev; if (!(dev =3D qemuMonitorJSONGetBlockDev(devices, i))) goto cleanup; @@ -2235,16 +2267,18 @@ int qemuMonitorJSONGetBlockInfo(qemuMonitorPtr mon, goto cleanup; thisdev =3D qemuAliasDiskDriveSkipPrefix(thisdev); + qdev =3D virJSONValueObjectGetString(dev, "qdev"); - if (VIR_ALLOC(info) < 0) - goto cleanup; + if (*thisdev =3D=3D '\0') + thisdev =3D NULL; - if (virHashAddEntry(table, thisdev, info) < 0) { - VIR_FREE(info); + if (!qdev && !thisdev) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("query-block device entry was not in expected= format")); goto cleanup; } - if (virJSONValueObjectGetBoolean(dev, "removable", &info->removabl= e) < 0) { + if (virJSONValueObjectGetBoolean(dev, "removable", &info.removable= ) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("cannot read %s value"), "removable"); @@ -2252,23 +2286,30 @@ int qemuMonitorJSONGetBlockInfo(qemuMonitorPtr mon, } /* 'tray_open' is present only if the device has a tray */ - if (virJSONValueObjectGetBoolean(dev, "tray_open", &info->tray_ope= n) =3D=3D 0) - info->tray =3D true; + if (virJSONValueObjectGetBoolean(dev, "tray_open", &info.tray_open= ) =3D=3D 0) + info.tray =3D true; /* presence of 'inserted' notifies that a medium is in the device = */ if ((image =3D virJSONValueObjectGetObject(dev, "inserted"))) { - if ((nodename =3D virJSONValueObjectGetString(image, "node-nam= e"))) - ignore_value(VIR_STRDUP(info->nodename, nodename)); + info.nodename =3D (char *) virJSONValueObjectGetString(image, = "node-name"); } else { - info->empty =3D true; + info.empty =3D true; } /* Missing io-status indicates no error */ if ((status =3D virJSONValueObjectGetString(dev, "io-status"))) { - info->io_status =3D qemuMonitorBlockIOStatusToError(status); - if (info->io_status < 0) + info.io_status =3D qemuMonitorBlockIOStatusToError(status); + if (info.io_status < 0) goto cleanup; } + + if (thisdev && + qemuMonitorJSONBlockInfoAdd(table, &info, thisdev) < 0) + goto cleanup; + + if (qdev && STRNEQ_NULLABLE(thisdev, qdev) && + qemuMonitorJSONBlockInfoAdd(table, &info, qdev) < 0) + goto cleanup; } ret =3D 0; --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:13 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176180319689.4913808199177; Mon, 13 Aug 2018 09:03:00 -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 5BD70300272A; Mon, 13 Aug 2018 16:02:58 +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 27F9B7A4CA; Mon, 13 Aug 2018 16:02:58 +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 CD70118037F2; Mon, 13 Aug 2018 16:02:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG1Mrk002116 for ; Mon, 13 Aug 2018 12:01:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id D001F2166BA5; Mon, 13 Aug 2018 16:01:22 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6DBDD2166BA0 for ; Mon, 13 Aug 2018 16:01:22 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:33 +0200 Message-Id: <75cf441679a13361be8a8f465289e5760b4dd124.1534173735.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 59/62] qemu: Use QOM path with query-block when using -blockdev 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.46]); Mon, 13 Aug 2018 16:02:59 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Switch to using the QOM/qdev handles in all calls to qemuMonitorGetBlockInfo when using -blockdev. The callers also need to make sure to use the correct handle afterwards to extract the data. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 9 ++++++++- src/qemu/qemu_process.c | 7 ++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 55bb8f71fe..a97235614b 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -18724,6 +18724,7 @@ qemuDomainGetDiskErrors(virDomainPtr dom, virDomainObjPtr vm =3D NULL; qemuDomainObjPrivatePtr priv; virHashTablePtr table =3D NULL; + bool blockdev =3D false; int ret =3D -1; size_t i; int n =3D 0; @@ -18734,6 +18735,7 @@ qemuDomainGetDiskErrors(virDomainPtr dom, goto cleanup; priv =3D vm->privateData; + blockdev =3D virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); if (virDomainGetDiskErrorsEnsureACL(dom->conn, vm->def) < 0) goto cleanup; @@ -18759,8 +18761,13 @@ qemuDomainGetDiskErrors(virDomainPtr dom, for (i =3D n =3D 0; i < vm->def->ndisks; i++) { struct qemuDomainDiskInfo *info; virDomainDiskDefPtr disk =3D vm->def->disks[i]; + qemuDomainDiskPrivatePtr diskPriv =3D QEMU_DOMAIN_DISK_PRIVATE(dis= k); + const char *entryname =3D disk->info.alias; + + if (blockdev) + entryname =3D diskPriv->backendQomName; - if ((info =3D virHashLookup(table, disk->info.alias)) && + if ((info =3D virHashLookup(table, entryname)) && info->io_status !=3D VIR_DOMAIN_DISK_ERROR_NONE) { if (n =3D=3D nerrors) break; diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 6e0b4b0027..15e7c951b6 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -7589,6 +7589,7 @@ qemuProcessRefreshDisks(virQEMUDriverPtr driver, qemuDomainAsyncJob asyncJob) { qemuDomainObjPrivatePtr priv =3D vm->privateData; + bool blockdev =3D virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); virHashTablePtr table =3D NULL; int ret =3D -1; size_t i; @@ -7606,8 +7607,12 @@ qemuProcessRefreshDisks(virQEMUDriverPtr driver, virDomainDiskDefPtr disk =3D vm->def->disks[i]; qemuDomainDiskPrivatePtr diskpriv =3D QEMU_DOMAIN_DISK_PRIVATE(dis= k); struct qemuDomainDiskInfo *info; + const char *entryname =3D disk->info.alias; + + if (blockdev) + entryname =3D diskpriv->backendQomName; - if (!(info =3D virHashLookup(table, disk->info.alias))) + if (!(info =3D virHashLookup(table, entryname))) continue; if (info->removable) { --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:13 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176166510467.2133457633888; Mon, 13 Aug 2018 09:02:46 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EFDDE85542; Mon, 13 Aug 2018 16:02:43 +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 B38A527095; Mon, 13 Aug 2018 16:02:43 +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 572043F67F; Mon, 13 Aug 2018 16:02:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG1NuE002151 for ; Mon, 13 Aug 2018 12:01:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7EAB82166BA5; Mon, 13 Aug 2018 16:01:23 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1C7FE2166BA0 for ; Mon, 13 Aug 2018 16:01:22 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:34 +0200 Message-Id: <63b0083983c1c4e7df2d24401a8a669b9fbaab32.1534173735.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 60/62] qemu: driver: Allow using blockdev with qemuDomainBlocksStatsGather 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 13 Aug 2018 16:02:45 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Use the 'qdev' instead of the disk alias to lookup the stats and transfer the capacity from the appropriate node name so that the function works with -blockdev. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 48 +++++++++++++++++++++++++++++++++++++---------= -- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index a97235614b..dfb06bed80 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -11063,11 +11063,13 @@ qemuDomainBlocksStatsGather(virQEMUDriverPtr driv= er, qemuBlockStatsPtr *retstats) { qemuDomainObjPrivatePtr priv =3D vm->privateData; - virDomainDiskDefPtr disk; + bool blockdev =3D virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); + virDomainDiskDefPtr disk =3D NULL; virHashTablePtr blockstats =3D NULL; qemuBlockStatsPtr stats; size_t i; int nstats; + int rc =3D 0; const char *entryname =3D NULL; int ret =3D -1; @@ -11077,23 +11079,30 @@ qemuDomainBlocksStatsGather(virQEMUDriverPtr driv= er, goto cleanup; } - if (!disk->info.alias) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("missing disk device alias name for %s"), dis= k->dst); - goto cleanup; - } + if (blockdev) { + entryname =3D QEMU_DOMAIN_DISK_PRIVATE(disk)->backendQomName; + } else { + if (!disk->info.alias) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("missing disk device alias name for %s"),= disk->dst); + goto cleanup; + } - entryname =3D disk->info.alias; + entryname =3D disk->info.alias; + } } qemuDomainObjEnterMonitor(driver, vm); nstats =3D qemuMonitorGetAllBlockStatsInfo(priv->mon, &blockstats, fal= se); - if (capacity && nstats >=3D 0 && - qemuMonitorBlockStatsUpdateCapacity(priv->mon, blockstats, false) = < 0) - nstats =3D -1; + if (capacity && nstats >=3D 0) { + if (blockdev) + rc =3D qemuMonitorBlockStatsUpdateCapacityBlockdev(priv->mon, = blockstats); + else + rc =3D qemuMonitorBlockStatsUpdateCapacity(priv->mon, blocksta= ts, false); + } - if (qemuDomainObjExitMonitor(driver, vm) < 0 || nstats < 0) + if (qemuDomainObjExitMonitor(driver, vm) < 0 || nstats < 0 || rc < 0) goto cleanup; if (VIR_ALLOC(*retstats) < 0) @@ -11106,12 +11115,29 @@ qemuDomainBlocksStatsGather(virQEMUDriverPtr driv= er, goto cleanup; } + if (blockdev) { + /* capacity are reported only per node-name so we need to tran= sfer them */ + qemuBlockStatsPtr capstats; + + if (disk && disk->src && + (capstats =3D virHashLookup(blockstats, disk->src->nodefor= mat))) { + (*retstats)->capacity =3D capstats->capacity; + (*retstats)->physical =3D capstats->physical; + (*retstats)->wr_highest_offset =3D capstats->wr_highest_of= fset; + (*retstats)->wr_highest_offset_valid =3D capstats->wr_high= est_offset_valid; + (*retstats)->write_threshold =3D capstats->write_threshold; + } + } + **retstats =3D *stats; } else { for (i =3D 0; i < vm->def->ndisks; i++) { disk =3D vm->def->disks[i]; entryname =3D disk->info.alias; + if (blockdev) + entryname =3D QEMU_DOMAIN_DISK_PRIVATE(disk)->backendQomNa= me; + if (!entryname) continue; --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:13 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176185055279.2796946891291; Mon, 13 Aug 2018 09:03:05 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 061333078AB6; Mon, 13 Aug 2018 16:03:03 +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 ACE773001A7F; Mon, 13 Aug 2018 16:03:02 +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 5E1E4181A386; Mon, 13 Aug 2018 16:03:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG1OuQ002201 for ; Mon, 13 Aug 2018 12:01:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id 39CB12166BA5; Mon, 13 Aug 2018 16:01:24 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id CAC532166BA0 for ; Mon, 13 Aug 2018 16:01:23 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:35 +0200 Message-Id: <9dd10d988b8e764a4bcf35f982cca3e3c35d2f64.1534173735.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 61/62] qemu: driver: Prepare qemuDomainGetStatsBlock (bulk disk stats) for -blockdev 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.84 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Mon, 13 Aug 2018 16:03:03 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Add code paths which call into the new functions to gather the data on a per-node-name basis and tweak the aliases used for extracting the data. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 54 +++++++++++++++++++++++++++++++++++-----------= ---- 1 file changed, 38 insertions(+), 16 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index dfb06bed80..059debb2f7 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -20244,20 +20244,34 @@ qemuDomainGetStatsBlockExportDisk(virDomainDiskDe= fPtr disk, bool visitBacking, virQEMUDriverPtr driver, virQEMUDriverConfigPtr cfg, - virDomainObjPtr dom) + virDomainObjPtr dom, + bool blockdev) { char *alias =3D NULL; virStorageSourcePtr n; + const char *frontendalias; + const char *backendalias; + const char *backendstoragealias; int ret =3D -1; for (n =3D disk->src; virStorageSourceIsBacking(n); n =3D n->backingSt= ore) { - /* alias may be NULL if the VM is not running */ - if (disk->info.alias && - !(alias =3D qemuDomainStorageAlias(disk->info.alias, n->id))) - goto cleanup; + if (blockdev) { + frontendalias =3D QEMU_DOMAIN_DISK_PRIVATE(disk)->backendQomNa= me; + backendalias =3D n->nodeformat; + backendstoragealias =3D n->nodestorage; + } else { + /* alias may be NULL if the VM is not running */ + if (disk->info.alias && + !(alias =3D qemuDomainStorageAlias(disk->info.alias, n->id= ))) + goto cleanup; + + qemuDomainGetStatsOneBlockRefreshNamed(n, alias, stats, nodest= ats); - qemuDomainGetStatsOneBlockRefreshNamed(n, alias, stats, nodestats); + frontendalias =3D alias; + backendalias =3D alias; + backendstoragealias =3D alias; + } if (qemuDomainGetStatsBlockExportHeader(disk, n, *recordnr, records, nrecords) < 0) @@ -20265,17 +20279,17 @@ qemuDomainGetStatsBlockExportDisk(virDomainDiskDe= fPtr disk, /* The following stats make sense only for the frontend device */ if (n =3D=3D disk->src) { - if (qemuDomainGetStatsBlockExportFrontend(alias, stats, *recor= dnr, + if (qemuDomainGetStatsBlockExportFrontend(frontendalias, stats= , *recordnr, records, nrecords) <= 0) goto cleanup; } if (qemuDomainGetStatsOneBlock(driver, cfg, dom, records, nrecords, - alias, n, *recordnr, + backendalias, n, *recordnr, stats) < 0) goto cleanup; - if (qemuDomainGetStatsBlockExportBackendStorage(alias, + if (qemuDomainGetStatsBlockExportBackendStorage(backendstoragealia= s, stats, *recordnr, records, nrecords)= < 0) goto cleanup; @@ -20310,19 +20324,26 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver, virJSONValuePtr nodedata =3D NULL; qemuDomainObjPrivatePtr priv =3D dom->privateData; virQEMUDriverConfigPtr cfg =3D virQEMUDriverGetConfig(driver); + bool blockdev =3D virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); bool fetchnodedata =3D virQEMUCapsGet(priv->qemuCaps, - QEMU_CAPS_QUERY_NAMED_BLOCK_NODES); + QEMU_CAPS_QUERY_NAMED_BLOCK_NODES)= && !blockdev; int count_index =3D -1; size_t visited =3D 0; bool visitBacking =3D !!(privflags & QEMU_DOMAIN_STATS_BACKING); if (HAVE_JOB(privflags) && virDomainObjIsActive(dom)) { qemuDomainObjEnterMonitor(driver, dom); - rc =3D qemuMonitorGetAllBlockStatsInfo(priv->mon, &stats, - visitBacking); - if (rc >=3D 0) - ignore_value(qemuMonitorBlockStatsUpdateCapacity(priv->mon, st= ats, - visitBacking)= ); + + rc =3D qemuMonitorGetAllBlockStatsInfo(priv->mon, &stats, visitBac= king); + + if (blockdev) { + if (rc >=3D 0) + rc =3D qemuMonitorBlockStatsUpdateCapacityBlockdev(priv->m= on, stats); + } else { + if (rc >=3D 0) + ignore_value(qemuMonitorBlockStatsUpdateCapacity(priv->mon= , stats, + visitBack= ing)); + } if (fetchnodedata) nodedata =3D qemuMonitorQueryNamedBlockNodes(priv->mon); @@ -20348,7 +20369,8 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver, for (i =3D 0; i < dom->def->ndisks; i++) { if (qemuDomainGetStatsBlockExportDisk(dom->def->disks[i], stats, n= odestats, record, maxparams, &visited, - visitBacking, driver, cfg, d= om) < 0) + visitBacking, driver, cfg, d= om, + blockdev) < 0) goto cleanup; } --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:40:13 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534176172694720.9599041581423; Mon, 13 Aug 2018 09:02:52 -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 8E560307C71B; Mon, 13 Aug 2018 16:02:49 +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 310256FEF2; Mon, 13 Aug 2018 16:02:49 +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 E755D24F57; Mon, 13 Aug 2018 16:02:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7DG1PPO002257 for ; Mon, 13 Aug 2018 12:01:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1201C2166BA5; Mon, 13 Aug 2018 16:01:25 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 836702166BA0 for ; Mon, 13 Aug 2018 16:01:24 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 13 Aug 2018 18:00:36 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 62/62] DO NOT APPLY: Enable QEMU_CAPS_BLOCKDEV if 'query-blockstats' works with -blockdev 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.42]); Mon, 13 Aug 2018 16:02:51 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 'query-blockstats' did not report the 'qdev' field prior to fixing it so that it works with our setup. Use that as a witness to enable -blockdev Note that the blockjobs were NOT adapted yet so any blockjob will desync the state of qemu. This patch needs to wait until blockjobs are fixed. --- src/qemu/qemu_capabilities.c | 1 + tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml | 1 + tests/qemuxml2argvdata/disk-aio.x86_64-latest.args | 19 ++- .../disk-backing-chains-noindex.x86_64-latest.args | 145 +++++++++++++++++= +--- .../qemuxml2argvdata/disk-cache.x86_64-latest.args | 50 ++++--- .../disk-cdrom-network.x86_64-latest.args | 32 +++-- .../disk-cdrom-tray.x86_64-latest.args | 24 ++-- .../qemuxml2argvdata/disk-cdrom.x86_64-latest.args | 17 ++- .../disk-copy_on_read.x86_64-latest.args | 19 ++- .../disk-detect-zeroes.x86_64-latest.args | 17 ++- .../disk-error-policy.x86_64-latest.args | 30 +++-- .../disk-floppy-q35-2_11.x86_64-latest.args | 14 +- .../disk-floppy-q35-2_9.x86_64-latest.args | 14 +- .../disk-floppy.x86_64-latest.args | 21 ++- .../disk-network-gluster.x86_64-latest.args | 32 +++-- .../disk-network-iscsi.x86_64-latest.args | 58 +++++---- .../disk-network-nbd.x86_64-latest.args | 41 ++++-- .../disk-network-rbd.x86_64-latest.args | 67 ++++++---- .../disk-network-sheepdog.x86_64-latest.args | 16 ++- .../disk-network-source-auth.x86_64-latest.args | 30 +++-- .../disk-network-tlsx509.x86_64-latest.args | 61 +++++---- .../disk-readonly-disk.x86_64-latest.args | 14 +- .../disk-shared.x86_64-latest.args | 18 ++- ...isk-virtio-scsi-reservations.x86_64-latest.args | 20 ++- .../floppy-drive-fat.x86_64-latest.args | 7 +- 25 files changed, 536 insertions(+), 232 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index f8c5967655..4de8b3a518 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1307,6 +1307,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsQMPSc= hemaQueries[] =3D { { "blockdev-add/arg-type/+qcow2/encrypt/+luks/key-secret", QEMU_CAPS_Q= COW2_LUKS }, { "nbd-server-start/arg-type/tls-creds", QEMU_CAPS_NBD_TLS }, { "screendump/arg-type/device", QEMU_CAPS_SCREENDUMP_DEVICE }, + { "query-blockstats/ret-type/qdev", QEMU_CAPS_BLOCKDEV }, }; typedef struct _virQEMUCapsObjectTypeProps virQEMUCapsObjectTypeProps; diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_3.0.0.x86_64.xml index 9f4cdfc540..281163af3d 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml @@ -215,6 +215,7 @@ + 2012093 0 427343 diff --git a/tests/qemuxml2argvdata/disk-aio.x86_64-latest.args b/tests/qem= uxml2argvdata/disk-aio.x86_64-latest.args index 3894ed2502..ae82ba52bd 100644 --- a/tests/qemuxml2argvdata/disk-aio.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-aio.x86_64-latest.args @@ -24,13 +24,20 @@ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ -no-acpi \ -boot strict=3Don \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ --drive file=3D/dev/HostVG/QEMUGuest1,format=3Dqcow2,if=3Dnone,id=3Ddrive-i= de0-0-0,\ -cache=3Dnone,aio=3Dnative \ --device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1,\ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1",\ +"aio":"native","node-name":"libvirt-2-storage","cache":{"direct":true,\ +"no-flush":false},"read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-2-format","read-only":false,\ +"cache":{"direct":true,"no-flush":false},"driver":"qcow2",\ +"file":"libvirt-2-storage"}' \ +-device ide-hd,bus=3Dide.0,unit=3D0,drive=3Dlibvirt-2-format,id=3Dide0-0-0= ,bootindex=3D1,\ write-cache=3Don \ --drive file=3D/dev/HostVG/QEMUGuest2,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-1-0,\ -readonly=3Don,aio=3Dthreads \ --device ide-cd,bus=3Dide.1,unit=3D0,drive=3Ddrive-ide0-1-0,id=3Dide0-1-0 \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest2",\ +"aio":"threads","node-name":"libvirt-1-storage","read-only":true,\ +"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":true,"driver":"raw"= ,\ +"file":"libvirt-1-storage"}' \ +-device ide-cd,bus=3Dide.1,unit=3D0,drive=3Dlibvirt-1-format,id=3Dide0-1-0= \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ resourcecontrol=3Ddeny \ diff --git a/tests/qemuxml2argvdata/disk-backing-chains-noindex.x86_64-late= st.args b/tests/qemuxml2argvdata/disk-backing-chains-noindex.x86_64-latest.= args index afe078adcc..11d805f3d8 100644 --- a/tests/qemuxml2argvdata/disk-backing-chains-noindex.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-backing-chains-noindex.x86_64-latest.args @@ -24,33 +24,138 @@ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ -no-acpi \ -boot strict=3Don \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ --drive 'file=3Dgluster+unix:///Volume2/Image?socket=3D/path/to/sock,file.d= ebug=3D4,\ -format=3Dqcow2,if=3Dnone,id=3Ddrive-virtio-disk0' \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x2,drive=3Ddrive-vir= tio-disk0,\ +-blockdev '{"driver":"file","filename":"/tmp/missing-backing-store.qcow",\ +"node-name":"libvirt-25-storage","read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-25-format","read-only":true,"driver":"qco= w2",\ +"file":"libvirt-25-storage"}' \ +-blockdev '{"driver":"gluster","volume":"Volume2","path":"Image",\ +"server":[{"type":"unix","path":"/path/to/sock"}],"debug":4,\ +"node-name":"libvirt-24-storage","read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-24-format","read-only":false,"driver":"qc= ow2",\ +"file":"libvirt-24-storage","backing":"libvirt-25-format"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x2,drive=3Dlibvirt-2= 4-format,\ id=3Dvirtio-disk0,bootindex=3D1 \ --drive file=3Dnbd:unix:/var/run/nbdsock:exportname=3Dbar,format=3Dqcow2,if= =3Dnone,\ -id=3Ddrive-virtio-disk1 \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x3,drive=3Ddrive-vir= tio-disk1,\ +-blockdev '{"driver":"file","filename":"/tmp/Fedora-17-x86_64-Live-KDE.iso= ",\ +"node-name":"libvirt-23-storage","read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-23-format","read-only":true,"driver":"raw= ",\ +"file":"libvirt-23-storage"}' \ +-blockdev '{"driver":"file","filename":"/tmp/image5.qcow",\ +"node-name":"libvirt-22-storage","read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-22-format","read-only":true,"driver":"qco= w2",\ +"file":"libvirt-22-storage","backing":"libvirt-23-format"}' \ +-blockdev '{"driver":"file","filename":"/tmp/image4.qcow",\ +"node-name":"libvirt-21-storage","read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-21-format","read-only":true,"driver":"qco= w2",\ +"file":"libvirt-21-storage","backing":"libvirt-22-format"}' \ +-blockdev '{"driver":"file","filename":"/tmp/image3.qcow",\ +"node-name":"libvirt-20-storage","read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-20-format","read-only":true,"driver":"qco= w2",\ +"file":"libvirt-20-storage","backing":"libvirt-21-format"}' \ +-blockdev '{"driver":"file","filename":"/tmp/image2",\ +"node-name":"libvirt-19-storage","read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-19-format","read-only":true,"driver":"vmd= k",\ +"file":"libvirt-19-storage","backing":"libvirt-20-format"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1",\ +"node-name":"libvirt-18-storage","read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-18-format","read-only":true,"driver":"qco= w2",\ +"file":"libvirt-18-storage","backing":"libvirt-19-format"}' \ +-blockdev '{"driver":"nbd","server":{"type":"unix","path":"/var/run/nbdsoc= k"},\ +"export":"bar","node-name":"libvirt-17-storage","read-only":false,\ +"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-17-format","read-only":false,"driver":"qc= ow2",\ +"file":"libvirt-17-storage","backing":"libvirt-18-format"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x3,drive=3Dlibvirt-1= 7-format,\ id=3Dvirtio-disk1 \ --drive file=3Dgluster://example.org:6000/Volume1/Image,file.debug=3D4,form= at=3Draw,\ -if=3Dnone,id=3Ddrive-virtio-disk2 \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x4,drive=3Ddrive-vir= tio-disk2,\ +-blockdev '{"driver":"gluster","volume":"Volume1","path":"Image",\ +"server":[{"type":"inet","host":"example.org","port":"6000"}],"debug":4,\ +"node-name":"libvirt-16-storage","read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-16-format","read-only":false,"driver":"ra= w",\ +"file":"libvirt-16-storage"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x4,drive=3Dlibvirt-1= 6-format,\ id=3Dvirtio-disk2 \ --object secret,id=3Dvirtio-disk3-secret0,\ +-blockdev '{"driver":"file","filename":"/tmp/image.qcow",\ +"node-name":"libvirt-15-storage","read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-15-format","read-only":true,"driver":"qco= w2",\ +"file":"libvirt-15-storage","backing":null}' \ +-object secret,id=3Dlibvirt-14-storage-secret0,\ data=3D9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\ keyid=3DmasterKey0,iv=3DAAECAwQFBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ --drive 'file=3Drbd:pool/image:id=3Dmyname:auth_supported=3Dcephx\;none:\ -mon_host=3Dmon1.example.org\:6321\;mon2.example.org\:6322\;mon3.example.or= g\:\ -6322,file.password-secret=3Dvirtio-disk3-secret0,format=3Dqcow2,if=3Dnone,\ -id=3Ddrive-virtio-disk3' \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x5,drive=3Ddrive-vir= tio-disk3,\ +-blockdev '{"driver":"rbd","pool":"pool","image":"image",\ +"server":[{"host":"mon1.example.org","port":"6321"},{"host":"mon2.example.= org",\ +"port":"6322"},{"host":"mon3.example.org","port":"6322"}],"user":"myname",\ +"auth-client-required":["cephx","none"],\ +"key-secret":"libvirt-14-storage-secret0","node-name":"libvirt-14-storage"= ,\ +"read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-14-format","read-only":false,"driver":"qc= ow2",\ +"file":"libvirt-14-storage","backing":"libvirt-15-format"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x5,drive=3Dlibvirt-1= 4-format,\ id=3Dvirtio-disk3 \ --drive file=3D/dev/HostVG/QEMUGuest11,format=3Dqcow2,if=3Dnone,id=3Ddrive-= virtio-disk4 \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x6,drive=3Ddrive-vir= tio-disk4,\ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest11",\ +"node-name":"libvirt-13-storage","read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-13-format","read-only":false,"driver":"qc= ow2",\ +"file":"libvirt-13-storage"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x6,drive=3Dlibvirt-1= 3-format,\ id=3Dvirtio-disk4 \ --drive file=3D/var/lib/libvirt/images/rhel7.1484071880,format=3Dqcow2,if= =3Dnone,\ -id=3Ddrive-virtio-disk5 \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x7,drive=3Ddrive-vir= tio-disk5,\ +-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/rhel7.qcow= 2",\ +"node-name":"libvirt-12-storage","read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-12-format","read-only":true,"driver":"qco= w2",\ +"file":"libvirt-12-storage","backing":null}' \ +-blockdev '{"driver":"file",\ +"filename":"/var/lib/libvirt/images/rhel7.1483536402",\ +"node-name":"libvirt-11-storage","read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-11-format","read-only":true,"driver":"qco= w2",\ +"file":"libvirt-11-storage","backing":"libvirt-12-format"}' \ +-blockdev '{"driver":"file",\ +"filename":"/var/lib/libvirt/images/rhel7.1483545313",\ +"node-name":"libvirt-10-storage","read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-10-format","read-only":true,"driver":"qco= w2",\ +"file":"libvirt-10-storage","backing":"libvirt-11-format"}' \ +-blockdev '{"driver":"file",\ +"filename":"/var/lib/libvirt/images/rhel7.1483545901",\ +"node-name":"libvirt-9-storage","read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-9-format","read-only":true,"driver":"qcow= 2",\ +"file":"libvirt-9-storage","backing":"libvirt-10-format"}' \ +-blockdev '{"driver":"file",\ +"filename":"/var/lib/libvirt/images/rhel7.1483546244",\ +"node-name":"libvirt-8-storage","read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-8-format","read-only":true,"driver":"qcow= 2",\ +"file":"libvirt-8-storage","backing":"libvirt-9-format"}' \ +-blockdev '{"driver":"file",\ +"filename":"/var/lib/libvirt/images/rhel7.1483605920",\ +"node-name":"libvirt-7-storage","read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-7-format","read-only":true,"driver":"qcow= 2",\ +"file":"libvirt-7-storage","backing":"libvirt-8-format"}' \ +-blockdev '{"driver":"file",\ +"filename":"/var/lib/libvirt/images/rhel7.1483605924",\ +"node-name":"libvirt-6-storage","read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-6-format","read-only":true,"driver":"qcow= 2",\ +"file":"libvirt-6-storage","backing":"libvirt-7-format"}' \ +-blockdev '{"driver":"file",\ +"filename":"/var/lib/libvirt/images/rhel7.1483615252",\ +"node-name":"libvirt-5-storage","read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-5-format","read-only":true,"driver":"qcow= 2",\ +"file":"libvirt-5-storage","backing":"libvirt-6-format"}' \ +-blockdev '{"driver":"file",\ +"filename":"/var/lib/libvirt/images/rhel7.1484071872",\ +"node-name":"libvirt-4-storage","read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-4-format","read-only":true,"driver":"qcow= 2",\ +"file":"libvirt-4-storage","backing":"libvirt-5-format"}' \ +-blockdev '{"driver":"file",\ +"filename":"/var/lib/libvirt/images/rhel7.1484071876",\ +"node-name":"libvirt-3-storage","read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-3-format","read-only":true,"driver":"qcow= 2",\ +"file":"libvirt-3-storage","backing":"libvirt-4-format"}' \ +-blockdev '{"driver":"file",\ +"filename":"/var/lib/libvirt/images/rhel7.1484071877",\ +"node-name":"libvirt-2-storage","read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-2-format","read-only":true,"driver":"qcow= 2",\ +"file":"libvirt-2-storage","backing":"libvirt-3-format"}' \ +-blockdev '{"driver":"file",\ +"filename":"/var/lib/libvirt/images/rhel7.1484071880",\ +"node-name":"libvirt-1-storage","read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"qco= w2",\ +"file":"libvirt-1-storage","backing":"libvirt-2-format"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x7,drive=3Dlibvirt-1= -format,\ id=3Dvirtio-disk5 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x8 \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ diff --git a/tests/qemuxml2argvdata/disk-cache.x86_64-latest.args b/tests/q= emuxml2argvdata/disk-cache.x86_64-latest.args index 9220e6bee9..95824b50a0 100644 --- a/tests/qemuxml2argvdata/disk-cache.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-cache.x86_64-latest.args @@ -25,25 +25,45 @@ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ -boot strict=3Don \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ -device lsi,id=3Dscsi0,bus=3Dpci.0,addr=3D0x2 \ --drive file=3D/dev/HostVG/QEMUGuest1,format=3Dqcow2,if=3Dnone,id=3Ddrive-i= de0-0-0,\ -cache=3Dwriteback \ --device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1,\ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1",\ +"node-name":"libvirt-5-storage","cache":{"direct":false,"no-flush":false},\ +"read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-5-format","read-only":false,\ +"cache":{"direct":false,"no-flush":false},"driver":"qcow2",\ +"file":"libvirt-5-storage"}' \ +-device ide-hd,bus=3Dide.0,unit=3D0,drive=3Dlibvirt-5-format,id=3Dide0-0-0= ,bootindex=3D1,\ write-cache=3Don \ --drive file=3D/dev/HostVG/QEMUGuest1,format=3Dqcow2,if=3Dnone,id=3Ddrive-i= de0-0-1,\ -cache=3Dunsafe \ --device ide-hd,bus=3Dide.0,unit=3D1,drive=3Ddrive-ide0-0-1,id=3Dide0-0-1,\ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1",\ +"node-name":"libvirt-4-storage","cache":{"direct":false,"no-flush":true},\ +"read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-4-format","read-only":false,\ +"cache":{"direct":false,"no-flush":true},"driver":"qcow2",\ +"file":"libvirt-4-storage"}' \ +-device ide-hd,bus=3Dide.0,unit=3D1,drive=3Dlibvirt-4-format,id=3Dide0-0-1= ,\ write-cache=3Don \ --drive file=3D/dev/HostVG/QEMUGuest1,format=3Dqcow2,if=3Dnone,id=3Ddrive-s= csi0-0-0,\ -cache=3Dnone \ --device scsi-hd,bus=3Dscsi0.0,scsi-id=3D0,drive=3Ddrive-scsi0-0-0,id=3Dscs= i0-0-0,\ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1",\ +"node-name":"libvirt-3-storage","cache":{"direct":true,"no-flush":false},\ +"read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-3-format","read-only":false,\ +"cache":{"direct":true,"no-flush":false},"driver":"qcow2",\ +"file":"libvirt-3-storage"}' \ +-device scsi-hd,bus=3Dscsi0.0,scsi-id=3D0,drive=3Dlibvirt-3-format,id=3Dsc= si0-0-0,\ write-cache=3Don \ --drive file=3D/dev/HostVG/QEMUGuest1,format=3Dqcow2,if=3Dnone,id=3Ddrive-v= irtio-disk0,\ -cache=3Dwritethrough \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x3,drive=3Ddrive-vir= tio-disk0,\ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1",\ +"node-name":"libvirt-2-storage","cache":{"direct":false,"no-flush":false},\ +"read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-2-format","read-only":false,\ +"cache":{"direct":false,"no-flush":false},"driver":"qcow2",\ +"file":"libvirt-2-storage"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x3,drive=3Dlibvirt-2= -format,\ id=3Dvirtio-disk0,write-cache=3Doff \ --drive file=3D/dev/HostVG/QEMUGuest1,format=3Dqcow2,if=3Dnone,id=3Ddrive-u= sb-disk1,\ -cache=3Ddirectsync \ --device usb-storage,bus=3Dusb.0,port=3D1,drive=3Ddrive-usb-disk1,id=3Dusb-= disk1,\ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1",\ +"node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},\ +"read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":false,\ +"cache":{"direct":true,"no-flush":false},"driver":"qcow2",\ +"file":"libvirt-1-storage"}' \ +-device usb-storage,bus=3Dusb.0,port=3D1,drive=3Dlibvirt-1-format,id=3Dusb= -disk1,\ removable=3Doff,write-cache=3Doff \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ resourcecontrol=3Ddeny \ diff --git a/tests/qemuxml2argvdata/disk-cdrom-network.x86_64-latest.args b= /tests/qemuxml2argvdata/disk-cdrom-network.x86_64-latest.args index 0ce8497840..493ab91188 100644 --- a/tests/qemuxml2argvdata/disk-cdrom-network.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-cdrom-network.x86_64-latest.args @@ -23,18 +23,26 @@ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ -no-shutdown \ -boot strict=3Don \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ --drive file=3Dftp://host.name:21/url/path/file.iso,format=3Draw,if=3Dnone,\ -id=3Ddrive-ide0-0-0,readonly=3Don \ --device ide-cd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ --drive file=3Dftps://host.name:990/url/path/file.iso,format=3Draw,if=3Dnon= e,\ -id=3Ddrive-ide0-0-1,readonly=3Don \ --device ide-cd,bus=3Dide.0,unit=3D1,drive=3Ddrive-ide0-0-1,id=3Dide0-0-1 \ --drive file=3Dhttps://host.name:443/url/path/file.iso,format=3Draw,if=3Dno= ne,\ -id=3Ddrive-ide0-1-0,readonly=3Don \ --device ide-cd,bus=3Dide.1,unit=3D0,drive=3Ddrive-ide0-1-0,id=3Dide0-1-0 \ --drive file=3Dtftp://host.name:69/url/path/file.iso,format=3Draw,if=3Dnone= ,\ -id=3Ddrive-ide0-1-1,readonly=3Don \ --device ide-cd,bus=3Dide.1,unit=3D1,drive=3Ddrive-ide0-1-1,id=3Dide0-1-1 \ +-blockdev '{"driver":"ftp","url":"ftp://host.name:21/url/path/file.iso",\ +"node-name":"libvirt-4-storage","read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-4-format","read-only":true,"driver":"raw"= ,\ +"file":"libvirt-4-storage"}' \ +-device ide-cd,bus=3Dide.0,unit=3D0,drive=3Dlibvirt-4-format,id=3Dide0-0-0= ,bootindex=3D1 \ +-blockdev '{"driver":"ftps","url":"ftps://host.name:990/url/path/file.iso"= ,\ +"node-name":"libvirt-3-storage","read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-3-format","read-only":true,"driver":"raw"= ,\ +"file":"libvirt-3-storage"}' \ +-device ide-cd,bus=3Dide.0,unit=3D1,drive=3Dlibvirt-3-format,id=3Dide0-0-1= \ +-blockdev '{"driver":"https","url":"https://host.name:443/url/path/file.is= o",\ +"node-name":"libvirt-2-storage","read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-2-format","read-only":true,"driver":"raw"= ,\ +"file":"libvirt-2-storage"}' \ +-device ide-cd,bus=3Dide.1,unit=3D0,drive=3Dlibvirt-2-format,id=3Dide0-1-0= \ +-blockdev '{"driver":"tftp","url":"tftp://host.name:69/url/path/file.iso",\ +"node-name":"libvirt-1-storage","read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":true,"driver":"raw"= ,\ +"file":"libvirt-1-storage"}' \ +-device ide-cd,bus=3Dide.1,unit=3D1,drive=3Dlibvirt-1-format,id=3Dide0-1-1= \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ resourcecontrol=3Ddeny \ diff --git a/tests/qemuxml2argvdata/disk-cdrom-tray.x86_64-latest.args b/te= sts/qemuxml2argvdata/disk-cdrom-tray.x86_64-latest.args index 79863e456d..8f6df4d5d4 100644 --- a/tests/qemuxml2argvdata/disk-cdrom-tray.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-cdrom-tray.x86_64-latest.args @@ -24,15 +24,23 @@ file=3D/tmp/lib/domain--1-test/master-key.aes \ -no-acpi \ -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 \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x4,drive=3Ddrive-vir= tio-disk0,\ +-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/f14.img",\ +"node-name":"libvirt-3-storage","read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-3-format","read-only":false,"driver":"qco= w2",\ +"file":"libvirt-3-storage"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x4,drive=3Dlibvirt-3= -format,\ 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 \ --device ide-cd,bus=3Dide.1,unit=3D0,drive=3Ddrive-ide0-1-0,id=3Dide0-1-0,b= ootindex=3D1 \ --drive if=3Dnone,id=3Ddrive-ide0-1-1,readonly=3Don \ --device ide-cd,bus=3Dide.1,unit=3D1,drive=3Ddrive-ide0-1-1,id=3Dide0-1-1 \ +-blockdev '{"driver":"file",\ +"filename":"/var/lib/libvirt/Fedora-14-x86_64-Live-KDE.iso",\ +"node-name":"libvirt-2-storage","read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-2-format","read-only":true,"driver":"raw"= ,\ +"file":"libvirt-2-storage"}' \ +-device ide-cd,bus=3Dide.1,unit=3D0,drive=3Dlibvirt-2-format,id=3Dide0-1-0= ,bootindex=3D1 \ +-blockdev '{"driver":"file","filename":"/tmp/cdrom.img",\ +"node-name":"libvirt-1-storage","read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":true,"driver":"raw"= ,\ +"file":"libvirt-1-storage"}' \ +-device ide-cd,bus=3Dide.1,unit=3D1,drive=3Dlibvirt-1-format,id=3Dide0-1-1= \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ resourcecontrol=3Ddeny \ diff --git a/tests/qemuxml2argvdata/disk-cdrom.x86_64-latest.args b/tests/q= emuxml2argvdata/disk-cdrom.x86_64-latest.args index 4c5a599820..fbdc53a022 100644 --- a/tests/qemuxml2argvdata/disk-cdrom.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-cdrom.x86_64-latest.args @@ -24,12 +24,17 @@ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ -no-acpi \ -boot strict=3Don \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ --drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ --device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ --drive file=3D/root/boot.iso,format=3Draw,if=3Dnone,id=3Ddrive-ide0-1-0,re= adonly=3Don \ --device ide-cd,bus=3Dide.1,unit=3D0,drive=3Ddrive-ide0-1-0,id=3Dide0-1-0 \ --drive if=3Dnone,id=3Ddrive-ide0-1-1,readonly=3Don \ --device ide-cd,bus=3Dide.1,unit=3D1,drive=3Ddrive-ide0-1-1,id=3Dide0-1-1 \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1",\ +"node-name":"libvirt-3-storage","read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-3-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-3-storage"}' \ +-device ide-hd,bus=3Dide.0,unit=3D0,drive=3Dlibvirt-3-format,id=3Dide0-0-0= ,bootindex=3D1 \ +-blockdev '{"driver":"file","filename":"/root/boot.iso",\ +"node-name":"libvirt-2-storage","read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-2-format","read-only":true,"driver":"raw"= ,\ +"file":"libvirt-2-storage"}' \ +-device ide-cd,bus=3Dide.1,unit=3D0,drive=3Dlibvirt-2-format,id=3Dide0-1-0= \ +-device ide-cd,bus=3Dide.1,unit=3D1,id=3Dide0-1-1 \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ resourcecontrol=3Ddeny \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/disk-copy_on_read.x86_64-latest.args b/= tests/qemuxml2argvdata/disk-copy_on_read.x86_64-latest.args index f2b5dbe050..36dccbbb17 100644 --- a/tests/qemuxml2argvdata/disk-copy_on_read.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-copy_on_read.x86_64-latest.args @@ -25,13 +25,20 @@ file=3D/tmp/lib/domain--1-test/master-key.aes \ -boot menu=3Don,strict=3Don \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ -device virtio-serial-pci,id=3Dvirtio-serial0,bus=3Dpci.0,addr=3D0x6 \ --drive file=3D/var/lib/libvirt/images/f14.img,format=3Dqcow2,if=3Dnone,\ -id=3Ddrive-virtio-disk0,copy-on-read=3Don \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x4,drive=3Ddrive-vir= tio-disk0,\ +-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/f14.img",\ +"node-name":"libvirt-2-storage","read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-2-format","read-only":false,"driver":"qco= w2",\ +"file":"libvirt-2-storage"}' \ +-blockdev '{"driver":"copy-on-read","node-name":"libvirt-CoR-vda",\ +"file":"libvirt-2-format"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x4,drive=3Dlibvirt-C= oR-vda,\ 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 \ --device ide-cd,bus=3Dide.1,unit=3D0,drive=3Ddrive-ide0-1-0,id=3Dide0-1-0,b= ootindex=3D1 \ +-blockdev '{"driver":"file",\ +"filename":"/var/lib/libvirt/Fedora-14-x86_64-Live-KDE.iso",\ +"node-name":"libvirt-1-storage","read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":true,"driver":"raw"= ,\ +"file":"libvirt-1-storage"}' \ +-device ide-cd,bus=3Dide.1,unit=3D0,drive=3Dlibvirt-1-format,id=3Dide0-1-0= ,bootindex=3D1 \ -netdev user,id=3Dhostnet0 \ -device virtio-net-pci,tx=3Dbh,netdev=3Dhostnet0,id=3Dnet0,mac=3D52:54:00:= e5:48:58,\ bus=3Dpci.0,addr=3D0x2 \ diff --git a/tests/qemuxml2argvdata/disk-detect-zeroes.x86_64-latest.args b= /tests/qemuxml2argvdata/disk-detect-zeroes.x86_64-latest.args index 101c0f2e65..79d10d206a 100644 --- a/tests/qemuxml2argvdata/disk-detect-zeroes.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-detect-zeroes.x86_64-latest.args @@ -24,13 +24,18 @@ file=3D/tmp/lib/domain--1-test/master-key.aes \ -no-acpi \ -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,detect-zeroes=3Dunmap \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x4,drive=3Ddrive-vir= tio-disk0,\ +-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/f14.img",\ +"node-name":"libvirt-2-storage","read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-2-format","read-only":false,"discard":"un= map",\ +"detect-zeroes":"unmap","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 \ --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,detect-zeroes=3Don \ --device ide-cd,bus=3Dide.1,unit=3D0,drive=3Ddrive-ide0-1-0,id=3Dide0-1-0,b= ootindex=3D1 \ +-blockdev '{"driver":"file",\ +"filename":"/var/lib/libvirt/Fedora-14-x86_64-Live-KDE.iso",\ +"node-name":"libvirt-1-storage","read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":true,"discard":"ign= ore",\ +"detect-zeroes":"on","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=3D0x3 \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ resourcecontrol=3Ddeny \ diff --git a/tests/qemuxml2argvdata/disk-error-policy.x86_64-latest.args b/= tests/qemuxml2argvdata/disk-error-policy.x86_64-latest.args index e8fa9e2452..227f3fa036 100644 --- a/tests/qemuxml2argvdata/disk-error-policy.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-error-policy.x86_64-latest.args @@ -24,17 +24,29 @@ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ -no-acpi \ -boot strict=3Don \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ --drive file=3D/dev/HostVG/QEMUGuest1,format=3Dqcow2,if=3Dnone,id=3Ddrive-i= de0-0-0,\ -cache=3Dnone \ --device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1,\ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1",\ +"node-name":"libvirt-3-storage","cache":{"direct":true,"no-flush":false},\ +"read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-3-format","read-only":false,\ +"cache":{"direct":true,"no-flush":false},"driver":"qcow2",\ +"file":"libvirt-3-storage"}' \ +-device ide-hd,bus=3Dide.0,unit=3D0,drive=3Dlibvirt-3-format,id=3Dide0-0-0= ,bootindex=3D1,\ write-cache=3Don,werror=3Dstop,rerror=3Dstop \ --drive file=3D/dev/HostVG/QEMUGuest2,format=3Dqcow2,if=3Dnone,id=3Ddrive-i= de0-0-1,\ -cache=3Dnone \ --device ide-hd,bus=3Dide.0,unit=3D1,drive=3Ddrive-ide0-0-1,id=3Dide0-0-1,\ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest2",\ +"node-name":"libvirt-2-storage","cache":{"direct":true,"no-flush":false},\ +"read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-2-format","read-only":false,\ +"cache":{"direct":true,"no-flush":false},"driver":"qcow2",\ +"file":"libvirt-2-storage"}' \ +-device ide-hd,bus=3Dide.0,unit=3D1,drive=3Dlibvirt-2-format,id=3Dide0-0-1= ,\ write-cache=3Don,werror=3Denospc \ --drive file=3D/dev/HostVG/QEMUGuest3,format=3Dqcow2,if=3Dnone,id=3Ddrive-i= de0-1-0,\ -cache=3Dnone \ --device ide-hd,bus=3Dide.1,unit=3D0,drive=3Ddrive-ide0-1-0,id=3Dide0-1-0,\ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest3",\ +"node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},\ +"read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":false,\ +"cache":{"direct":true,"no-flush":false},"driver":"qcow2",\ +"file":"libvirt-1-storage"}' \ +-device ide-hd,bus=3Dide.1,unit=3D0,drive=3Dlibvirt-1-format,id=3Dide0-1-0= ,\ write-cache=3Don,werror=3Dreport,rerror=3Dignore \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ resourcecontrol=3Ddeny \ diff --git a/tests/qemuxml2argvdata/disk-floppy-q35-2_11.x86_64-latest.args= b/tests/qemuxml2argvdata/disk-floppy-q35-2_11.x86_64-latest.args index 17abe9a989..24d199d3b8 100644 --- a/tests/qemuxml2argvdata/disk-floppy-q35-2_11.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-floppy-q35-2_11.x86_64-latest.args @@ -27,9 +27,17 @@ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ addr=3D0x1 \ -device pcie-root-port,port=3D0x9,chassis=3D2,id=3Dpci.2,bus=3Dpcie.0,addr= =3D0x1.0x1 \ -device qemu-xhci,id=3Dusb,bus=3Dpci.1,addr=3D0x0 \ --drive file=3D/tmp/firmware.img,format=3Draw,if=3Dnone,id=3Ddrive-fdc0-0-0= \ --drive file=3D/tmp/data.img,format=3Dqcow2,if=3Dnone,id=3Ddrive-fdc0-0-1 \ --device isa-fdc,driveA=3Ddrive-fdc0-0-0,bootindexA=3D1,driveB=3Ddrive-fdc0= -0-1 \ +-device isa-fdc,bootindexA=3D1 \ +-blockdev '{"driver":"file","filename":"/tmp/firmware.img",\ +"node-name":"libvirt-2-storage","read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-2-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-2-storage"}' \ +-device floppy,unit=3D0,drive=3Dlibvirt-2-format,id=3Dfdc0-0-0 \ +-blockdev '{"driver":"file","filename":"/tmp/data.img",\ +"node-name":"libvirt-1-storage","read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"qco= w2",\ +"file":"libvirt-1-storage"}' \ +-device floppy,unit=3D1,drive=3Dlibvirt-1-format,id=3Dfdc0-0-1 \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ resourcecontrol=3Ddeny \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/disk-floppy-q35-2_9.x86_64-latest.args = b/tests/qemuxml2argvdata/disk-floppy-q35-2_9.x86_64-latest.args index e4ece864fe..bc8a44ba38 100644 --- a/tests/qemuxml2argvdata/disk-floppy-q35-2_9.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-floppy-q35-2_9.x86_64-latest.args @@ -27,9 +27,17 @@ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ addr=3D0x1 \ -device pcie-root-port,port=3D0x9,chassis=3D2,id=3Dpci.2,bus=3Dpcie.0,addr= =3D0x1.0x1 \ -device qemu-xhci,id=3Dusb,bus=3Dpci.1,addr=3D0x0 \ --drive file=3D/tmp/firmware.img,format=3Draw,if=3Dnone,id=3Ddrive-fdc0-0-0= \ --drive file=3D/tmp/data.img,format=3Dqcow2,if=3Dnone,id=3Ddrive-fdc0-0-1 \ --device isa-fdc,driveA=3Ddrive-fdc0-0-0,bootindexA=3D1,driveB=3Ddrive-fdc0= -0-1 \ +-device isa-fdc,bootindexA=3D1 \ +-blockdev '{"driver":"file","filename":"/tmp/firmware.img",\ +"node-name":"libvirt-2-storage","read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-2-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-2-storage"}' \ +-device floppy,unit=3D0,drive=3Dlibvirt-2-format,id=3Dfdc0-0-0 \ +-blockdev '{"driver":"file","filename":"/tmp/data.img",\ +"node-name":"libvirt-1-storage","read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"qco= w2",\ +"file":"libvirt-1-storage"}' \ +-device floppy,unit=3D1,drive=3Dlibvirt-1-format,id=3Dfdc0-0-1 \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ resourcecontrol=3Ddeny \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/disk-floppy.x86_64-latest.args b/tests/= qemuxml2argvdata/disk-floppy.x86_64-latest.args index 8f10c980c9..4bac566f15 100644 --- a/tests/qemuxml2argvdata/disk-floppy.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-floppy.x86_64-latest.args @@ -24,12 +24,21 @@ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ -no-acpi \ -boot strict=3Don \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ --drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ --device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ --drive file=3D/dev/fd0,format=3Draw,if=3Dnone,id=3Ddrive-fdc0-0-0 \ --drive file=3D/tmp/firmware.img,format=3Draw,if=3Dnone,id=3Ddrive-fdc0-0-1= \ --global isa-fdc.driveA=3Ddrive-fdc0-0-0 \ --global isa-fdc.driveB=3Ddrive-fdc0-0-1 \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1",\ +"node-name":"libvirt-3-storage","read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-3-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-3-storage"}' \ +-device ide-hd,bus=3Dide.0,unit=3D0,drive=3Dlibvirt-3-format,id=3Dide0-0-0= ,bootindex=3D1 \ +-blockdev '{"driver":"host_device","filename":"/dev/fd0",\ +"node-name":"libvirt-2-storage","read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-2-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-2-storage"}' \ +-device floppy,unit=3D0,drive=3Dlibvirt-2-format,id=3Dfdc0-0-0 \ +-blockdev '{"driver":"file","filename":"/tmp/firmware.img",\ +"node-name":"libvirt-1-storage","read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-1-storage"}' \ +-device floppy,unit=3D1,drive=3Dlibvirt-1-format,id=3Dfdc0-0-1 \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ resourcecontrol=3Ddeny \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/disk-network-gluster.x86_64-latest.args= b/tests/qemuxml2argvdata/disk-network-gluster.x86_64-latest.args index 9b99db8715..4e291acaea 100644 --- a/tests/qemuxml2argvdata/disk-network-gluster.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-network-gluster.x86_64-latest.args @@ -24,20 +24,28 @@ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ -no-acpi \ -boot strict=3Don \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ --drive file=3Dgluster://example.org:6000/Volume1/Image,file.debug=3D4,form= at=3Draw,\ -if=3Dnone,id=3Ddrive-virtio-disk0 \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x2,drive=3Ddrive-vir= tio-disk0,\ +-blockdev '{"driver":"gluster","volume":"Volume1","path":"Image",\ +"server":[{"type":"inet","host":"example.org","port":"6000"}],"debug":4,\ +"node-name":"libvirt-3-storage","read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-3-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-3-storage"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x2,drive=3Dlibvirt-3= -format,\ id=3Dvirtio-disk0,bootindex=3D1 \ --drive 'file=3Dgluster+unix:///Volume2/Image?socket=3D/path/to/sock,file.d= ebug=3D4,\ -format=3Draw,if=3Dnone,id=3Ddrive-virtio-disk1' \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x3,drive=3Ddrive-vir= tio-disk1,\ +-blockdev '{"driver":"gluster","volume":"Volume2","path":"Image",\ +"server":[{"type":"unix","path":"/path/to/sock"}],"debug":4,\ +"node-name":"libvirt-2-storage","read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-2-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-2-storage"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x3,drive=3Dlibvirt-2= -format,\ id=3Dvirtio-disk1 \ --drive file.driver=3Dgluster,file.volume=3DVolume3,file.path=3DImage.qcow2= ,\ -file.server.0.type=3Dtcp,file.server.0.host=3Dexample.org,file.server.0.po= rt=3D6000,\ -file.server.1.type=3Dtcp,file.server.1.host=3Dexample.org,file.server.1.po= rt=3D24007,\ -file.server.2.type=3Dunix,file.server.2.socket=3D/path/to/sock,file.debug= =3D4,\ -format=3Dqcow2,if=3Dnone,id=3Ddrive-virtio-disk2 \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x4,drive=3Ddrive-vir= tio-disk2,\ +-blockdev '{"driver":"gluster","volume":"Volume3","path":"Image.qcow2",\ +"server":[{"type":"inet","host":"example.org","port":"6000"},{"type":"inet= ",\ +"host":"example.org","port":"24007"},{"type":"unix","path":"/path/to/sock"= }],\ +"debug":4,"node-name":"libvirt-1-storage","read-only":false,\ +"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"qco= w2",\ +"file":"libvirt-1-storage"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x4,drive=3Dlibvirt-1= -format,\ id=3Dvirtio-disk2 \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ resourcecontrol=3Ddeny \ diff --git a/tests/qemuxml2argvdata/disk-network-iscsi.x86_64-latest.args b= /tests/qemuxml2argvdata/disk-network-iscsi.x86_64-latest.args index be9ab18314..b8d2ab4f2e 100644 --- a/tests/qemuxml2argvdata/disk-network-iscsi.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-network-iscsi.x86_64-latest.args @@ -25,39 +25,49 @@ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ -boot strict=3Don \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ -device virtio-scsi-pci,id=3Dscsi0,bus=3Dpci.0,addr=3D0x2 \ --drive file.driver=3Discsi,file.portal=3Dexample.org:6000,\ -file.target=3Diqn.1992-01.com.example,file.lun=3D0,file.transport=3Dtcp,fo= rmat=3Draw,\ -if=3Dnone,id=3Ddrive-virtio-disk0 \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x3,drive=3Ddrive-vir= tio-disk0,\ +-blockdev '{"driver":"iscsi","portal":"example.org:6000",\ +"target":"iqn.1992-01.com.example","lun":0,"transport":"tcp",\ +"node-name":"libvirt-5-storage","read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-5-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-5-storage"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x3,drive=3Dlibvirt-5= -format,\ id=3Dvirtio-disk0,bootindex=3D1 \ --drive file.driver=3Discsi,file.portal=3Dexample.org:6000,\ -file.target=3Diqn.1992-01.com.example,file.lun=3D1,file.transport=3Dtcp,fo= rmat=3Draw,\ -if=3Dnone,id=3Ddrive-virtio-disk1 \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x4,drive=3Ddrive-vir= tio-disk1,\ +-blockdev '{"driver":"iscsi","portal":"example.org:6000",\ +"target":"iqn.1992-01.com.example","lun":1,"transport":"tcp",\ +"node-name":"libvirt-4-storage","read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-4-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-4-storage"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x4,drive=3Dlibvirt-4= -format,\ id=3Dvirtio-disk1 \ --object secret,id=3Dvirtio-disk2-secret0,\ +-object secret,id=3Dlibvirt-3-storage-secret0,\ data=3D9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\ keyid=3DmasterKey0,iv=3DAAECAwQFBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ --drive file.driver=3Discsi,file.portal=3Dexample.org:6000,\ -file.target=3Diqn.1992-01.com.example:storage,file.lun=3D1,file.transport= =3Dtcp,\ -file.user=3Dmyname,file.password-secret=3Dvirtio-disk2-secret0,format=3Dra= w,if=3Dnone,\ -id=3Ddrive-virtio-disk2 \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x5,drive=3Ddrive-vir= tio-disk2,\ +-blockdev '{"driver":"iscsi","portal":"example.org:6000",\ +"target":"iqn.1992-01.com.example:storage","lun":1,"transport":"tcp",\ +"user":"myname","password-secret":"libvirt-3-storage-secret0",\ +"node-name":"libvirt-3-storage","read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-3-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-3-storage"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x5,drive=3Dlibvirt-3= -format,\ id=3Dvirtio-disk2 \ --object secret,id=3Dvirtio-disk3-secret0,\ +-object secret,id=3Dlibvirt-2-storage-secret0,\ data=3D9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\ keyid=3DmasterKey0,iv=3DAAECAwQFBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ --drive file.driver=3Discsi,file.portal=3Dexample.org:6000,\ -file.target=3Diqn.1992-01.com.example:storage,file.lun=3D2,file.transport= =3Dtcp,\ -file.user=3Dmyname,file.password-secret=3Dvirtio-disk3-secret0,format=3Dra= w,if=3Dnone,\ -id=3Ddrive-virtio-disk3 \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x6,drive=3Ddrive-vir= tio-disk3,\ +-blockdev '{"driver":"iscsi","portal":"example.org:6000",\ +"target":"iqn.1992-01.com.example:storage","lun":2,"transport":"tcp",\ +"user":"myname","password-secret":"libvirt-2-storage-secret0",\ +"node-name":"libvirt-2-storage","read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-2-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-2-storage"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x6,drive=3Dlibvirt-2= -format,\ id=3Dvirtio-disk3 \ --drive file.driver=3Discsi,file.portal=3Dexample.org:3260,\ -file.target=3Diqn.1992-01.com.example,file.lun=3D0,file.transport=3Dtcp,fo= rmat=3Draw,\ -if=3Dnone,id=3Ddrive-scsi0-0-0-0 \ +-blockdev '{"driver":"iscsi","portal":"example.org:3260",\ +"target":"iqn.1992-01.com.example","lun":0,"transport":"tcp",\ +"node-name":"libvirt-1-storage","read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-1-storage"}' \ -device scsi-block,bus=3Dscsi0.0,channel=3D0,scsi-id=3D0,lun=3D0,\ -drive=3Ddrive-scsi0-0-0-0,id=3Dscsi0-0-0-0 \ +drive=3Dlibvirt-1-format,id=3Dscsi0-0-0-0 \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ resourcecontrol=3Ddeny \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/disk-network-nbd.x86_64-latest.args b/t= ests/qemuxml2argvdata/disk-network-nbd.x86_64-latest.args index 85452e715a..9b8a079228 100644 --- a/tests/qemuxml2argvdata/disk-network-nbd.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-network-nbd.x86_64-latest.args @@ -24,22 +24,39 @@ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ -no-acpi \ -boot strict=3Don \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ --drive file=3Dnbd:example.org:6000,format=3Draw,if=3Dnone,id=3Ddrive-virti= o-disk0 \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x2,drive=3Ddrive-vir= tio-disk0,\ +-blockdev '{"driver":"nbd","server":{"type":"inet","host":"example.org",\ +"port":"6000"},"node-name":"libvirt-5-storage","read-only":false,\ +"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-5-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-5-storage"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x2,drive=3Dlibvirt-5= -format,\ id=3Dvirtio-disk0,bootindex=3D1 \ --drive file=3Dnbd:example.org:6000:exportname=3Dbar,format=3Draw,if=3Dnone= ,\ -id=3Ddrive-virtio-disk1 \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x3,drive=3Ddrive-vir= tio-disk1,\ +-blockdev '{"driver":"nbd","server":{"type":"inet","host":"example.org",\ +"port":"6000"},"export":"bar","node-name":"libvirt-4-storage",\ +"read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-4-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-4-storage"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x3,drive=3Dlibvirt-4= -format,\ id=3Dvirtio-disk1 \ --drive 'file=3Dnbd://[::1]:6000,format=3Draw,if=3Dnone,id=3Ddrive-virtio-d= isk2' \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x4,drive=3Ddrive-vir= tio-disk2,\ +-blockdev '{"driver":"nbd","server":{"type":"inet","host":"::1","port":"60= 00"},\ +"node-name":"libvirt-3-storage","read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-3-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-3-storage"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x4,drive=3Dlibvirt-3= -format,\ id=3Dvirtio-disk2 \ --drive 'file=3Dnbd://[::1]:6000/bar,format=3Draw,if=3Dnone,id=3Ddrive-virt= io-disk3' \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x5,drive=3Ddrive-vir= tio-disk3,\ +-blockdev '{"driver":"nbd","server":{"type":"inet","host":"::1","port":"60= 00"},\ +"export":"bar","node-name":"libvirt-2-storage","read-only":false,\ +"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-2-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-2-storage"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x5,drive=3Dlibvirt-2= -format,\ id=3Dvirtio-disk3 \ --drive file=3Dnbd:unix:/var/run/nbdsock:exportname=3Dbar,format=3Draw,if= =3Dnone,\ -id=3Ddrive-virtio-disk4 \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x6,drive=3Ddrive-vir= tio-disk4,\ +-blockdev '{"driver":"nbd","server":{"type":"unix","path":"/var/run/nbdsoc= k"},\ +"export":"bar","node-name":"libvirt-1-storage","read-only":false,\ +"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-1-storage"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x6,drive=3Dlibvirt-1= -format,\ id=3Dvirtio-disk4 \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ resourcecontrol=3Ddeny \ diff --git a/tests/qemuxml2argvdata/disk-network-rbd.x86_64-latest.args b/t= ests/qemuxml2argvdata/disk-network-rbd.x86_64-latest.args index 0c5898cbd3..e941548132 100644 --- a/tests/qemuxml2argvdata/disk-network-rbd.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-network-rbd.x86_64-latest.args @@ -24,37 +24,56 @@ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ -no-acpi \ -boot strict=3Don \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ --drive 'file=3Drbd:pool/image:auth_supported=3Dnone:mon_host=3Dmon1.exampl= e.org\:\ -6321\;mon2.example.org\:6322\;mon3.example.org\:6322,format=3Draw,if=3Dnon= e,\ -id=3Ddrive-virtio-disk0' \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x2,drive=3Ddrive-vir= tio-disk0,\ +-blockdev '{"driver":"rbd","pool":"pool","image":"image",\ +"server":[{"host":"mon1.example.org","port":"6321"},{"host":"mon2.example.= org",\ +"port":"6322"},{"host":"mon3.example.org","port":"6322"}],\ +"node-name":"libvirt-6-storage","read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-6-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-6-storage"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x2,drive=3Dlibvirt-6= -format,\ id=3Dvirtio-disk0,bootindex=3D1 \ --drive file=3Drbd:pool/image@asdf:auth_supported=3Dnone,format=3Draw,if=3D= none,\ -id=3Ddrive-virtio-disk1 \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x3,drive=3Ddrive-vir= tio-disk1,\ +-blockdev '{"driver":"rbd","pool":"pool","image":"image","snapshot":"asdf"= ,\ +"node-name":"libvirt-5-storage","read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-5-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-5-storage"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x3,drive=3Dlibvirt-5= -format,\ id=3Dvirtio-disk1 \ --drive 'file=3Drbd:pool/image@foo:auth_supported=3Dnone:mon_host=3Dmon1.ex= ample.org\:\ -6321\;mon2.example.org\:6322\;mon3.example.org\:6322,format=3Draw,if=3Dnon= e,\ -id=3Ddrive-virtio-disk2' \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x4,drive=3Ddrive-vir= tio-disk2,\ +-blockdev '{"driver":"rbd","pool":"pool","image":"image","snapshot":"foo",\ +"server":[{"host":"mon1.example.org","port":"6321"},{"host":"mon2.example.= org",\ +"port":"6322"},{"host":"mon3.example.org","port":"6322"}],\ +"node-name":"libvirt-4-storage","read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-4-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-4-storage"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x4,drive=3Dlibvirt-4= -format,\ id=3Dvirtio-disk2 \ --drive file=3Drbd:pool/image@foo:auth_supported=3Dnone:conf=3D/blah/test.c= onf,\ -format=3Draw,if=3Dnone,id=3Ddrive-virtio-disk3 \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x5,drive=3Ddrive-vir= tio-disk3,\ +-blockdev '{"driver":"rbd","pool":"pool","image":"image","snapshot":"foo",\ +"conf":"/blah/test.conf","node-name":"libvirt-3-storage","read-only":false= ,\ +"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-3-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-3-storage"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x5,drive=3Dlibvirt-3= -format,\ id=3Dvirtio-disk3 \ --object secret,id=3Dvirtio-disk4-secret0,\ +-object secret,id=3Dlibvirt-2-storage-secret0,\ data=3D9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\ keyid=3DmasterKey0,iv=3DAAECAwQFBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ --drive 'file=3Drbd:pool/image:id=3Dmyname:auth_supported=3Dcephx\;none:\ -mon_host=3Dmon1.example.org\:6321\;mon2.example.org\:6322\;mon3.example.or= g\:\ -6322,file.password-secret=3Dvirtio-disk4-secret0,format=3Draw,if=3Dnone,\ -id=3Ddrive-virtio-disk4' \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x6,drive=3Ddrive-vir= tio-disk4,\ +-blockdev '{"driver":"rbd","pool":"pool","image":"image",\ +"server":[{"host":"mon1.example.org","port":"6321"},{"host":"mon2.example.= org",\ +"port":"6322"},{"host":"mon3.example.org","port":"6322"}],"user":"myname",\ +"auth-client-required":["cephx","none"],\ +"key-secret":"libvirt-2-storage-secret0","node-name":"libvirt-2-storage",\ +"read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-2-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-2-storage"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x6,drive=3Dlibvirt-2= -format,\ id=3Dvirtio-disk4 \ --drive 'file=3Drbd:pool/image:auth_supported=3Dnone:mon_host=3D[\:\:1]\:\ -6321\;example.org\:6789\;[ffff\:1234\:567\:abc\:\:0f]\:6322\;[2001\:db8\:\= :\ -ff00\:42\:8329]\:6322,format=3Draw,if=3Dnone,id=3Ddrive-virtio-disk5' \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x7,drive=3Ddrive-vir= tio-disk5,\ +-blockdev '{"driver":"rbd","pool":"pool","image":"image",\ +"server":[{"host":"::1","port":"6321"},{"host":"example.org","port":"6789"= },\ +{"host":"ffff:1234:567:abc::0f","port":"6322"},\ +{"host":"2001:db8::ff00:42:8329","port":"6322"}],\ +"node-name":"libvirt-1-storage","read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-1-storage"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x7,drive=3Dlibvirt-1= -format,\ id=3Dvirtio-disk5 \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ resourcecontrol=3Ddeny \ diff --git a/tests/qemuxml2argvdata/disk-network-sheepdog.x86_64-latest.arg= s b/tests/qemuxml2argvdata/disk-network-sheepdog.x86_64-latest.args index 544c673820..c6d9175be7 100644 --- a/tests/qemuxml2argvdata/disk-network-sheepdog.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-network-sheepdog.x86_64-latest.args @@ -24,11 +24,17 @@ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ -no-acpi \ -boot strict=3Don \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ --drive file=3D/dev/HostVG/QEMU,,Guest,,,,1,format=3Draw,if=3Dnone,id=3Ddri= ve-ide0-0-0 \ --device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ --drive file=3Dsheepdog:example.org:6000:image,,with,,commas,format=3Draw,i= f=3Dnone,\ -id=3Ddrive-virtio-disk0 \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x2,drive=3Ddrive-vir= tio-disk0,\ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMU,Guest,,1",\ +"node-name":"libvirt-2-storage","read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-2-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-2-storage"}' \ +-device ide-hd,bus=3Dide.0,unit=3D0,drive=3Dlibvirt-2-format,id=3Dide0-0-0= ,bootindex=3D1 \ +-blockdev '{"driver":"sheepdog","server":{"type":"inet","host":"example.or= g",\ +"port":"6000"},"vdi":"image,with,commas","node-name":"libvirt-1-storage",\ +"read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-1-storage"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x2,drive=3Dlibvirt-1= -format,\ id=3Dvirtio-disk0 \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ resourcecontrol=3Ddeny \ diff --git a/tests/qemuxml2argvdata/disk-network-source-auth.x86_64-latest.= args b/tests/qemuxml2argvdata/disk-network-source-auth.x86_64-latest.args index 9f124ec75f..6483c7bd11 100644 --- a/tests/qemuxml2argvdata/disk-network-source-auth.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-network-source-auth.x86_64-latest.args @@ -24,23 +24,29 @@ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ -no-acpi \ -boot strict=3Don \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ --object secret,id=3Dvirtio-disk0-secret0,\ +-object secret,id=3Dlibvirt-2-storage-secret0,\ data=3D9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\ keyid=3DmasterKey0,iv=3DAAECAwQFBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ --drive file.driver=3Discsi,file.portal=3Dexample.org:6000,\ -file.target=3Diqn.1992-01.com.example:storage,file.lun=3D1,file.transport= =3Dtcp,\ -file.user=3Dmyname,file.password-secret=3Dvirtio-disk0-secret0,format=3Dra= w,if=3Dnone,\ -id=3Ddrive-virtio-disk0 \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x2,drive=3Ddrive-vir= tio-disk0,\ +-blockdev '{"driver":"iscsi","portal":"example.org:6000",\ +"target":"iqn.1992-01.com.example:storage","lun":1,"transport":"tcp",\ +"user":"myname","password-secret":"libvirt-2-storage-secret0",\ +"node-name":"libvirt-2-storage","read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-2-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-2-storage"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x2,drive=3Dlibvirt-2= -format,\ id=3Dvirtio-disk0,bootindex=3D1 \ --object secret,id=3Dvirtio-disk1-secret0,\ +-object secret,id=3Dlibvirt-1-storage-secret0,\ data=3D9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\ keyid=3DmasterKey0,iv=3DAAECAwQFBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ --drive 'file=3Drbd:pool/image:id=3Dmyname:auth_supported=3Dcephx\;none:\ -mon_host=3Dmon1.example.org\:6321\;mon2.example.org\:6322\;mon3.example.or= g\:\ -6322,file.password-secret=3Dvirtio-disk1-secret0,format=3Draw,if=3Dnone,\ -id=3Ddrive-virtio-disk1' \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x3,drive=3Ddrive-vir= tio-disk1,\ +-blockdev '{"driver":"rbd","pool":"pool","image":"image",\ +"server":[{"host":"mon1.example.org","port":"6321"},{"host":"mon2.example.= org",\ +"port":"6322"},{"host":"mon3.example.org","port":"6322"}],"user":"myname",\ +"auth-client-required":["cephx","none"],\ +"key-secret":"libvirt-1-storage-secret0","node-name":"libvirt-1-storage",\ +"read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-1-storage"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x3,drive=3Dlibvirt-1= -format,\ id=3Dvirtio-disk1 \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ resourcecontrol=3Ddeny \ diff --git a/tests/qemuxml2argvdata/disk-network-tlsx509.x86_64-latest.args= b/tests/qemuxml2argvdata/disk-network-tlsx509.x86_64-latest.args index 48d70e1cd3..8d4786abb5 100644 --- a/tests/qemuxml2argvdata/disk-network-tlsx509.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-network-tlsx509.x86_64-latest.args @@ -25,34 +25,47 @@ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ -no-acpi \ -boot strict=3Don \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ --object tls-creds-x509,id=3Dobjvirtio-disk0_tls0,dir=3D/etc/pki/libvirt-vx= hs/dummy,\ -,path,endpoint=3Dclient,verify-peer=3Dyes \ --drive file.driver=3Dvxhs,file.tls-creds=3Dobjvirtio-disk0_tls0,\ -file.vdisk-id=3Deb90327c-8302-4725-9e1b-4e85ed4dc251,\ -file.server.host=3D192.168.0.1,file.server.port=3D9999,format=3Draw,if=3Dn= one,\ -id=3Ddrive-virtio-disk0,cache=3Dnone \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x4,drive=3Ddrive-vir= tio-disk0,\ +-object tls-creds-x509,id=3Dobjlibvirt-4-storage_tls0,\ +dir=3D/etc/pki/libvirt-vxhs/dummy,,path,endpoint=3Dclient,verify-peer=3Dye= s \ +-blockdev '{"driver":"vxhs","tls-creds":"objlibvirt-4-storage_tls0",\ +"vdisk-id":"eb90327c-8302-4725-9e1b-4e85ed4dc251",\ +"server":{"host":"192.168.0.1","port":"9999"},"node-name":"libvirt-4-stora= ge",\ +"cache":{"direct":true,"no-flush":false},"read-only":false,"discard":"unma= p"}' \ +-blockdev '{"node-name":"libvirt-4-format","read-only":false,\ +"cache":{"direct":true,"no-flush":false},"driver":"raw",\ +"file":"libvirt-4-storage"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x4,drive=3Dlibvirt-4= -format,\ id=3Dvirtio-disk0,bootindex=3D1,write-cache=3Don,\ serial=3Deb90327c-8302-4725-9e1b-4e85ed4dc251 \ --object tls-creds-x509,id=3Dobjvirtio-disk1_tls0,dir=3D/etc/pki/libvirt-vx= hs/dummy,\ -,path,endpoint=3Dclient,verify-peer=3Dyes \ --drive file.driver=3Dvxhs,file.tls-creds=3Dobjvirtio-disk1_tls0,\ -file.vdisk-id=3Deb90327c-8302-4725-9e1b-4e85ed4dc252,\ -file.server.host=3D192.168.0.2,file.server.port=3D9999,format=3Draw,if=3Dn= one,\ -id=3Ddrive-virtio-disk1,cache=3Dnone \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x5,drive=3Ddrive-vir= tio-disk1,\ +-object tls-creds-x509,id=3Dobjlibvirt-3-storage_tls0,\ +dir=3D/etc/pki/libvirt-vxhs/dummy,,path,endpoint=3Dclient,verify-peer=3Dye= s \ +-blockdev '{"driver":"vxhs","tls-creds":"objlibvirt-3-storage_tls0",\ +"vdisk-id":"eb90327c-8302-4725-9e1b-4e85ed4dc252",\ +"server":{"host":"192.168.0.2","port":"9999"},"node-name":"libvirt-3-stora= ge",\ +"cache":{"direct":true,"no-flush":false},"read-only":false,"discard":"unma= p"}' \ +-blockdev '{"node-name":"libvirt-3-format","read-only":false,\ +"cache":{"direct":true,"no-flush":false},"driver":"raw",\ +"file":"libvirt-3-storage"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x5,drive=3Dlibvirt-3= -format,\ id=3Dvirtio-disk1,write-cache=3Don,serial=3Deb90327c-8302-4725-9e1b-4e85ed= 4dc252 \ --drive file.driver=3Dvxhs,file.vdisk-id=3Deb90327c-8302-4725-9e1b-4e85ed4d= c253,\ -file.server.host=3D192.168.0.3,file.server.port=3D9999,format=3Draw,if=3Dn= one,\ -id=3Ddrive-virtio-disk2,cache=3Dnone \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x6,drive=3Ddrive-vir= tio-disk2,\ +-blockdev '{"driver":"vxhs","vdisk-id":"eb90327c-8302-4725-9e1b-4e85ed4dc2= 53",\ +"server":{"host":"192.168.0.3","port":"9999"},"node-name":"libvirt-2-stora= ge",\ +"cache":{"direct":true,"no-flush":false},"read-only":false,"discard":"unma= p"}' \ +-blockdev '{"node-name":"libvirt-2-format","read-only":false,\ +"cache":{"direct":true,"no-flush":false},"driver":"raw",\ +"file":"libvirt-2-storage"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x6,drive=3Dlibvirt-2= -format,\ id=3Dvirtio-disk2,write-cache=3Don,serial=3Deb90327c-8302-4725-9e1b-4e85ed= 4dc252 \ --object tls-creds-x509,id=3Dobjvirtio-disk3_tls0,dir=3D/etc/pki/libvirt-nb= d/dummy,,\ -path,endpoint=3Dclient,verify-peer=3Dyes \ --drive file.driver=3Dnbd,file.server.type=3Dinet,file.server.host=3Dexampl= e.com,\ -file.server.port=3D1234,file.tls-creds=3Dobjvirtio-disk3_tls0,format=3Draw= ,if=3Dnone,\ -id=3Ddrive-virtio-disk3,cache=3Dnone \ --device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x7,drive=3Ddrive-vir= tio-disk3,\ +-object tls-creds-x509,id=3Dobjlibvirt-1-storage_tls0,\ +dir=3D/etc/pki/libvirt-nbd/dummy,,path,endpoint=3Dclient,verify-peer=3Dyes= \ +-blockdev '{"driver":"nbd","server":{"type":"inet","host":"example.com",\ +"port":"1234"},"tls-creds":"objlibvirt-1-storage_tls0",\ +"node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},\ +"read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":false,\ +"cache":{"direct":true,"no-flush":false},"driver":"raw",\ +"file":"libvirt-1-storage"}' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x7,drive=3Dlibvirt-1= -format,\ id=3Dvirtio-disk3,write-cache=3Don \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ resourcecontrol=3Ddeny \ diff --git a/tests/qemuxml2argvdata/disk-readonly-disk.x86_64-latest.args b= /tests/qemuxml2argvdata/disk-readonly-disk.x86_64-latest.args index 3fd8f5c849..435f930fa8 100644 --- a/tests/qemuxml2argvdata/disk-readonly-disk.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-readonly-disk.x86_64-latest.args @@ -24,10 +24,16 @@ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ -no-acpi \ -boot strict=3Don \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ --drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ --device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ --drive file=3D/dev/sr0,format=3Draw,if=3Dnone,id=3Ddrive-ide0-1-0,readonly= =3Don \ --device ide-cd,bus=3Dide.1,unit=3D0,drive=3Ddrive-ide0-1-0,id=3Dide0-1-0 \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1",\ +"node-name":"libvirt-2-storage","read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-2-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-2-storage"}' \ +-device ide-hd,bus=3Dide.0,unit=3D0,drive=3Dlibvirt-2-format,id=3Dide0-0-0= ,bootindex=3D1 \ +-blockdev '{"driver":"host_device","filename":"/dev/sr0",\ +"node-name":"libvirt-1-storage","read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":true,"driver":"raw"= ,\ +"file":"libvirt-1-storage"}' \ +-device ide-cd,bus=3Dide.1,unit=3D0,drive=3Dlibvirt-1-format,id=3Dide0-1-0= \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ resourcecontrol=3Ddeny \ diff --git a/tests/qemuxml2argvdata/disk-shared.x86_64-latest.args b/tests/= qemuxml2argvdata/disk-shared.x86_64-latest.args index 15f8c6b3d7..8560f82854 100644 --- a/tests/qemuxml2argvdata/disk-shared.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-shared.x86_64-latest.args @@ -24,13 +24,19 @@ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ -no-acpi \ -boot strict=3Don \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ --drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0,\ -cache=3Dnone \ --device ide-hd,bus=3Dide.0,unit=3D0,share-rw=3Don,drive=3Ddrive-ide0-0-0,i= d=3Dide0-0-0,\ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1",\ +"node-name":"libvirt-2-storage","cache":{"direct":true,"no-flush":false},\ +"read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-2-format","read-only":false,\ +"cache":{"direct":true,"no-flush":false},"driver":"raw",\ +"file":"libvirt-2-storage"}' \ +-device ide-hd,bus=3Dide.0,unit=3D0,share-rw=3Don,drive=3Dlibvirt-2-format= ,id=3Dide0-0-0,\ bootindex=3D1,write-cache=3Don,serial=3DXYZXYZXYZYXXYZYZYXYZY \ --drive file=3D/dev/HostVG/QEMUGuest2,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-1-0,\ -readonly=3Don \ --device ide-cd,bus=3Dide.1,unit=3D0,drive=3Ddrive-ide0-1-0,id=3Dide0-1-0 \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest2",\ +"node-name":"libvirt-1-storage","read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":true,"driver":"raw"= ,\ +"file":"libvirt-1-storage"}' \ +-device ide-cd,bus=3Dide.1,unit=3D0,drive=3Dlibvirt-1-format,id=3Dide0-1-0= \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ resourcecontrol=3Ddeny \ diff --git a/tests/qemuxml2argvdata/disk-virtio-scsi-reservations.x86_64-la= test.args b/tests/qemuxml2argvdata/disk-virtio-scsi-reservations.x86_64-lat= est.args index 902864539b..8ba2767c57 100644 --- a/tests/qemuxml2argvdata/disk-virtio-scsi-reservations.x86_64-latest.ar= gs +++ b/tests/qemuxml2argvdata/disk-virtio-scsi-reservations.x86_64-latest.ar= gs @@ -27,16 +27,22 @@ path=3D/tmp/lib/domain--1-QEMUGuest1/pr-helper0.sock \ -boot strict=3Don \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ -device virtio-scsi-pci,id=3Dscsi0,num_queues=3D8,bus=3Dpci.0,addr=3D0x3 \ --drive file=3D/dev/HostVG/QEMUGuest1,file.pr-manager=3Dpr-helper0,format= =3Draw,\ -if=3Dnone,id=3Ddrive-scsi0-0-0-0 \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1",\ +"pr-manager":"pr-helper0","node-name":"libvirt-2-storage","read-only":fals= e,\ +"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-2-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-2-storage"}' \ -device scsi-block,bus=3Dscsi0.0,channel=3D0,scsi-id=3D0,lun=3D0,\ -drive=3Ddrive-scsi0-0-0-0,id=3Dscsi0-0-0-0,bootindex=3D1 \ --object pr-manager-helper,id=3Dpr-helper-scsi0-0-0-1,\ +drive=3Dlibvirt-2-format,id=3Dscsi0-0-0-0,bootindex=3D1 \ +-object pr-manager-helper,id=3Dpr-helper-libvirt-1-storage,\ path=3D/path/to/qemu-pr-helper.sock \ --drive file=3D/dev/HostVG/QEMUGuest2,file.pr-manager=3Dpr-helper-scsi0-0-0= -1,\ -format=3Draw,if=3Dnone,id=3Ddrive-scsi0-0-0-1 \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest2",\ +"pr-manager":"pr-helper-libvirt-1-storage","node-name":"libvirt-1-storage"= ,\ +"read-only":false,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-1-storage"}' \ -device scsi-block,bus=3Dscsi0.0,channel=3D0,scsi-id=3D0,lun=3D1,\ -drive=3Ddrive-scsi0-0-0-1,id=3Dscsi0-0-0-1 \ +drive=3Dlibvirt-1-format,id=3Dscsi0-0-0-1 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x4 \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ resourcecontrol=3Ddeny \ diff --git a/tests/qemuxml2argvdata/floppy-drive-fat.x86_64-latest.args b/t= ests/qemuxml2argvdata/floppy-drive-fat.x86_64-latest.args index bf133aaab0..2c9485baed 100644 --- a/tests/qemuxml2argvdata/floppy-drive-fat.x86_64-latest.args +++ b/tests/qemuxml2argvdata/floppy-drive-fat.x86_64-latest.args @@ -24,9 +24,12 @@ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ -no-acpi \ -boot strict=3Don \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ --drive file=3Dfat:floppy:/var/somefiles,if=3Dnone,id=3Ddrive-fdc0-0-0,read= only=3Don \ --global isa-fdc.driveA=3Ddrive-fdc0-0-0 \ -global isa-fdc.bootindexA=3D1 \ +-blockdev '{"driver":"vvfat","dir":"/var/somefiles","floppy":true,"rw":fal= se,\ +"node-name":"libvirt-1-storage","read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":true,"driver":"raw"= ,\ +"file":"libvirt-1-storage"}' \ +-device floppy,unit=3D0,drive=3Dlibvirt-1-format,id=3Dfdc0-0-0 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ resourcecontrol=3Ddeny \ --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list