All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Jeff Cody <jcody@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org,
	mrezanin@redhat.com, ehabkost@redhat.com, peterx@redhat.com,
	jsnow@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 3/3] hmp: Optionally disable live block operations in HMP monitor
Date: Tue, 5 Sep 2017 15:01:24 +0100	[thread overview]
Message-ID: <20170905140124.GE2112@work-vm> (raw)
In-Reply-To: <8a9d17a953caedcb66655d945181457eccde9acd.1504112256.git.jcody@redhat.com>

* Jeff Cody (jcody@redhat.com) wrote:
> From: Jeffrey Cody <jcody@redhat.com>
> 
> If live block operations are disabled, disable the corresponding
> HMP commands.
> 
> Signed-off-by: Jeff Cody <jcody@redhat.com>

OK from HMP side, although perhaps it's worth squashing
some of the commands so they're adjacent in the files.

Dave

> ---
>  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
>  
> +#ifdef CONFIG_LIVE_BLOCK_OPS
> +
>      {
>          .name       = "block-jobs",
>          .args_type  = "",
> @@ -98,6 +100,8 @@ STEXI
>  Show progress of ongoing block device operations.
>  ETEXI
>  
> +#endif /* CONFIG_LIVE_BLOCK_OPS */
> +
>      {
>          .name       = "registers",
>          .args_type  = "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
>  
> +#ifdef CONFIG_LIVE_BLOCK_OPS
> +
>      {
>          .name       = "block_stream",
>          .args_type  = "device:B,speed:o?,base:s?",
> @@ -159,6 +161,8 @@ STEXI
>  Resume a paused block streaming operation.
>  ETEXI
>  
> +#endif /* CONFIG_LIVE_BLOCK_OPS */
> +
>      {
>          .name       = "eject",
>          .args_type  = "force:-f,device:B",
> @@ -1169,6 +1173,8 @@ STEXI
>  Enables or disables migration mode.
>  ETEXI
>  
> +#ifdef CONFIG_LIVE_BLOCK_OPS
> +
>      {
>          .name       = "snapshot_blkdev",
>          .args_type  = "reuse:-n,device:B,snapshot-file:s?,format:s?",
> @@ -1190,6 +1196,8 @@ STEXI
>  Snapshot device, using snapshot file as target if provided
>  ETEXI
>  
> +#endif /* CONFIG_LIVE_BLOCK_OPS */
> +
>      {
>          .name       = "snapshot_blkdev_internal",
>          .args_type  = "device:B,name:s",
> @@ -1224,6 +1232,8 @@ STEXI
>  Delete an internal snapshot on device if it support
>  ETEXI
>  
> +#ifdef CONFIG_LIVE_BLOCK_OPS
> +
>      {
>          .name       = "drive_mirror",
>          .args_type  = "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
>  
> +#endif /* CONFIG_LIVE_BLOCK_OPS */
> +
>      {
>          .name       = "drive_add",
>          .args_type  = "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);
>  }
>  
> +#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 *qdict)
>      qapi_free_BlockJobInfoList(list);
>  }
>  
> +#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 *qdict)
>      hmp_handle_error(mon, &err);
>  }
>  
> +#ifdef CONFIG_LIVE_BLOCK_OPS
> +
>  void hmp_drive_mirror(Monitor *mon, const QDict *qdict)
>  {
>      const char *filename = qdict_get_str(qdict, "target");
> @@ -1280,6 +1286,8 @@ void hmp_snapshot_blkdev(Monitor *mon, const QDict *qdict)
>      hmp_handle_error(mon, &err);
>  }
>  
> +#endif /* CONFIG_LIVE_BLOCK_OPS */
> +
>  void hmp_snapshot_blkdev_internal(Monitor *mon, const QDict *qdict)
>  {
>      const char *device = qdict_get_str(qdict, "device");
> @@ -1776,6 +1784,8 @@ void hmp_block_set_io_throttle(Monitor *mon, const QDict *qdict)
>      hmp_handle_error(mon, &err);
>  }
>  
> +#ifdef CONFIG_LIVE_BLOCK_OPS
> +
>  void hmp_block_stream(Monitor *mon, const QDict *qdict)
>  {
>      Error *error = NULL;
> @@ -1842,6 +1852,8 @@ void hmp_block_job_complete(Monitor *mon, const QDict *qdict)
>      hmp_handle_error(mon, &error);
>  }
>  
> +#endif /* CONFIG_LIVE_BLOCK_OPS */
> +
>  typedef struct HMPMigrationStatus
>  {
>      QEMUTimer *timer;
> -- 
> 2.9.5
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

  reply	other threads:[~2017-09-05 14:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-30 17:01 [Qemu-devel] [PATCH v2 0/3] Live block optional disable Jeff Cody
2017-08-30 17:01 ` [Qemu-devel] [PATCH v2 1/3] configure: Add option in configure to disable live block ops Jeff Cody
2017-08-30 17:01 ` [Qemu-devel] [PATCH v2 2/3] block-jobs: Optionally unregister live block operations Jeff Cody
2017-08-30 17:24   ` Eduardo Habkost
2017-08-30 19:23     ` Eric Blake
2017-08-31  6:45       ` Markus Armbruster
2017-09-06 13:00   ` [Qemu-devel] [Qemu-block] " Kevin Wolf
2017-09-06 15:02     ` Eduardo Habkost
2017-09-06 16:42       ` Eric Blake
2017-08-30 17:01 ` [Qemu-devel] [PATCH v2 3/3] hmp: Optionally disable live block operations in HMP monitor Jeff Cody
2017-09-05 14:01   ` Dr. David Alan Gilbert [this message]
2017-08-30 19:17 ` [Qemu-devel] [PATCH v2 0/3] Live block optional disable Eric Blake
2017-08-30 19:26 ` Eric Blake
2017-09-06 12:58 ` [Qemu-devel] [Qemu-block] " Kevin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170905140124.GE2112@work-vm \
    --to=dgilbert@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=jcody@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=mrezanin@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.