From nobody Fri May 3 12:53:16 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 1532534312191490.83640142870104; Wed, 25 Jul 2018 08:58:32 -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 B1487307D868; Wed, 25 Jul 2018 15:58:30 +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 7EC3BCD6B1; Wed, 25 Jul 2018 15:58:30 +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 22F4B18037F1; Wed, 25 Jul 2018 15:58:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwFM3025587 for ; Wed, 25 Jul 2018 11:58:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id B39F01018F; Wed, 25 Jul 2018 15:58:15 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 35DF27C4B; Wed, 25 Jul 2018 15:58:15 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:57:32 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 01/39] 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.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]); Wed, 25 Jul 2018 15:58:31 +0000 (UTC) X-ZohoMail: 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 75d0738b5d..abbcede097 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -4833,21 +4833,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; @@ -5017,33 +5010,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 Fri May 3 12:53:16 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 1532534303247856.6025474307414; Wed, 25 Jul 2018 08:58: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 8B6DE8110F; Wed, 25 Jul 2018 15:58: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 36D9C10018FF; Wed, 25 Jul 2018 15:58: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 ABC9224F62; Wed, 25 Jul 2018 15:58:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwG9a025592 for ; Wed, 25 Jul 2018 11:58:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 79B187C4B; Wed, 25 Jul 2018 15:58:16 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id F057217336; Wed, 25 Jul 2018 15:58:15 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:57:33 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 02/39] 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.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 25 Jul 2018 15:58:22 +0000 (UTC) X-ZohoMail: 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 fb0d4a8c7a..ae762a3189 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -18494,7 +18494,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 6e0644221b..84310ff8ca 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3448,17 +3448,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 2fa8d5b51d..01860f11f4 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -933,7 +933,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 abbcede097..fc65198f6f 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -4913,7 +4913,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, @@ -4923,12 +4924,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, @@ -4983,10 +4989,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 2408ab0c5b..5b5defc3f5 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -328,7 +328,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 1826c4f297..e1f4c27a63 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2130,7 +2130,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 Fri May 3 12:53:16 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 1532534303561269.23435404647546; Wed, 25 Jul 2018 08:58:23 -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 1E707317C41E; Wed, 25 Jul 2018 15:58: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 CDE57170F1; Wed, 25 Jul 2018 15:58: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 7B5D018037EF; Wed, 25 Jul 2018 15:58:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwHPr025600 for ; Wed, 25 Jul 2018 11:58:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 40A977C56; Wed, 25 Jul 2018 15:58:17 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id B6E101018F; Wed, 25 Jul 2018 15:58:16 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:57:34 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 03/39] 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.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.41]); Wed, 25 Jul 2018 15:58:22 +0000 (UTC) X-ZohoMail: 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 ae762a3189..b81ad7cdbc 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -18623,7 +18623,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 84310ff8ca..ac9cde4577 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3469,14 +3469,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 01860f11f4..a25b1f54ea 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -941,7 +941,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 fc65198f6f..f33535327c 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -4834,7 +4834,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; @@ -4844,7 +4845,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", @@ -4853,14 +4855,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; @@ -4901,7 +4907,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; @@ -5012,7 +5018,8 @@ int qemuMonitorJSONSetBlockIoThrottle(qemuMonitorPtr = mon, } int qemuMonitorJSONGetBlockIoThrottle(qemuMonitorPtr mon, - const char *device, + const char *drivealias, + const char *qdevid, virDomainBlockIoTuneInfoPtr reply) { int ret =3D -1; @@ -5021,7 +5028,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 5b5defc3f5..78bc16582e 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -336,7 +336,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 e1f4c27a63..6a3d16db71 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2123,7 +2123,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 Fri May 3 12:53:16 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 1532534321108779.8901284584903; Wed, 25 Jul 2018 08:58:41 -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 2C6C1308FBAF; Wed, 25 Jul 2018 15:58:39 +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 E6C40CD6AE; Wed, 25 Jul 2018 15:58: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 8613A24F5A; Wed, 25 Jul 2018 15:58:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwIb4025610 for ; Wed, 25 Jul 2018 11:58:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 07CEB7C4B; Wed, 25 Jul 2018 15:58:18 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7D81B1018F; Wed, 25 Jul 2018 15:58:17 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:57:35 +0200 Message-Id: <2a5a5fe1a06c277dcbb6a76a6a7ecfce25a98c78.1532533587.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 04/39] 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.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.43]); Wed, 25 Jul 2018 15:58:40 +0000 (UTC) X-ZohoMail: 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 | 2 -- 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, 75 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 d523d69406..1b6731f849 100644 --- a/tests/qemuxml2argvdata/hostdev-mdev-precreated.args +++ b/tests/qemuxml2argvdata/hostdev-mdev-precreated.args @@ -22,8 +22,6 @@ server,nowait \ -no-acpi \ -boot c \ -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 \ -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 Fri May 3 12:53:16 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 15325343177926.95546886558941; Wed, 25 Jul 2018 08:58:37 -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 C97703084027; Wed, 25 Jul 2018 15:58:30 +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 82A835C26D; Wed, 25 Jul 2018 15:58:30 +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 27B6824F62; Wed, 25 Jul 2018 15:58:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwJ33025617 for ; Wed, 25 Jul 2018 11:58:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2BFD01684A; Wed, 25 Jul 2018 15:58:19 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4533C1687E; Wed, 25 Jul 2018 15:58:18 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:57:36 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 05/39] 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.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.40]); Wed, 25 Jul 2018 15:58:36 +0000 (UTC) X-ZohoMail: 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.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 | 20 +++++++ 21 files changed, 878 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.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.x86_64-2.12.0.args b/tests/= qemuxml2argvdata/disk-floppy.x86_64-2.12.0.args new file mode 100644 index 0000000000..38b04040bc --- /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 \ +-global isa-fdc.driveA=3Ddrive-fdc0-0-0 \ +-drive file=3D/tmp/firmware.img,format=3Draw,if=3Dnone,id=3Ddrive-fdc0-0-1= \ +-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 1a936faef1..138da56c55 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -989,14 +989,18 @@ 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_FAILURE("disk-floppy-pseries", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE); @@ -1020,8 +1024,10 @@ mymain(void) QEMU_CAPS_DRIVE_BOOT); DO_TEST("floppy-drive-fat", QEMU_CAPS_DRIVE_BOOT); + 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", QEMU_CAPS_DRIVE_BOOT); @@ -1029,37 +1035,47 @@ mymain(void) DO_TEST_PARSE_ERROR("disk-fmt-dir", QEMU_CAPS_DRIVE_BOOT); DO_TEST_PARSE_ERROR("disk-fmt-iso", QEMU_CAPS_DRIVE_BOOT); 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_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); @@ -1109,6 +1125,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); @@ -1119,12 +1136,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", @@ -2890,6 +2909,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 Fri May 3 12:53:16 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 153253431779753.11418129435879; Wed, 25 Jul 2018 08:58:37 -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 827C1C04AC5A; Wed, 25 Jul 2018 15:58:35 +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 3D6F26090B; Wed, 25 Jul 2018 15:58:35 +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 D83A618037F8; Wed, 25 Jul 2018 15:58:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwK5i025625 for ; Wed, 25 Jul 2018 11:58:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3058E7C56; Wed, 25 Jul 2018 15:58:20 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 697491687E; Wed, 25 Jul 2018 15:58:19 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:57:37 +0200 Message-Id: <7d256917aac09cfdffaf30a0efd2e2d5c4005d4c.1532533587.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 06/39] 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 25 Jul 2018 15:58:37 +0000 (UTC) X-ZohoMail: 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 138da56c55..542951a1b9 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1176,6 +1176,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 795ddc7003..e0500547b5 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -991,6 +991,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 Fri May 3 12:53:16 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 1532534347580242.64087730023698; Wed, 25 Jul 2018 08:59:07 -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 C5BB13082A48; Wed, 25 Jul 2018 15:58: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 8A4CE10018FF; Wed, 25 Jul 2018 15:58: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 25C9124F56; Wed, 25 Jul 2018 15:58:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwLwL025631 for ; Wed, 25 Jul 2018 11:58:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id EBBA27C4B; Wed, 25 Jul 2018 15:58:20 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6DA9E1018F; Wed, 25 Jul 2018 15:58:20 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:57:38 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 07/39] 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.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.45]); Wed, 25 Jul 2018 15:59:07 +0000 (UTC) X-ZohoMail: 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 1488f0a7c2..1538abf155 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -4902,11 +4902,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 Fri May 3 12:53:16 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 153253433208910.137059493406014; Wed, 25 Jul 2018 08:58:52 -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 91F5130820EC; Wed, 25 Jul 2018 15:58:50 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 51D8B60E37; Wed, 25 Jul 2018 15:58:50 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E69E81800C9C; Wed, 25 Jul 2018 15:58:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwLb7025641 for ; Wed, 25 Jul 2018 11:58:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id B36F81684A; Wed, 25 Jul 2018 15:58:21 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 34B091018F; Wed, 25 Jul 2018 15:58:21 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:57:39 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 08/39] 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.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]); Wed, 25 Jul 2018 15:58:51 +0000 (UTC) X-ZohoMail: 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 30b8dc18d4..7ffa9f780e 100644 --- a/src/util/virqemu.c +++ b/src/util/virqemu.c @@ -248,8 +248,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 Fri May 3 12:53:16 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 1532534313118710.7260125212774; Wed, 25 Jul 2018 08:58:33 -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 CD1313084044; Wed, 25 Jul 2018 15:58:31 +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 9484F5D9CC; Wed, 25 Jul 2018 15:58: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 4862318037F3; Wed, 25 Jul 2018 15:58:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwM97025651 for ; Wed, 25 Jul 2018 11:58:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id 79F1117336; Wed, 25 Jul 2018 15:58:22 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id F077F1687E; Wed, 25 Jul 2018 15:58:21 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:57:40 +0200 Message-Id: <5789b38b38c9118ef138f748f362b48d7ec46fe7.1532533587.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 09/39] 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.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.40]); Wed, 25 Jul 2018 15:58:32 +0000 (UTC) X-ZohoMail: 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 0fb800589a..6b4c14ac50 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 9e8ad5f5c3..452761e672 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 Fri May 3 12:53:16 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 1532534322677909.0097301390267; Wed, 25 Jul 2018 08:58:42 -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 684AA3082152; Wed, 25 Jul 2018 15:58: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 0AAAD608F6; Wed, 25 Jul 2018 15:58: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 90F1B18037FD; Wed, 25 Jul 2018 15:58:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwNhU025656 for ; Wed, 25 Jul 2018 11:58:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id 405DD7C56; Wed, 25 Jul 2018 15:58:23 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id B6D301687E; Wed, 25 Jul 2018 15:58:22 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:57:41 +0200 Message-Id: <739919e8287c2d4ab77bb4e7c4d2e59124928864.1532533587.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 10/39] qemu: process: clear QEMU_CAPS_BLOCKDEV for VMs where we can't support it 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]); Wed, 25 Jul 2018 15:58:41 +0000 (UTC) X-ZohoMail: 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. Floppies at least in the case of the i440 machine type don't have a reasonable qdev ID if -drive is not used and thus would not allow queries and other operations. Since floppy drives are obsolete anyways clear blockdev when using them. 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 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 27bd8b9465..8dd25e2736 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5884,6 +5884,16 @@ 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) || + vm->def->disks[i]->bus =3D=3D VIR_DOMAIN_DISK_BUS_FDC) { + 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 Fri May 3 12:53:16 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 1532534322994848.9686413668601; Wed, 25 Jul 2018 08:58:42 -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 7C3FA307D866; Wed, 25 Jul 2018 15:58: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 45B273001A6E; Wed, 25 Jul 2018 15:58: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 E738D18037F1; Wed, 25 Jul 2018 15:58:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwQUo025676 for ; Wed, 25 Jul 2018 11:58:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id E05117C56; Wed, 25 Jul 2018 15:58:26 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id D735E7C4B; Wed, 25 Jul 2018 15:58:23 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:57:42 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 11/39] 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.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]); Wed, 25 Jul 2018 15:58:42 +0000 (UTC) X-ZohoMail: 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 8dd25e2736..1d6cd72727 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6027,8 +6027,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; @@ -6037,7 +6039,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; @@ -7711,7 +7715,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 Fri May 3 12:53:16 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 1532534327318689.6616133658441; Wed, 25 Jul 2018 08:58:47 -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 D553D3E2CB; Wed, 25 Jul 2018 15:58:45 +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 9BA90100195E; Wed, 25 Jul 2018 15:58:45 +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 4BD2E1800FEB; Wed, 25 Jul 2018 15:58:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwRm0025681 for ; Wed, 25 Jul 2018 11:58:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id A72377C56; Wed, 25 Jul 2018 15:58:27 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2938D7C4B; Wed, 25 Jul 2018 15:58:27 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:57:43 +0200 Message-Id: <4058a6f38b1fe0d39a17a8afeb01691de917d8a3.1532533587.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 12/39] 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.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 25 Jul 2018 15:58:46 +0000 (UTC) X-ZohoMail: 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 1d6cd72727..fbfba63fe1 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -7805,7 +7805,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 Fri May 3 12:53:16 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 1532534332924367.0566276132714; Wed, 25 Jul 2018 08:58:52 -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 64E3A3001777; Wed, 25 Jul 2018 15:58:51 +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 24801308BDB4; Wed, 25 Jul 2018 15:58: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 C8EE538B7; Wed, 25 Jul 2018 15:58:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwSQC025691 for ; Wed, 25 Jul 2018 11:58:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8D8D37C4B; Wed, 25 Jul 2018 15:58:28 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id E38F117336; Wed, 25 Jul 2018 15:58:27 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:57:44 +0200 Message-Id: <10374201f05e44631f8229aa6f3ab314d38ae312.1532533587.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 13/39] 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.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Wed, 25 Jul 2018 15:58:52 +0000 (UTC) X-ZohoMail: 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 33b0b4ab68..55f356ef23 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -23669,10 +23669,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; @@ -23938,8 +23943,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 Fri May 3 12:53:16 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 15325343378561003.9998928771136; Wed, 25 Jul 2018 08:58:57 -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 5F0DD811A7; Wed, 25 Jul 2018 15:58:56 +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 211AE19487; Wed, 25 Jul 2018 15:58: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 9AF5A24B78; Wed, 25 Jul 2018 15:58:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwT6q025701 for ; Wed, 25 Jul 2018 11:58:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 549FF7C4B; Wed, 25 Jul 2018 15:58:29 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id CB4391018F; Wed, 25 Jul 2018 15:58:28 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:57:45 +0200 Message-Id: <9d0693740f659a95ce70119ade0e99da2541995c.1532533587.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 14/39] 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.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.27]); Wed, 25 Jul 2018 15:58:57 +0000 (UTC) X-ZohoMail: 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 --- 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 de056272e8..6103b86478 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: @@ -13161,3 +13172,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 bff293fc0a..57c130c047 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) \ @@ -1064,4 +1067,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 fbfba63fe1..4b681a892e 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -7157,6 +7157,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 Fri May 3 12:53:16 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 1532534328059280.9394447279974; Wed, 25 Jul 2018 08:58:48 -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 B6F0030E4E91; Wed, 25 Jul 2018 15:58:46 +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 7A09560C8F; Wed, 25 Jul 2018 15:58: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 22F4924F59; Wed, 25 Jul 2018 15:58:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwVTG025719 for ; Wed, 25 Jul 2018 11:58:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id B3F0D1018F; Wed, 25 Jul 2018 15:58:31 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3655C7C4B; Wed, 25 Jul 2018 15:58:29 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:57:46 +0200 Message-Id: <070a253e4b4ad5456fc0bd71be7faafc01fea6a0.1532533587.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 15/39] 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.43]); Wed, 25 Jul 2018 15:58:47 +0000 (UTC) X-ZohoMail: 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 --- 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 55f356ef23..cf52f9af5f 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9523,6 +9523,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 @@ -9938,6 +9962,10 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlop= t, goto error; } + if (flags & VIR_DOMAIN_DEF_PARSE_STATUS && + virDomainDiskDefParsePrivateData(ctxt, def, xmlopt) < 0) + goto error; + if (virDomainDiskDefParseValidate(def, vmSeclabels, nvmSeclabels) < 0) goto error; @@ -23878,6 +23906,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, @@ -23991,6 +24048,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 5e2f21dea3..68c24e0748 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 Fri May 3 12:53:16 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 1532534344022301.09327064265506; Wed, 25 Jul 2018 08:59:04 -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 BABEB3001750; Wed, 25 Jul 2018 15:59:02 +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 7E6E560C8F; Wed, 25 Jul 2018 15:59: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 2F5BB245FE; Wed, 25 Jul 2018 15:59:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwWeb025729 for ; Wed, 25 Jul 2018 11:58:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7B2851018F; Wed, 25 Jul 2018 15:58:32 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id F11757C4B; Wed, 25 Jul 2018 15:58:31 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:57:47 +0200 Message-Id: <195cba0b89fedc522378a0fa96c5bfcb2df73cbe.1532533587.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 16/39] 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.46]); Wed, 25 Jul 2018 15:59:03 +0000 (UTC) X-ZohoMail: 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 --- 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 19b73125e1..45fcf18dcb 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -2951,6 +2951,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:

