{"id":807796,"url":"http://patchwork.ozlabs.org/api/1.0/patches/807796/?format=json","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/1.0/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<8a9d17a953caedcb66655d945181457eccde9acd.1504112256.git.jcody@redhat.com>","date":"2017-08-30T17:01:42","name":"[v2,3/3] hmp: Optionally disable live block operations in HMP monitor","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"748a694ec140060a7f1c8c2598a04e7bf974b7a7","submitter":{"id":12159,"url":"http://patchwork.ozlabs.org/api/1.0/people/12159/?format=json","name":"Jeff Cody","email":"jcody@redhat.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/8a9d17a953caedcb66655d945181457eccde9acd.1504112256.git.jcody@redhat.com/mbox/","series":[{"id":669,"url":"http://patchwork.ozlabs.org/api/1.0/series/669/?format=json","date":"2017-08-30T17:01:40","name":"Live block optional disable","version":2,"mbox":"http://patchwork.ozlabs.org/series/669/mbox/"}],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/807796/checks/","tags":{},"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=jcody@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xjCTm5zGpz9sN7\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 31 Aug 2017 03:41:00 +1000 (AEST)","from localhost ([::1]:51857 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dn6z1-00037P-Ad\n\tfor incoming@patchwork.ozlabs.org; Wed, 30 Aug 2017 13:40:55 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:60067)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <jcody@redhat.com>) id 1dn6Nd-0001wo-3y\n\tfor qemu-devel@nongnu.org; Wed, 30 Aug 2017 13:02:18 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <jcody@redhat.com>) id 1dn6Nc-0000SM-6g\n\tfor qemu-devel@nongnu.org; Wed, 30 Aug 2017 13:02:17 -0400","from mx1.redhat.com ([209.132.183.28]:42802)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <jcody@redhat.com>)\n\tid 1dn6NO-0000OI-09; Wed, 30 Aug 2017 13:02:02 -0400","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id DF3F1C0587D1;\n\tWed, 30 Aug 2017 17:02:00 +0000 (UTC)","from localhost (ovpn-116-70.phx2.redhat.com [10.3.116.70])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id AB89D6951F;\n\tWed, 30 Aug 2017 17:01:54 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com DF3F1C0587D1","From":"Jeff Cody <jcody@redhat.com>","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":["<cover.1504112256.git.jcody@redhat.com>","<cover.1504112256.git.jcody@redhat.com>"],"References":["<cover.1504112256.git.jcody@redhat.com>","<cover.1504112256.git.jcody@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\n\t(mx1.redhat.com [10.5.110.32]);\n\tWed, 30 Aug 2017 17:02:01 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"[Qemu-devel] [PATCH v2 3/3] hmp: Optionally disable live block\n\toperations in HMP monitor","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"ehabkost@redhat.com, qemu-block@nongnu.org, dgilbert@redhat.com,\n\tpeterx@redhat.com, mrezanin@redhat.com, jsnow@redhat.com","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"},"content":"From: Jeffrey Cody <jcody@redhat.com>\n\nIf live block operations are disabled, disable the corresponding\nHMP commands.\n\nSigned-off-by: Jeff Cody <jcody@redhat.com>\n---\n hmp-commands-info.hx |  4 ++++\n hmp-commands.hx      | 12 ++++++++++++\n hmp.c                | 12 ++++++++++++\n 3 files changed, 28 insertions(+)","diff":"diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx\nindex d9df238..0967e41 100644\n--- a/hmp-commands-info.hx\n+++ b/hmp-commands-info.hx\n@@ -84,6 +84,8 @@ STEXI\n Show block device statistics.\n ETEXI\n \n+#ifdef CONFIG_LIVE_BLOCK_OPS\n+\n     {\n         .name       = \"block-jobs\",\n         .args_type  = \"\",\n@@ -98,6 +100,8 @@ STEXI\n Show progress of ongoing block device operations.\n ETEXI\n \n+#endif /* CONFIG_LIVE_BLOCK_OPS */\n+\n     {\n         .name       = \"registers\",\n         .args_type  = \"cpustate_all:-a\",\ndiff --git a/hmp-commands.hx b/hmp-commands.hx\nindex 1941e19..2d137a1 100644\n--- a/hmp-commands.hx\n+++ b/hmp-commands.hx\n@@ -73,6 +73,8 @@ but should be used with extreme caution.  Note that this command only\n resizes image files, it can not resize block devices like LVM volumes.\n ETEXI\n \n+#ifdef CONFIG_LIVE_BLOCK_OPS\n+\n     {\n         .name       = \"block_stream\",\n         .args_type  = \"device:B,speed:o?,base:s?\",\n@@ -159,6 +161,8 @@ STEXI\n Resume a paused block streaming operation.\n ETEXI\n \n+#endif /* CONFIG_LIVE_BLOCK_OPS */\n+\n     {\n         .name       = \"eject\",\n         .args_type  = \"force:-f,device:B\",\n@@ -1169,6 +1173,8 @@ STEXI\n Enables or disables migration mode.\n ETEXI\n \n+#ifdef CONFIG_LIVE_BLOCK_OPS\n+\n     {\n         .name       = \"snapshot_blkdev\",\n         .args_type  = \"reuse:-n,device:B,snapshot-file:s?,format:s?\",\n@@ -1190,6 +1196,8 @@ STEXI\n Snapshot device, using snapshot file as target if provided\n ETEXI\n \n+#endif /* CONFIG_LIVE_BLOCK_OPS */\n+\n     {\n         .name       = \"snapshot_blkdev_internal\",\n         .args_type  = \"device:B,name:s\",\n@@ -1224,6 +1232,8 @@ STEXI\n Delete an internal snapshot on device if it support\n ETEXI\n \n+#ifdef CONFIG_LIVE_BLOCK_OPS\n+\n     {\n         .name       = \"drive_mirror\",\n         .args_type  = \"reuse:-n,full:-f,device:B,target:s,format:s?\",\n@@ -1267,6 +1277,8 @@ STEXI\n Start a point-in-time copy of a block device to a specificed target.\n ETEXI\n \n+#endif /* CONFIG_LIVE_BLOCK_OPS */\n+\n     {\n         .name       = \"drive_add\",\n         .args_type  = \"node:-n,pci_addr:s,opts:s\",\ndiff --git a/hmp.c b/hmp.c\nindex fd80dce..ab985c6 100644\n--- a/hmp.c\n+++ b/hmp.c\n@@ -951,6 +951,8 @@ void hmp_info_pci(Monitor *mon, const QDict *qdict)\n     qapi_free_PciInfoList(info_list);\n }\n \n+#ifdef CONFIG_LIVE_BLOCK_OPS\n+\n void hmp_info_block_jobs(Monitor *mon, const QDict *qdict)\n {\n     BlockJobInfoList *list;\n@@ -989,6 +991,8 @@ void hmp_info_block_jobs(Monitor *mon, const QDict *qdict)\n     qapi_free_BlockJobInfoList(list);\n }\n \n+#endif /* CONFIG_LIVE_BLOCK_OPS */\n+\n void hmp_info_tpm(Monitor *mon, const QDict *qdict)\n {\n     TPMInfoList *info_list, *info;\n@@ -1197,6 +1201,8 @@ void hmp_block_resize(Monitor *mon, const QDict *qdict)\n     hmp_handle_error(mon, &err);\n }\n \n+#ifdef CONFIG_LIVE_BLOCK_OPS\n+\n void hmp_drive_mirror(Monitor *mon, const QDict *qdict)\n {\n     const char *filename = qdict_get_str(qdict, \"target\");\n@@ -1280,6 +1286,8 @@ void hmp_snapshot_blkdev(Monitor *mon, const QDict *qdict)\n     hmp_handle_error(mon, &err);\n }\n \n+#endif /* CONFIG_LIVE_BLOCK_OPS */\n+\n void hmp_snapshot_blkdev_internal(Monitor *mon, const QDict *qdict)\n {\n     const char *device = qdict_get_str(qdict, \"device\");\n@@ -1776,6 +1784,8 @@ void hmp_block_set_io_throttle(Monitor *mon, const QDict *qdict)\n     hmp_handle_error(mon, &err);\n }\n \n+#ifdef CONFIG_LIVE_BLOCK_OPS\n+\n void hmp_block_stream(Monitor *mon, const QDict *qdict)\n {\n     Error *error = NULL;\n@@ -1842,6 +1852,8 @@ void hmp_block_job_complete(Monitor *mon, const QDict *qdict)\n     hmp_handle_error(mon, &error);\n }\n \n+#endif /* CONFIG_LIVE_BLOCK_OPS */\n+\n typedef struct HMPMigrationStatus\n {\n     QEMUTimer *timer;\n","prefixes":["v2","3/3"]}