From nobody Tue Nov 4 08:12:01 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504114772614825.1791268856856; Wed, 30 Aug 2017 10:39:32 -0700 (PDT) Received: from localhost ([::1]:51846 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dn6xd-0001rw-Nk for importer@patchew.org; Wed, 30 Aug 2017 13:39:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dn6NG-0001bv-U5 for qemu-devel@nongnu.org; Wed, 30 Aug 2017 13:02:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dn6NG-0000ML-1V for qemu-devel@nongnu.org; Wed, 30 Aug 2017 13:01:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59406) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dn6ND-0000LX-Ke; Wed, 30 Aug 2017 13:01:51 -0400 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 836AD4ACC7; Wed, 30 Aug 2017 17:01:50 +0000 (UTC) Received: from localhost (ovpn-116-70.phx2.redhat.com [10.3.116.70]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C2BD887FAE; Wed, 30 Aug 2017 17:01:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 836AD4ACC7 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jcody@redhat.com From: Jeff Cody To: qemu-devel@nongnu.org Date: Wed, 30 Aug 2017 13:01:40 -0400 Message-Id: In-Reply-To: References: In-Reply-To: References: 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.38]); Wed, 30 Aug 2017 17:01:50 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 1/3] configure: Add option in configure to disable live block ops X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, qemu-block@nongnu.org, dgilbert@redhat.com, peterx@redhat.com, mrezanin@redhat.com, jsnow@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Jeffrey Cody This adds in the option to disable the live block operations. The resultant config option is not checked until subsequent patches. Signed-off-by: Jeff Cody Reviewed-by: Eric Blake --- configure | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/configure b/configure index dd73cce..24bde07 100755 --- a/configure +++ b/configure @@ -400,6 +400,7 @@ virglrenderer=3D"" tpm=3D"yes" libssh2=3D"" live_block_migration=3D"yes" +live_block_ops=3D"yes" numa=3D"" tcmalloc=3D"no" jemalloc=3D"no" @@ -1263,6 +1264,10 @@ for opt do ;; --enable-live-block-migration) live_block_migration=3D"yes" ;; + --disable-live-block-ops) live_block_ops=3D"no" + ;; + --enable-live-block-ops) live_block_ops=3D"yes" + ;; --disable-numa) numa=3D"no" ;; --enable-numa) numa=3D"yes" @@ -1513,6 +1518,7 @@ disabled with --disable-FEATURE, default is enabled i= f available: smartcard smartcard support (libcacard) libusb libusb (for usb passthrough) live-block-migration Block migration in the main migration stream + live-block-ops live block operations support usb-redir usb network redirection support lzo support of lzo compression library snappy support of snappy compression library @@ -5398,6 +5404,7 @@ echo "libssh2 support $libssh2" echo "TPM passthrough $tpm_passthrough" echo "QOM debugging $qom_cast_debug" echo "Live block migration $live_block_migration" +echo "Live block ops $live_block_ops" echo "lzo support $lzo" echo "snappy support $snappy" echo "bzip2 support $bzip2" @@ -5976,6 +5983,10 @@ if test "$live_block_migration" =3D "yes" ; then echo "CONFIG_LIVE_BLOCK_MIGRATION=3Dy" >> $config_host_mak fi =20 +if test "$live_block_ops" =3D "yes" ; then + echo "CONFIG_LIVE_BLOCK_OPS=3Dy" >> $config_host_mak +fi + # USB host support if test "$libusb" =3D "yes"; then echo "HOST_USB=3Dlibusb legacy" >> $config_host_mak --=20 2.9.5 From nobody Tue Nov 4 08:12:01 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504115166490261.16494819352647; Wed, 30 Aug 2017 10:46:06 -0700 (PDT) Received: from localhost ([::1]:51899 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dn740-0000Yr-K9 for importer@patchew.org; Wed, 30 Aug 2017 13:46:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60004) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dn6NV-0001pZ-Oq for qemu-devel@nongnu.org; Wed, 30 Aug 2017 13:02:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dn6NR-0000P3-6v for qemu-devel@nongnu.org; Wed, 30 Aug 2017 13:02:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59536) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dn6NH-0000MX-3s; Wed, 30 Aug 2017 13:01:55 -0400 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 0CCE44A70F; Wed, 30 Aug 2017 17:01:54 +0000 (UTC) Received: from localhost (ovpn-116-70.phx2.redhat.com [10.3.116.70]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2EBE05DD64; Wed, 30 Aug 2017 17:01:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0CCE44A70F Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jcody@redhat.com From: Jeff Cody To: qemu-devel@nongnu.org Date: Wed, 30 Aug 2017 13:01:41 -0400 Message-Id: In-Reply-To: References: In-Reply-To: References: 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.38]); Wed, 30 Aug 2017 17:01:54 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 2/3] block-jobs: Optionally unregister live block operations X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, qemu-block@nongnu.org, dgilbert@redhat.com, peterx@redhat.com, mrezanin@redhat.com, jsnow@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Jeffrey Cody If configured without live block operations enabled, unregister the live block operation commands. Signed-off-by: Jeff Cody Reviewed-by: Eric Blake --- monitor.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/monitor.c b/monitor.c index e0f8801..de0a70e 100644 --- a/monitor.c +++ b/monitor.c @@ -998,6 +998,22 @@ static void qmp_unregister_commands_hack(void) && !defined(TARGET_S390X) qmp_unregister_command(&qmp_commands, "query-cpu-definitions"); #endif +#ifndef CONFIG_LIVE_BLOCK_OPS + qmp_unregister_command(&qmp_commands, "block-stream"); + qmp_unregister_command(&qmp_commands, "block-commit"); + qmp_unregister_command(&qmp_commands, "drive-mirror"); + qmp_unregister_command(&qmp_commands, "blockdev-mirror"); + qmp_unregister_command(&qmp_commands, "drive-backup"); + qmp_unregister_command(&qmp_commands, "blockdev-backup"); + qmp_unregister_command(&qmp_commands, "blockdev-snapshot"); + qmp_unregister_command(&qmp_commands, "blockdev-snapshot-sync"); + qmp_unregister_command(&qmp_commands, "block-job-set-speed"); + qmp_unregister_command(&qmp_commands, "block-job-cancel"); + qmp_unregister_command(&qmp_commands, "block-job-pause"); + qmp_unregister_command(&qmp_commands, "block-job-resume"); + qmp_unregister_command(&qmp_commands, "block-job-complete"); + qmp_unregister_command(&qmp_commands, "query-block-jobs"); +#endif } =20 void monitor_init_qmp_commands(void) --=20 2.9.5 From nobody Tue Nov 4 08:12:01 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504114920786297.29920478379336; Wed, 30 Aug 2017 10:42:00 -0700 (PDT) Received: from localhost ([::1]:51863 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dn702-0004Pj-LO for importer@patchew.org; Wed, 30 Aug 2017 13:41:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60067) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dn6Nd-0001wo-3y for qemu-devel@nongnu.org; Wed, 30 Aug 2017 13:02:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dn6Nc-0000SM-6g for qemu-devel@nongnu.org; Wed, 30 Aug 2017 13:02:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42802) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dn6NO-0000OI-09; Wed, 30 Aug 2017 13:02:02 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DF3F1C0587D1; Wed, 30 Aug 2017 17:02:00 +0000 (UTC) Received: from localhost (ovpn-116-70.phx2.redhat.com [10.3.116.70]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AB89D6951F; Wed, 30 Aug 2017 17:01:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DF3F1C0587D1 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jcody@redhat.com From: Jeff Cody To: qemu-devel@nongnu.org Date: Wed, 30 Aug 2017 13:01:42 -0400 Message-Id: <8a9d17a953caedcb66655d945181457eccde9acd.1504112256.git.jcody@redhat.com> In-Reply-To: References: In-Reply-To: References: 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.32]); Wed, 30 Aug 2017 17:02:01 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 3/3] hmp: Optionally disable live block operations in HMP monitor X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, qemu-block@nongnu.org, dgilbert@redhat.com, peterx@redhat.com, mrezanin@redhat.com, jsnow@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Jeffrey Cody If live block operations are disabled, disable the corresponding HMP commands. Signed-off-by: Jeff Cody Reviewed-by: Eric Blake --- hmp-commands-info.hx | 4 ++++ hmp-commands.hx | 12 ++++++++++++ hmp.c | 12 ++++++++++++ 3 files changed, 28 insertions(+) diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index d9df238..0967e41 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -84,6 +84,8 @@ STEXI Show block device statistics. ETEXI =20 +#ifdef CONFIG_LIVE_BLOCK_OPS + { .name =3D "block-jobs", .args_type =3D "", @@ -98,6 +100,8 @@ STEXI Show progress of ongoing block device operations. ETEXI =20 +#endif /* CONFIG_LIVE_BLOCK_OPS */ + { .name =3D "registers", .args_type =3D "cpustate_all:-a", diff --git a/hmp-commands.hx b/hmp-commands.hx index 1941e19..2d137a1 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -73,6 +73,8 @@ but should be used with extreme caution. Note that this = command only resizes image files, it can not resize block devices like LVM volumes. ETEXI =20 +#ifdef CONFIG_LIVE_BLOCK_OPS + { .name =3D "block_stream", .args_type =3D "device:B,speed:o?,base:s?", @@ -159,6 +161,8 @@ STEXI Resume a paused block streaming operation. ETEXI =20 +#endif /* CONFIG_LIVE_BLOCK_OPS */ + { .name =3D "eject", .args_type =3D "force:-f,device:B", @@ -1169,6 +1173,8 @@ STEXI Enables or disables migration mode. ETEXI =20 +#ifdef CONFIG_LIVE_BLOCK_OPS + { .name =3D "snapshot_blkdev", .args_type =3D "reuse:-n,device:B,snapshot-file:s?,format:s?", @@ -1190,6 +1196,8 @@ STEXI Snapshot device, using snapshot file as target if provided ETEXI =20 +#endif /* CONFIG_LIVE_BLOCK_OPS */ + { .name =3D "snapshot_blkdev_internal", .args_type =3D "device:B,name:s", @@ -1224,6 +1232,8 @@ STEXI Delete an internal snapshot on device if it support ETEXI =20 +#ifdef CONFIG_LIVE_BLOCK_OPS + { .name =3D "drive_mirror", .args_type =3D "reuse:-n,full:-f,device:B,target:s,format:s?", @@ -1267,6 +1277,8 @@ STEXI Start a point-in-time copy of a block device to a specificed target. ETEXI =20 +#endif /* CONFIG_LIVE_BLOCK_OPS */ + { .name =3D "drive_add", .args_type =3D "node:-n,pci_addr:s,opts:s", diff --git a/hmp.c b/hmp.c index fd80dce..ab985c6 100644 --- a/hmp.c +++ b/hmp.c @@ -951,6 +951,8 @@ void hmp_info_pci(Monitor *mon, const QDict *qdict) qapi_free_PciInfoList(info_list); } =20 +#ifdef CONFIG_LIVE_BLOCK_OPS + void hmp_info_block_jobs(Monitor *mon, const QDict *qdict) { BlockJobInfoList *list; @@ -989,6 +991,8 @@ void hmp_info_block_jobs(Monitor *mon, const QDict *qdi= ct) qapi_free_BlockJobInfoList(list); } =20 +#endif /* CONFIG_LIVE_BLOCK_OPS */ + void hmp_info_tpm(Monitor *mon, const QDict *qdict) { TPMInfoList *info_list, *info; @@ -1197,6 +1201,8 @@ void hmp_block_resize(Monitor *mon, const QDict *qdic= t) hmp_handle_error(mon, &err); } =20 +#ifdef CONFIG_LIVE_BLOCK_OPS + void hmp_drive_mirror(Monitor *mon, const QDict *qdict) { const char *filename =3D qdict_get_str(qdict, "target"); @@ -1280,6 +1286,8 @@ void hmp_snapshot_blkdev(Monitor *mon, const QDict *q= dict) hmp_handle_error(mon, &err); } =20 +#endif /* CONFIG_LIVE_BLOCK_OPS */ + void hmp_snapshot_blkdev_internal(Monitor *mon, const QDict *qdict) { const char *device =3D qdict_get_str(qdict, "device"); @@ -1776,6 +1784,8 @@ void hmp_block_set_io_throttle(Monitor *mon, const QD= ict *qdict) hmp_handle_error(mon, &err); } =20 +#ifdef CONFIG_LIVE_BLOCK_OPS + void hmp_block_stream(Monitor *mon, const QDict *qdict) { Error *error =3D NULL; @@ -1842,6 +1852,8 @@ void hmp_block_job_complete(Monitor *mon, const QDict= *qdict) hmp_handle_error(mon, &error); } =20 +#endif /* CONFIG_LIVE_BLOCK_OPS */ + typedef struct HMPMigrationStatus { QEMUTimer *timer; --=20 2.9.5