[{"id":1763385,"web_url":"http://patchwork.ozlabs.org/comment/1763385/","msgid":"<20170905140124.GE2112@work-vm>","list_archive_url":null,"date":"2017-09-05T14:01:24","subject":"Re: [Qemu-devel] [PATCH v2 3/3] hmp: Optionally disable live block\n\toperations in HMP monitor","submitter":{"id":48102,"url":"http://patchwork.ozlabs.org/api/people/48102/","name":"Dr. David Alan Gilbert","email":"dgilbert@redhat.com"},"content":"* Jeff Cody (jcody@redhat.com) wrote:\n> From: Jeffrey Cody <jcody@redhat.com>\n> \n> If live block operations are disabled, disable the corresponding\n> HMP commands.\n> \n> Signed-off-by: Jeff Cody <jcody@redhat.com>\n\nOK from HMP side, although perhaps it's worth squashing\nsome of the commands so they're adjacent in the files.\n\nDave\n\n> ---\n>  hmp-commands-info.hx |  4 ++++\n>  hmp-commands.hx      | 12 ++++++++++++\n>  hmp.c                | 12 ++++++++++++\n>  3 files changed, 28 insertions(+)\n> \n> diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx\n> index 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\",\n> diff --git a/hmp-commands.hx b/hmp-commands.hx\n> index 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\",\n> diff --git a/hmp.c b/hmp.c\n> index 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> -- \n> 2.9.5\n> \n--\nDr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK","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-mx07.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=dgilbert@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 3xmpR56zWpz9t2R\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  6 Sep 2017 00:06:09 +1000 (AEST)","from localhost ([::1]:59111 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 1dpEUS-00032z-3Q\n\tfor incoming@patchwork.ozlabs.org; Tue, 05 Sep 2017 10:06:08 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:36159)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <dgilbert@redhat.com>) id 1dpEQP-0000N0-5e\n\tfor qemu-devel@nongnu.org; Tue, 05 Sep 2017 10:02:02 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <dgilbert@redhat.com>) id 1dpEQF-0003No-9X\n\tfor qemu-devel@nongnu.org; Tue, 05 Sep 2017 10:01:57 -0400","from mx1.redhat.com ([209.132.183.28]:17819)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <dgilbert@redhat.com>)\n\tid 1dpEQ0-00039P-Aj; Tue, 05 Sep 2017 10:01:32 -0400","from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])\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 47FBFC01418A;\n\tTue,  5 Sep 2017 14:01:31 +0000 (UTC)","from work-vm (ovpn-117-197.ams2.redhat.com [10.36.117.197])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 17A00E997E;\n\tTue,  5 Sep 2017 14:01:26 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 47FBFC01418A","Date":"Tue, 5 Sep 2017 15:01:24 +0100","From":"\"Dr. David Alan Gilbert\" <dgilbert@redhat.com>","To":"Jeff Cody <jcody@redhat.com>","Message-ID":"<20170905140124.GE2112@work-vm>","References":"<cover.1504112256.git.jcody@redhat.com>\n\t<8a9d17a953caedcb66655d945181457eccde9acd.1504112256.git.jcody@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<8a9d17a953caedcb66655d945181457eccde9acd.1504112256.git.jcody@redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.11","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.31]);\n\tTue, 05 Sep 2017 14:01:31 +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":"Re: [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, qemu-devel@nongnu.org,\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>"}}]