@@ -3150,7 +3155,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 ac04af51a1..7c4e848685 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 + @@ -1711,6 +1724,7 @@ + @@ -1729,6 +1743,7 @@ + @@ -1749,6 +1764,7 @@ + @@ -1762,6 +1778,7 @@ gluster + @@ -1779,6 +1796,7 @@ + @@ -1823,6 +1841,7 @@ + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index cf52f9af5f..5c1842ebb6 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9652,6 +9652,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"); @@ -23648,6 +23655,7 @@ virDomainDiskSourceFormatInternal(virBufferPtr buf, int policy, unsigned int flags, bool skipSeclabels, + bool attrIndex, virDomainXMLOptionPtr xmlopt) { virBuffer attrBuf =3D VIR_BUFFER_INITIALIZER; @@ -23664,6 +23672,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; @@ -23686,7 +23697,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); } @@ -23728,7 +23740,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; @@ -23994,8 +24007,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 Fri May 3 12:53:16 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 1532534338559410.78081826533196; Wed, 25 Jul 2018 08:58:58 -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 2A58130820E8; Wed, 25 Jul 2018 15:58: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 DAA0A5D9CC; Wed, 25 Jul 2018 15:58: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 7F9661800B68; Wed, 25 Jul 2018 15:58:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwXgp025736 for ; Wed, 25 Jul 2018 11:58:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id 67A347C4B; Wed, 25 Jul 2018 15:58:33 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id B843817336; Wed, 25 Jul 2018 15:58:32 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:57:48 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 17/39] 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.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.47]); Wed, 25 Jul 2018 15:58:57 +0000 (UTC) X-ZohoMail: 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 --- 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 b81ad7cdbc..0e1047c6ec 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -20053,7 +20053,6 @@ qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver, virDomainDiskDefPtr disk, virStorageSourcePtr src, size_t block_idx, - unsigned int backing_idx, virHashTablePtr stats, virHashTablePtr nodedata) { @@ -20062,16 +20061,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 */ @@ -20188,16 +20187,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 Fri May 3 12:53:16 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 1532534348909494.6965666917538; Wed, 25 Jul 2018 08:59:08 -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 95ADD3078AA4; Wed, 25 Jul 2018 15:59:01 +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 5E4E3308BDB3; Wed, 25 Jul 2018 15:59: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 12F0C246D7; Wed, 25 Jul 2018 15:59:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwYKN025747 for ; Wed, 25 Jul 2018 11:58:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2E25F7C4B; Wed, 25 Jul 2018 15:58:34 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id A4A531018F; Wed, 25 Jul 2018 15:58:33 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:57:49 +0200 Message-Id: <33983dd29313b4d24af7890a55b4573f8650a354.1532533587.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 18/39] 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.48]); Wed, 25 Jul 2018 15:59:08 +0000 (UTC) X-ZohoMail: 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 6103b86478..9c1a2c6053 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 57c130c047..20208f56f5 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 Fri May 3 12:53:16 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 1532534332677237.27888856990933; Wed, 25 Jul 2018 08:58:52 -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 6412230832F2; Wed, 25 Jul 2018 15:58: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 2EB9CCD656; Wed, 25 Jul 2018 15:58: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 CA1E21800CAD; Wed, 25 Jul 2018 15:58:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwZI2025757 for ; Wed, 25 Jul 2018 11:58:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id E81107C4B; Wed, 25 Jul 2018 15:58:34 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6AAC51018F; Wed, 25 Jul 2018 15:58:34 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:57:50 +0200 Message-Id: <28dc6e9e88832fb87c26961f527143a69b9d784c.1532533587.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 19/39] 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.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.44]); Wed, 25 Jul 2018 15:58:52 +0000 (UTC) X-ZohoMail: 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..be3663f8d2 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_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_FDC: + 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 1538abf155..87efd3b411 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -646,7 +646,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 (qemuDomainPrepareDiskSource(disk, priv, cfg) < 0) --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 12:53:16 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 1532534349470168.70106286988823; Wed, 25 Jul 2018 08:59:09 -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 32AF53082A50; Wed, 25 Jul 2018 15:59:08 +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 DABE2170F1; Wed, 25 Jul 2018 15:59: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 0764E1800B73; Wed, 25 Jul 2018 15:59:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwZo4025765 for ; Wed, 25 Jul 2018 11:58:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id AEA4117336; Wed, 25 Jul 2018 15:58:35 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 30CDF1687E; Wed, 25 Jul 2018 15:58:35 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:57:51 +0200 Message-Id: <66107a87f8bb7ec46871fe6632a7e595a7857eef.1532533587.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 20/39] 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.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]); Wed, 25 Jul 2018 15:59:08 +0000 (UTC) X-ZohoMail: 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 9c1a2c6053..c98be208f1 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 20208f56f5..758ffc0bb9 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 Fri May 3 12:53:16 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 1532534349632837.8058782676418; Wed, 25 Jul 2018 08:59:09 -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 EEF163082134; Wed, 25 Jul 2018 15:58:55 +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 B1B8F6090B; Wed, 25 Jul 2018 15:58:55 +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 58ABF1800B69; Wed, 25 Jul 2018 15:58:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwa0U025772 for ; Wed, 25 Jul 2018 11:58:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id 747E97C4B; Wed, 25 Jul 2018 15:58:36 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB3CC1687E; Wed, 25 Jul 2018 15:58:35 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:57:52 +0200 Message-Id: <0eb319a36f71f1f670441bde826d38a5c397c41a.1532533587.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 21/39] 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.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]); Wed, 25 Jul 2018 15:59:07 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" --- src/qemu/qemu_domain.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++= ++-- 1 file changed, 74 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index c98be208f1..526634d819 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) { @@ -8638,6 +8646,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; @@ -13085,6 +13097,61 @@ 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 && + 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, @@ -13092,8 +13159,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 Fri May 3 12:53:16 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 1532534348750960.1741162706915; Wed, 25 Jul 2018 08:59:08 -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 6BBFEC056783; Wed, 25 Jul 2018 15:59:01 +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 31F66271BB; Wed, 25 Jul 2018 15:59: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 CA1F0249A6; Wed, 25 Jul 2018 15:59:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwblC025779 for ; Wed, 25 Jul 2018 11:58:37 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3AC1B7C56; Wed, 25 Jul 2018 15:58:37 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id B13DD1018F; Wed, 25 Jul 2018 15:58:36 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:57:53 +0200 Message-Id: <696bce1b3af6b881e0305dcfbe1f2cb506750621.1532533587.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 22/39] 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.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 25 Jul 2018 15:59:08 +0000 (UTC) X-ZohoMail: 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 66e6301210..5016c9ba83 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -1743,3 +1743,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 Fri May 3 12:53:16 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 1532534349228721.629592248013; Wed, 25 Jul 2018 08:59:09 -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 5D9FBC04BD47; Wed, 25 Jul 2018 15:59:07 +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 1EFAF2010CDB; Wed, 25 Jul 2018 15:59: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 BD12E1800B72; Wed, 25 Jul 2018 15:59:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwcNY025787 for ; Wed, 25 Jul 2018 11:58:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id 00DA41018F; Wed, 25 Jul 2018 15:58:38 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 775567C4B; Wed, 25 Jul 2018 15:58:37 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:57:54 +0200 Message-Id: <91c0c8b4e90633c0a33b6862fe1e089cfcf435af.1532533587.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 23/39] 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.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 25 Jul 2018 15:59:08 +0000 (UTC) X-ZohoMail: 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 526634d819..ea3929ce7e 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -8676,12 +8676,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 Fri May 3 12:53:16 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 1532534352066693.2192013931328; Wed, 25 Jul 2018 08:59:12 -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 C120C308FB9C; Wed, 25 Jul 2018 15:59:09 +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 8AEF0308BDB1; Wed, 25 Jul 2018 15:59:09 +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 391BB14B09; Wed, 25 Jul 2018 15:59:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwcwN025792 for ; Wed, 25 Jul 2018 11:58:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id BBE0B7C56; Wed, 25 Jul 2018 15:58:38 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3E0067C4B; Wed, 25 Jul 2018 15:58:38 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:57:55 +0200 Message-Id: <1f630ef395c868e56efe9acf61f196891667551f.1532533587.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 24/39] 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.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.43]); Wed, 25 Jul 2018 15:59:11 +0000 (UTC) X-ZohoMail: 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 | 84 ++++++++++++++++++++++++++++++++++++++++++++-= ---- 1 file changed, 76 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index ae45c45b7f..7fa366cd3f 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -2237,6 +2237,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 || @@ -2246,6 +2248,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; } @@ -2256,21 +2274,71 @@ qemuBuildDiskSourceCommandLine(virCommandPtr cmd, virQEMUCapsPtr qemuCaps, bool driveBoot) { - 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, - driveBoot))) - 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, + driveBoot))) + 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 Fri May 3 12:53:16 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 1532534356409316.97655418383977; Wed, 25 Jul 2018 08:59: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 102A6285B4; Wed, 25 Jul 2018 15:59:15 +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 C6FE760BEC; Wed, 25 Jul 2018 15:59:14 +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 5EE9D1800B7C; Wed, 25 Jul 2018 15:59:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwdqJ025802 for ; Wed, 25 Jul 2018 11:58:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id 83DD27C4B; Wed, 25 Jul 2018 15:58:39 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 056FB17336; Wed, 25 Jul 2018 15:58:38 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:57:56 +0200 Message-Id: <22f2aa2244daaa5a77d0939fae4ab2b1cefe0b25.1532533587.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 25/39] 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.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.30]); Wed, 25 Jul 2018 15:59:15 +0000 (UTC) X-ZohoMail: 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 7fa366cd3f..bfd1b99351 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 cf17dc1ede..b8fbbbb92a 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -181,6 +181,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 Fri May 3 12:53:16 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 1532534362849244.47568725333372; Wed, 25 Jul 2018 08:59:22 -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 C109949020; Wed, 25 Jul 2018 15:59:20 +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 84AE6261BE; Wed, 25 Jul 2018 15:59:20 +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 3102F13475; Wed, 25 Jul 2018 15:59:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFweYe025812 for ; Wed, 25 Jul 2018 11:58:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4CD247C56; Wed, 25 Jul 2018 15:58:40 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id C15551018F; Wed, 25 Jul 2018 15:58:39 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:57:57 +0200 Message-Id: <03e5e551daa25de647afd696e2dc3319e3e6c997.1532533587.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 26/39] 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.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 25 Jul 2018 15:59:21 +0000 (UTC) X-ZohoMail: 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 4b681a892e..928036172d 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6233,6 +6233,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: * @@ -6551,6 +6598,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 Fri May 3 12:53:16 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 1532534354891318.8639211874191; Wed, 25 Jul 2018 08:59:14 -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 7B933317C41A; Wed, 25 Jul 2018 15:59: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 36B43173C1; Wed, 25 Jul 2018 15:59: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 D703F14B0F; Wed, 25 Jul 2018 15:59:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwfwV025819 for ; Wed, 25 Jul 2018 11:58:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id 138F47C4B; Wed, 25 Jul 2018 15:58:41 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 899661018F; Wed, 25 Jul 2018 15:58:40 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:57:58 +0200 Message-Id: <564d07276a2761022d5b358fb6657f0460036f1a.1532533587.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 27/39] 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Wed, 25 Jul 2018 15:59:14 +0000 (UTC) X-ZohoMail: 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 0e1047c6ec..8fe51a0067 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -18222,7 +18222,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; @@ -18447,8 +18448,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) @@ -18494,7 +18499,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); @@ -18544,7 +18549,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, cleanup: VIR_FREE(info.group_name); - VIR_FREE(device); + VIR_FREE(drivealias); virDomainObjEndAPI(&vm); if (eventNparams) virTypedParamsFree(eventParams, eventNparams); @@ -18566,7 +18571,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; @@ -18620,10 +18626,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) @@ -18698,7 +18708,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 Fri May 3 12:53:16 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 1532534366361182.90849273144534; Wed, 25 Jul 2018 08:59:26 -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 F1B3081DE1; Wed, 25 Jul 2018 15:59:24 +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 B73E5600C8; Wed, 25 Jul 2018 15:59:24 +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 660A01800B86; Wed, 25 Jul 2018 15:59:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwfPj025829 for ; Wed, 25 Jul 2018 11:58:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id CEEC217336; Wed, 25 Jul 2018 15:58:41 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 50ABA1687E; Wed, 25 Jul 2018 15:58:41 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:57:59 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 28/39] 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.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.25]); Wed, 25 Jul 2018 15:59:25 +0000 (UTC) X-ZohoMail: 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 | 75 ++++++++++++++++++++++++++++++++++++++++-----= ---- 1 file changed, 61 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 87efd3b411..3eddb0043e 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); @@ -505,18 +527,36 @@ qemuHotplugDiskSourceAttachPrepare(virDomainDiskDefPt= r disk, qemuBlockStorageSourceAttachDataPtr backend; qemuHotplugDiskSourceDataPtr data; qemuHotplugDiskSourceDataPtr ret =3D NULL; + virStorageSourcePtr n; if (VIR_ALLOC(data) < 0) return NULL; - if (!(backend =3D qemuBuildStorageSourceAttachPrepareDrive(disk, qemuC= aps, false))) - 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, false))) + 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 Fri May 3 12:53:16 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 1532534372116962.6525421243584; Wed, 25 Jul 2018 08:59:32 -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 8631912C27; Wed, 25 Jul 2018 15:59:30 +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 3416219487; Wed, 25 Jul 2018 15:59:30 +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 CEDE01800543; Wed, 25 Jul 2018 15:59:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwgNe025839 for ; Wed, 25 Jul 2018 11:58:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 958BA7C4B; Wed, 25 Jul 2018 15:58:42 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 17A821687E; Wed, 25 Jul 2018 15:58:41 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:58:00 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 29/39] 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.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.26]); Wed, 25 Jul 2018 15:59:31 +0000 (UTC) X-ZohoMail: 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 ac9cde4577..3b88354f4f 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -4330,6 +4330,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 a25b1f54ea..26405ddd26 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1151,6 +1151,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 f33535327c..8c1db3149e 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -8018,6 +8018,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 78bc16582e..3d1e40b53f 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 6a3d16db71..5a0b64dace 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, @@ -2981,6 +2985,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 Fri May 3 12:53:16 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 1532534378045587.6476005527755; Wed, 25 Jul 2018 08:59:38 -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 1353112C11; Wed, 25 Jul 2018 15:59:36 +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 C97B5608F3; Wed, 25 Jul 2018 15:59:35 +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 73B9D12E2D; Wed, 25 Jul 2018 15:59:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwhRH025844 for ; Wed, 25 Jul 2018 11:58:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5CBB97C56; Wed, 25 Jul 2018 15:58:43 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id D2DA41018F; Wed, 25 Jul 2018 15:58:42 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:58:01 +0200 Message-Id: <33a94e06da8025090aedb0cf1119eda1cb91f967.1532533587.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 30/39] 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 25 Jul 2018 15:59:37 +0000 (UTC) X-ZohoMail: 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 | 93 +++++++++++++++++++++++++++++++++++++++++++++= +++- 1 file changed, 92 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 3eddb0043e..97a486f2ea 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -618,6 +618,93 @@ 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; + + cleanup: + qemuHotplugDiskSourceDataFree(newbackend); + qemuHotplugDiskSourceDataFree(oldbackend); + /* caller handles correct exchange of sources */ + disk->src =3D oldsrc; + return ret; +} + + /** * qemuDomainChangeEjectableMedia: * @driver: qemu driver structure @@ -640,6 +727,7 @@ qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver, virStorageSourcePtr newsrc, bool force) { + qemuDomainObjPrivatePtr priv =3D vm->privateData; int ret =3D -1; int rc; @@ -649,7 +737,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 Fri May 3 12:53:16 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 1532534383241179.00989437426142; Wed, 25 Jul 2018 08:59:43 -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 757DD307CF2F; Wed, 25 Jul 2018 15:59: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 2B6F96016F; Wed, 25 Jul 2018 15:59: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 D54A21800BA6; Wed, 25 Jul 2018 15:59:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwin5025855 for ; Wed, 25 Jul 2018 11:58:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 22DE07C4B; Wed, 25 Jul 2018 15:58:44 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 99AC41018F; Wed, 25 Jul 2018 15:58:43 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:58:02 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 31/39] qemu: monitor: Prepare query-block calls for dropping of -drive 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.44]); Wed, 25 Jul 2018 15:59:42 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Calls to query block organize the data by using the 'device' field in the returned JSON. When -blockdev is used instead of -drive the 'device' field is empty and thus can't be used. This patch allows callers to specify that the 'qdev' field shoudl be usedinstead to refer to the devices by the QOM handle. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 2 +- src/qemu/qemu_monitor.c | 5 +++-- src/qemu/qemu_monitor.h | 3 ++- src/qemu/qemu_monitor_json.c | 33 +++++++++++++++++++++++++++------ src/qemu/qemu_monitor_json.h | 3 ++- src/qemu/qemu_process.c | 2 +- tests/qemumonitorjsontest.c | 2 +- 7 files changed, 37 insertions(+), 13 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 8fe51a0067..9114800821 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -18749,7 +18749,7 @@ qemuDomainGetDiskErrors(virDomainPtr dom, } qemuDomainObjEnterMonitor(driver, vm); - table =3D qemuMonitorGetBlockInfo(priv->mon); + table =3D qemuMonitorGetBlockInfo(priv->mon, false); if (qemuDomainObjExitMonitor(driver, vm) < 0) goto endjob; if (!table) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 3b88354f4f..9d58217376 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2219,7 +2219,8 @@ qemuDomainDiskInfoFree(void *value, const void *name = ATTRIBUTE_UNUSED) virHashTablePtr -qemuMonitorGetBlockInfo(qemuMonitorPtr mon) +qemuMonitorGetBlockInfo(qemuMonitorPtr mon, + bool blockdev) { int ret; virHashTablePtr table; @@ -2229,7 +2230,7 @@ qemuMonitorGetBlockInfo(qemuMonitorPtr mon) if (!(table =3D virHashCreate(32, qemuDomainDiskInfoFree))) return NULL; - ret =3D qemuMonitorJSONGetBlockInfo(mon, table); + ret =3D qemuMonitorJSONGetBlockInfo(mon, table, blockdev); if (ret < 0) { virHashFree(table); diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 26405ddd26..3e902e1e8b 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -561,7 +561,8 @@ int qemuMonitorSetMemoryStatsPeriod(qemuMonitorPtr mon, int period); int qemuMonitorBlockIOStatusToError(const char *status); -virHashTablePtr qemuMonitorGetBlockInfo(qemuMonitorPtr mon); +virHashTablePtr qemuMonitorGetBlockInfo(qemuMonitorPtr mon, + bool blockdev); virJSONValuePtr qemuMonitorQueryBlockstats(qemuMonitorPtr mon, bool nodenames); diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 8c1db3149e..6d76f4a2d5 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2187,11 +2187,12 @@ qemuMonitorJSONGetBlockDev(virJSONValuePtr devices, static const char * -qemuMonitorJSONGetBlockDevDevice(virJSONValuePtr dev) +qemuMonitorJSONGetBlockDevName(virJSONValuePtr dev, + const char *key) { const char *thisdev; - if (!(thisdev =3D virJSONValueObjectGetString(dev, "device"))) { + if (!(thisdev =3D virJSONValueObjectGetString(dev, key))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("query-block device entry was not in expected for= mat")); return NULL; @@ -2201,8 +2202,23 @@ qemuMonitorJSONGetBlockDevDevice(virJSONValuePtr dev) } +static const char * +qemuMonitorJSONGetBlockDevDevice(virJSONValuePtr dev) +{ + return qemuMonitorJSONGetBlockDevName(dev, "device"); +} + + +static const char * +qemuMonitorJSONGetBlockDevQdev(virJSONValuePtr dev) +{ + return qemuMonitorJSONGetBlockDevName(dev, "qdev"); +} + + int qemuMonitorJSONGetBlockInfo(qemuMonitorPtr mon, - virHashTablePtr table) + virHashTablePtr table, + bool blockdev) { int ret =3D -1; size_t i; @@ -2223,10 +2239,15 @@ int qemuMonitorJSONGetBlockInfo(qemuMonitorPtr mon, if (!(dev =3D qemuMonitorJSONGetBlockDev(devices, i))) goto cleanup; - if (!(thisdev =3D qemuMonitorJSONGetBlockDevDevice(dev))) - goto cleanup; + if (blockdev) { + if (!(thisdev =3D qemuMonitorJSONGetBlockDevQdev(dev))) + goto cleanup; + } else { + if (!(thisdev =3D qemuMonitorJSONGetBlockDevDevice(dev))) + goto cleanup; - thisdev =3D qemuAliasDiskDriveSkipPrefix(thisdev); + thisdev =3D qemuAliasDiskDriveSkipPrefix(thisdev); + } if (VIR_ALLOC(info) < 0) goto cleanup; diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 3d1e40b53f..7cdec6e231 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -84,7 +84,8 @@ int qemuMonitorJSONSetMemoryStatsPeriod(qemuMonitorPtr mo= n, char *balloonpath, int period); int qemuMonitorJSONGetBlockInfo(qemuMonitorPtr mon, - virHashTablePtr table); + virHashTablePtr table, + bool blockdev); virJSONValuePtr qemuMonitorJSONQueryBlockstats(qemuMonitorPtr mon, bool nodenames); diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 928036172d..2c3133d678 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -7564,7 +7564,7 @@ qemuProcessRefreshDisks(virQEMUDriverPtr driver, size_t i; if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) =3D=3D 0) { - table =3D qemuMonitorGetBlockInfo(priv->mon); + table =3D qemuMonitorGetBlockInfo(priv->mon, false); if (qemuDomainObjExitMonitor(driver, vm) < 0) goto cleanup; } diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 5a0b64dace..526b1f87f2 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1660,7 +1660,7 @@ testQemuMonitorJSONqemuMonitorJSONGetBlockInfo(const = void *data) if (qemuMonitorTestAddItem(test, "query-block", queryBlockReply) < 0) goto cleanup; - if (qemuMonitorJSONGetBlockInfo(qemuMonitorTestGetMonitor(test), block= Devices) < 0) + if (qemuMonitorJSONGetBlockInfo(qemuMonitorTestGetMonitor(test), block= Devices, false) < 0) goto cleanup; if (!virHashEqual(blockDevices, expectedBlockDevices, testHashEqualQem= uDomainDiskInfo)) { --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 12:53:16 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 1532534359965955.0331051051095; Wed, 25 Jul 2018 08:59: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 A3D8812C02; Wed, 25 Jul 2018 15:59: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 6DBC23001A72; Wed, 25 Jul 2018 15:59: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 0A48A14B13; Wed, 25 Jul 2018 15:59:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwjjh025865 for ; Wed, 25 Jul 2018 11:58:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id DDBC71684A; Wed, 25 Jul 2018 15:58:44 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 602051687E; Wed, 25 Jul 2018 15:58:44 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:58:03 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 32/39] 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.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.26]); Wed, 25 Jul 2018 15:59:19 +0000 (UTC) X-ZohoMail: 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 | 11 +++++++++-- src/qemu/qemu_process.c | 9 +++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 9114800821..9a3c4289ba 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -18723,6 +18723,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; @@ -18733,6 +18734,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; @@ -18749,7 +18751,7 @@ qemuDomainGetDiskErrors(virDomainPtr dom, } qemuDomainObjEnterMonitor(driver, vm); - table =3D qemuMonitorGetBlockInfo(priv->mon, false); + table =3D qemuMonitorGetBlockInfo(priv->mon, blockdev); if (qemuDomainObjExitMonitor(driver, vm) < 0) goto endjob; if (!table) @@ -18758,8 +18760,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 2c3133d678..b8724b68ae 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -7559,12 +7559,13 @@ 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; if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) =3D=3D 0) { - table =3D qemuMonitorGetBlockInfo(priv->mon, false); + table =3D qemuMonitorGetBlockInfo(priv->mon, blockdev); if (qemuDomainObjExitMonitor(driver, vm) < 0) goto cleanup; } @@ -7576,8 +7577,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 Fri May 3 12:53:16 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 1532534355894699.8521872226801; Wed, 25 Jul 2018 08:59:15 -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 0FE5D81DFC; Wed, 25 Jul 2018 15:59: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 C5D325D6A8; Wed, 25 Jul 2018 15:59: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 68FB714B0C; Wed, 25 Jul 2018 15:59:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwjMj025871 for ; Wed, 25 Jul 2018 11:58:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id A3B9E7C56; Wed, 25 Jul 2018 15:58:45 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2671C1687E; Wed, 25 Jul 2018 15:58:45 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:58:04 +0200 Message-Id: <652fe83a42ad0d1218c7198ad05a87550a3cc9cd.1532533587.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 33/39] qemu: monitor: Add API to retrieve blockstats by nodenames 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.25]); Wed, 25 Jul 2018 15:59:15 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Add workers that allow collecting the 'blockstats' from qemu by nodename. This will replace the old usage when using -blockdev as query-blockstats does not report anything when using the old approach. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.c | 25 ++++++++++++++++ src/qemu/qemu_monitor.h | 6 ++++ src/qemu/qemu_monitor_json.c | 69 ++++++++++++++++++++++++++++++++++++++++= ++++ src/qemu/qemu_monitor_json.h | 4 +++ 4 files changed, 104 insertions(+) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 9d58217376..bc9c7d53b0 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2300,6 +2300,31 @@ qemuMonitorGetAllBlockStatsInfo(qemuMonitorPtr mon, } +int +qemuMonitorGetBlockStatsInfo(qemuMonitorPtr mon, + virHashTablePtr *ret_stats, + int *nstats) +{ + virHashTablePtr hash =3D NULL; + int ret =3D -1; + + QEMU_CHECK_MONITOR(mon); + + if (!(hash =3D virHashCreate(10, virHashValueFree))) + goto cleanup; + + if (qemuMonitorJSONGetBlockStatsInfo(mon, hash, nstats) < 0) + goto cleanup; + + VIR_STEAL_PTR(*ret_stats, hash); + ret =3D 0; + + cleanup: + virHashFree(hash); + return ret; +} + + /* Updates "stats" to fill virtual and physical size of the image */ int qemuMonitorBlockStatsUpdateCapacity(qemuMonitorPtr mon, diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 3e902e1e8b..8ede11c82c 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -592,6 +592,12 @@ int qemuMonitorGetAllBlockStatsInfo(qemuMonitorPtr mon, bool backingChain) ATTRIBUTE_NONNULL(2); +int +qemuMonitorGetBlockStatsInfo(qemuMonitorPtr mon, + virHashTablePtr *ret_stats, + int *nstats) + ATTRIBUTE_NONNULL(2); + int qemuMonitorBlockStatsUpdateCapacity(qemuMonitorPtr mon, virHashTablePtr stats, bool backingChain) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 6d76f4a2d5..02a3f09a8b 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2467,6 +2467,75 @@ qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr m= on, } +struct qemuMonitorJSONGetBlockstatsInfoArrayWorkerData { + virHashTablePtr hash; + int nstats; +}; + + +static int +qemuMonitorJSONGetBlockStatsInfoArrayWorker(size_t pos ATTRIBUTE_UNUSED, + virJSONValuePtr val, + void *opaque) +{ + struct qemuMonitorJSONGetBlockstatsInfoArrayWorkerData *data =3D opaqu= e; + qemuBlockStatsPtr bstats =3D NULL; + const char *nodename; + int nstats =3D 0; + int ret =3D -1; + + if (!(nodename =3D virJSONValueObjectGetString(val, "node-name"))) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("missing node name in query-blockstats reply")); + return -1; + } + + if (!(bstats =3D qemuMonitorJSONBlockStatsCollectData(val, &nstats))) + goto cleanup; + + if (nstats > data->nstats) + data->nstats =3D nstats; + + if (virHashAddEntry(data->hash, nodename, bstats) < 0) + goto cleanup; + bstats =3D NULL; + + ret =3D 1; /* we don't want to steal the value from the JSON array */ + + cleanup: + VIR_FREE(bstats); + return ret; +} + + +int +qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon, + virHashTablePtr hash, + int *nstats) +{ + struct qemuMonitorJSONGetBlockstatsInfoArrayWorkerData data =3D { hash= , 0 }; + virJSONValuePtr devices; + int ret =3D -1; + + if (!(devices =3D qemuMonitorJSONQueryBlockstats(mon, true))) + return -1; + + if (virJSONValueArrayForeachSteal(devices, + qemuMonitorJSONGetBlockStatsInfoArra= yWorker, + &data) < 0) + goto cleanup; + + if (nstats) + *nstats =3D data.nstats; + + ret =3D 0; + + cleanup: + virJSONValueFree(devices); + return ret; +} + + static int qemuMonitorJSONBlockStatsUpdateCapacityData(virJSONValuePtr image, const char *name, diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 7cdec6e231..6042f7161f 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -95,6 +95,10 @@ int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr m= on, int qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitorPtr mon, virHashTablePtr stats, bool backingChain); +int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon, + virHashTablePtr hash, + int *nstats); + int qemuMonitorJSONBlockResize(qemuMonitorPtr mon, const char *devce, unsigned long long size); --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 12:53:16 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 1532534389975881.605321836461; Wed, 25 Jul 2018 08:59:49 -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 C96B43082140; Wed, 25 Jul 2018 15:59:46 +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 85E902010CDA; Wed, 25 Jul 2018 15:59: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 3B9591800FEB; Wed, 25 Jul 2018 15:59:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwk6Y025887 for ; Wed, 25 Jul 2018 11:58:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6CB007C56; Wed, 25 Jul 2018 15:58:46 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id E19B31018F; Wed, 25 Jul 2018 15:58:45 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:58:05 +0200 Message-Id: <0870a57ad73146f159946588caf8b9c4790d2448.1532533587.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 34/39] 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.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.42]); Wed, 25 Jul 2018 15:59:49 +0000 (UTC) X-ZohoMail: 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 | 2 ++ 4 files changed, 63 insertions(+) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index bc9c7d53b0..a69fbb0749 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2339,6 +2339,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 8ede11c82c..d1a8f899d7 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -603,6 +603,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 *dev_name, unsigned long long size); diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 02a3f09a8b..820e669d16 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2639,6 +2639,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; +} + + /* Return 0 on success, -1 on failure, or -2 if not supported. Size * is in bytes. */ int qemuMonitorJSONBlockResize(qemuMonitorPtr mon, diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 6042f7161f..ebf4d4e78b 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -95,6 +95,8 @@ int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mo= n, int qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitorPtr mon, virHashTablePtr stats, bool backingChain); +int qemuMonitorJSONBlockStatsUpdateCapacityBlockdev(qemuMonitorPtr mon, + virHashTablePtr stats); int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon, virHashTablePtr hash, int *nstats); --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 12:53:16 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 1532534360905699.497888570528; Wed, 25 Jul 2018 08:59:20 -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 8E52C308A955; Wed, 25 Jul 2018 15:59: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 481BB173C1; Wed, 25 Jul 2018 15:59:19 +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 E9B4414B14; Wed, 25 Jul 2018 15:59:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwl70025893 for ; Wed, 25 Jul 2018 11:58:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id 33D947C4B; Wed, 25 Jul 2018 15:58:47 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id A9E1A1018F; Wed, 25 Jul 2018 15:58:46 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:58:06 +0200 Message-Id: <26678965f6634abc007d504a82cc968f28b265df.1532533587.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 35/39] 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.41]); Wed, 25 Jul 2018 15:59:20 +0000 (UTC) X-ZohoMail: 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 9a3c4289ba..ebcfdeb417 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -20067,7 +20067,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, @@ -20075,13 +20076,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); @@ -20100,7 +20097,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; } @@ -20146,7 +20143,6 @@ qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver, ret =3D 0; cleanup: - VIR_FREE(alias); return ret; } @@ -20171,6 +20167,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); @@ -20207,10 +20204,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; } @@ -20220,6 +20225,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 Fri May 3 12:53:16 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 1532534394228983.7955242492443; Wed, 25 Jul 2018 08:59:54 -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 04608164D; Wed, 25 Jul 2018 15:59: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 48F1A271BB; Wed, 25 Jul 2018 15:59: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 DC37312DE5; Wed, 25 Jul 2018 15:59:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwn1X025909 for ; Wed, 25 Jul 2018 11:58:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9524C17336; Wed, 25 Jul 2018 15:58:49 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 169801684A; Wed, 25 Jul 2018 15:58:47 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:58:07 +0200 Message-Id: <92deb4d1362cad71b7bdf8ae5ddfa1d29969d071.1532533587.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 36/39] 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.30]); Wed, 25 Jul 2018 15:59:53 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Use the new monitor APIs to collect the data per blockdev when using the new approach and add a new totalization function. The data is reported for the 'format' layer. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 83 +++++++++++++++++++++++++++++++++++-----------= ---- 1 file changed, 59 insertions(+), 24 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index ebcfdeb417..994625d305 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -11030,14 +11030,10 @@ qemuDomainBlockResize(virDomainPtr dom, } -static int -qemuDomainBlockStatsGatherTotals(void *payload, - const void *name ATTRIBUTE_UNUSED, - void *opaque) +static void +qemuDomainBlockStatsGatherTotalsData(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 @@ -11051,6 +11047,30 @@ qemuDomainBlockStatsGatherTotals(void *payload, QEMU_BLOCK_STAT_TOTAL(rd_total_times); QEMU_BLOCK_STAT_TOTAL(flush_total_times); #undef QEMU_BLOCK_STAT_TOTAL +} + + +static int +qemuDomainBlockStatsGatherTotals(void *payload, + const void *name ATTRIBUTE_UNUSED, + void *opaque) +{ + qemuDomainBlockStatsGatherTotalsData(payload, opaque); + return 0; +} + + +static int +qemuDomainBlockStatsGatherTotalsBlockdev(void *payload, + const void *name, + void *opaque) +{ + const char *nodename =3D name; + + if (!strstr(nodename, "-format")) + return 0; + + qemuDomainBlockStatsGatherTotalsData(payload, opaque); return 0; } @@ -11079,7 +11099,8 @@ qemuDomainBlocksStatsGather(virQEMUDriverPtr driver, virHashTablePtr blockstats =3D NULL; qemuBlockStatsPtr stats; int nstats; - char *diskAlias =3D NULL; + const char *entryname =3D NULL; + bool blockdev =3D virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); int ret =3D -1; if (*path) { @@ -11088,22 +11109,34 @@ 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 disk->src->nodeformat; + } else { + if (!disk->info.alias) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("missing disk device alias name for %s"),= disk->dst); + goto cleanup; + } - if (VIR_STRDUP(diskAlias, disk->info.alias) < 0) - goto cleanup; + entryname =3D disk->info.alias; + } } qemuDomainObjEnterMonitor(driver, vm); - nstats =3D qemuMonitorGetAllBlockStatsInfo(priv->mon, &blockstats, fal= se); + if (blockdev) { + if (qemuMonitorGetBlockStatsInfo(priv->mon, &blockstats, &nstats) = < 0) + nstats =3D -1; - if (capacity && nstats >=3D 0 && - qemuMonitorBlockStatsUpdateCapacity(priv->mon, blockstats, false) = < 0) - nstats =3D -1; + if (capacity && nstats >=3D 0 && + qemuMonitorBlockStatsUpdateCapacityBlockdev(priv->mon, blockst= ats) < 0) + nstats =3D -1; + } else { + nstats =3D qemuMonitorGetAllBlockStatsInfo(priv->mon, &blockstats,= false); + + if (capacity && nstats >=3D 0 && + qemuMonitorBlockStatsUpdateCapacity(priv->mon, blockstats, fal= se) < 0) + nstats =3D -1; + } if (qemuDomainObjExitMonitor(driver, vm) < 0 || nstats < 0) goto cleanup; @@ -11111,22 +11144,24 @@ 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; } **retstats =3D *stats; } else { - virHashForEach(blockstats, qemuDomainBlockStatsGatherTotals, *rets= tats); + if (blockdev) + virHashForEach(blockstats, qemuDomainBlockStatsGatherTotalsBlo= ckdev, *retstats); + else + virHashForEach(blockstats, qemuDomainBlockStatsGatherTotals, *= retstats); } 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 Fri May 3 12:53:16 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 1532534366334112.940681807504; Wed, 25 Jul 2018 08:59:26 -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 CC78381119; Wed, 25 Jul 2018 15:59:24 +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 86394608F3; Wed, 25 Jul 2018 15:59:24 +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 3B0791800B84; Wed, 25 Jul 2018 15:59:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwooV025919 for ; Wed, 25 Jul 2018 11:58:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5CF827C56; Wed, 25 Jul 2018 15:58:50 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id D1DA01684A; Wed, 25 Jul 2018 15:58:49 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:58:08 +0200 Message-Id: <7f964ca2038980633370b5915dbdd659731a854f.1532533587.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 37/39] 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 25 Jul 2018 15:59:25 +0000 (UTC) X-ZohoMail: 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 994625d305..4f25471c4a 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -20070,29 +20070,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; } @@ -20106,8 +20116,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; @@ -20172,9 +20181,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: @@ -20245,9 +20254,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 d1a8f899d7..631ca732b3 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -585,6 +585,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 820e669d16..3c67f5793b 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2539,7 +2539,8 @@ qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon, static int qemuMonitorJSONBlockStatsUpdateCapacityData(virJSONValuePtr image, const char *name, - virHashTablePtr stats) + virHashTablePtr stats, + qemuBlockStatsPtr *entry) { qemuBlockStatsPtr bstats; @@ -2553,6 +2554,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) @@ -2578,7 +2582,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 && @@ -2647,6 +2652,8 @@ qemuMonitorJSONBlockStatsUpdateCapacityBlockdevWorker= (size_t pos ATTRIBUTE_UNUSE virHashTablePtr stats =3D opaque; virJSONValuePtr image; const char *nodename; + qemuBlockStatsPtr entry; + unsigned long long tmp; if (!(nodename =3D virJSONValueObjectGetString(val, "node-name")) || !(image =3D virJSONValueObjectGetObject(val, "image"))) { @@ -2655,9 +2662,12 @@ 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 (virJSONValueObjectGetNumberUlong(val, "write_threshold", &tmp) =3D= =3D 0) + entry->write_threshold =3D tmp; + 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 Fri May 3 12:53:16 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 1532534364525517.3192402893606; Wed, 25 Jul 2018 08:59:24 -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 31C6181117; Wed, 25 Jul 2018 15:59: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 F2FC4CD652; Wed, 25 Jul 2018 15:59: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 9F1EF1800B80; Wed, 25 Jul 2018 15:59:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwpCM025934 for ; Wed, 25 Jul 2018 11:58:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 24EE67C4B; Wed, 25 Jul 2018 15:58:51 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9A7261018F; Wed, 25 Jul 2018 15:58:50 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:58:09 +0200 Message-Id: <2fdf201fba0d8694eb9e944a927b9cd47c95865c.1532533587.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 38/39] 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.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 25 Jul 2018 15:59:23 +0000 (UTC) X-ZohoMail: 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 | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 4f25471c4a..8755bd1652 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -20206,6 +20206,7 @@ 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); int count_index =3D -1; @@ -20215,14 +20216,24 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver, 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)= ); - if (fetchnodedata) - nodedata =3D qemuMonitorQueryNamedBlockNodes(priv->mon); + if (blockdev) { + fetchnodedata =3D false; + + rc =3D qemuMonitorGetBlockStatsInfo(priv->mon, &stats, NULL); + + if (rc >=3D 0) + rc =3D qemuMonitorBlockStatsUpdateCapacityBlockdev(priv->m= on, stats); + } else { + rc =3D qemuMonitorGetAllBlockStatsInfo(priv->mon, &stats, + visitBacking); + if (rc >=3D 0) + ignore_value(qemuMonitorBlockStatsUpdateCapacity(priv->mon= , stats, + visitBack= ing)); + + if (fetchnodedata) + nodedata =3D qemuMonitorQueryNamedBlockNodes(priv->mon); + } if (qemuDomainObjExitMonitor(driver, dom) < 0) goto cleanup; @@ -20249,12 +20260,17 @@ 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 (blockdev) { + if (VIR_STRDUP(alias, src->nodeformat) < 0) + goto cleanup; + } else { + /* alias may be NULL if the VM is not running */ + if (disk->info.alias && + !(alias =3D qemuDomainStorageAlias(disk->info.alias, s= rc->id))) + goto cleanup; - qemuDomainGetStatsOneBlockRefreshNamed(src, alias, stats, node= stats); + qemuDomainGetStatsOneBlockRefreshNamed(src, alias, stats, = nodestats); + } if (qemuDomainGetStatsOneBlock(driver, cfg, dom, record, maxpa= rams, disk->dst, alias, src, visited, --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 12:53:16 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 153253437108724.761721464942752; Wed, 25 Jul 2018 08:59: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 30462307C708; Wed, 25 Jul 2018 15:59:29 +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 E2C2E170F1; Wed, 25 Jul 2018 15:59: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 87DEF12E2F; Wed, 25 Jul 2018 15:59:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PFwq4g025944 for ; Wed, 25 Jul 2018 11:58:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id 675A87C4B; Wed, 25 Jul 2018 15:58:52 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 624D31018F; Wed, 25 Jul 2018 15:58:51 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Jul 2018 17:58:10 +0200 Message-Id: <2afa9727e874c1f24de97a84cab0ed6dbf6c3c69.1532533587.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC 39/39] DO NOT APPLY: Enable QEMU_CAPS_BLOCKDEV if 'copy-on-read' is supported 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.42]); Wed, 25 Jul 2018 15:59:29 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Use the 'copy-on-read' block drive in qemu as a witness to enable the blockdev functionality and adapt the test files for the new output. 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.ppc64.xml | 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-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 ++- 22 files changed, 495 insertions(+), 218 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 6b4c14ac50..f439271ac6 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1309,6 +1309,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 }, + { "blockdev-add/arg-type/+copy-on-read/file", QEMU_CAPS_BLOCKDEV }, }; typedef struct _virQEMUCapsObjectTypeProps virQEMUCapsObjectTypeProps; diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml b/tests/qemuca= pabilitiesdata/caps_3.0.0.ppc64.xml index 01bb968938..01d9b684db 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml @@ -169,6 +169,7 @@ + 2012050 0 446771 diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_3.0.0.x86_64.xml index 4bc7cfeebc..f5d55dde4b 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml @@ -216,6 +216,7 @@ + 2012090 0 438109 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-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 \ --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list