All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/3] Live block optional disable
@ 2017-08-30 17:01 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
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Jeff Cody @ 2017-08-30 17:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-block, dgilbert, mrezanin, ehabkost, peterx, jsnow

This series adds a configurable option to disable live block operations.

The default is that live block operations are 'enabled'.

Jeffrey Cody (3):
  configure: Add option in configure to disable live block ops
  block-jobs: Optionally unregister live block operations
  hmp: Optionally disable live block operations in HMP monitor

 configure            | 11 +++++++++++
 hmp-commands-info.hx |  4 ++++
 hmp-commands.hx      | 12 ++++++++++++
 hmp.c                | 12 ++++++++++++
 monitor.c            | 16 ++++++++++++++++
 5 files changed, 55 insertions(+)

-- 
2.9.5

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Qemu-devel] [PATCH v2 1/3] configure: Add option in configure to disable live block ops
  2017-08-30 17:01 [Qemu-devel] [PATCH v2 0/3] Live block optional disable Jeff Cody
@ 2017-08-30 17:01 ` Jeff Cody
  2017-08-30 17:01 ` [Qemu-devel] [PATCH v2 2/3] block-jobs: Optionally unregister live block operations Jeff Cody
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 14+ messages in thread
From: Jeff Cody @ 2017-08-30 17:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-block, dgilbert, mrezanin, ehabkost, peterx, jsnow

From: Jeffrey Cody <jcody@redhat.com>

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 <jcody@redhat.com>
---
 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=""
 tpm="yes"
 libssh2=""
 live_block_migration="yes"
+live_block_ops="yes"
 numa=""
 tcmalloc="no"
 jemalloc="no"
@@ -1263,6 +1264,10 @@ for opt do
   ;;
   --enable-live-block-migration) live_block_migration="yes"
   ;;
+  --disable-live-block-ops) live_block_ops="no"
+  ;;
+  --enable-live-block-ops) live_block_ops="yes"
+  ;;
   --disable-numa) numa="no"
   ;;
   --enable-numa) numa="yes"
@@ -1513,6 +1518,7 @@ disabled with --disable-FEATURE, default is enabled if 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" = "yes" ; then
   echo "CONFIG_LIVE_BLOCK_MIGRATION=y" >> $config_host_mak
 fi
 
+if test "$live_block_ops" = "yes" ; then
+  echo "CONFIG_LIVE_BLOCK_OPS=y" >> $config_host_mak
+fi
+
 # USB host support
 if test "$libusb" = "yes"; then
   echo "HOST_USB=libusb legacy" >> $config_host_mak
-- 
2.9.5

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Qemu-devel] [PATCH v2 2/3] block-jobs: Optionally unregister live block operations
  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 ` Jeff Cody
  2017-08-30 17:24   ` Eduardo Habkost
  2017-09-06 13:00   ` [Qemu-devel] [Qemu-block] " Kevin Wolf
  2017-08-30 17:01 ` [Qemu-devel] [PATCH v2 3/3] hmp: Optionally disable live block operations in HMP monitor Jeff Cody
                   ` (3 subsequent siblings)
  5 siblings, 2 replies; 14+ messages in thread
From: Jeff Cody @ 2017-08-30 17:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-block, dgilbert, mrezanin, ehabkost, peterx, jsnow

From: Jeffrey Cody <jcody@redhat.com>

If configured without live block operations enabled, unregister the
live block operation commands.

Signed-off-by: Jeff Cody <jcody@redhat.com>
---
 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
 }
 
 void monitor_init_qmp_commands(void)
-- 
2.9.5

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Qemu-devel] [PATCH v2 3/3] hmp: Optionally disable live block operations in HMP monitor
  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:01 ` Jeff Cody
  2017-09-05 14:01   ` Dr. David Alan Gilbert
  2017-08-30 19:17 ` [Qemu-devel] [PATCH v2 0/3] Live block optional disable Eric Blake
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Jeff Cody @ 2017-08-30 17:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-block, dgilbert, mrezanin, ehabkost, peterx, jsnow

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>
---
 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

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2/3] block-jobs: Optionally unregister live block operations
  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-09-06 13:00   ` [Qemu-devel] [Qemu-block] " Kevin Wolf
  1 sibling, 1 reply; 14+ messages in thread
From: Eduardo Habkost @ 2017-08-30 17:24 UTC (permalink / raw)
  To: Jeff Cody
  Cc: qemu-devel, qemu-block, dgilbert, mrezanin, peterx, jsnow,
	Marc-André Lureau

On Wed, Aug 30, 2017 at 01:01:41PM -0400, Jeff Cody wrote:
> From: Jeffrey Cody <jcody@redhat.com>
> 
> If configured without live block operations enabled, unregister the
> live block operation commands.
> 
> Signed-off-by: Jeff Cody <jcody@redhat.com>
> ---
>  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

I suggest using the new mechanisms added by:

  [PATCH 00/26] qapi: add #if pre-processor conditions to generated code

-- 
Eduardo

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [PATCH v2 0/3] Live block optional disable
  2017-08-30 17:01 [Qemu-devel] [PATCH v2 0/3] Live block optional disable Jeff Cody
                   ` (2 preceding siblings ...)
  2017-08-30 17:01 ` [Qemu-devel] [PATCH v2 3/3] hmp: Optionally disable live block operations in HMP monitor Jeff Cody
@ 2017-08-30 19:17 ` Eric Blake
  2017-08-30 19:26 ` Eric Blake
  2017-09-06 12:58 ` [Qemu-devel] [Qemu-block] " Kevin Wolf
  5 siblings, 0 replies; 14+ messages in thread
From: Eric Blake @ 2017-08-30 19:17 UTC (permalink / raw)
  To: Jeff Cody, qemu-devel
  Cc: ehabkost, qemu-block, dgilbert, peterx, mrezanin, jsnow

[-- Attachment #1: Type: text/plain, Size: 780 bytes --]

On 08/30/2017 12:01 PM, Jeff Cody wrote:
> This series adds a configurable option to disable live block operations.
> 
> The default is that live block operations are 'enabled'.
> 
> Jeffrey Cody (3):
>   configure: Add option in configure to disable live block ops
>   block-jobs: Optionally unregister live block operations
>   hmp: Optionally disable live block operations in HMP monitor

That doesn't match the spelling you've used on other contributions (see:
 git shortlog --author=Cody | grep -v "^ "
for a demonstration); is it intentional, and do you want a .mailmap
entry to merge your contributions under a preferred name?

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2/3] block-jobs: Optionally unregister live block operations
  2017-08-30 17:24   ` Eduardo Habkost
@ 2017-08-30 19:23     ` Eric Blake
  2017-08-31  6:45       ` Markus Armbruster
  0 siblings, 1 reply; 14+ messages in thread
From: Eric Blake @ 2017-08-30 19:23 UTC (permalink / raw)
  To: Eduardo Habkost, Jeff Cody
  Cc: qemu-block, qemu-devel, peterx, dgilbert, Marc-André Lureau,
	mrezanin, jsnow

[-- Attachment #1: Type: text/plain, Size: 822 bytes --]

On 08/30/2017 12:24 PM, Eduardo Habkost wrote:
> On Wed, Aug 30, 2017 at 01:01:41PM -0400, Jeff Cody wrote:
>> From: Jeffrey Cody <jcody@redhat.com>
>>
>> If configured without live block operations enabled, unregister the
>> live block operation commands.
>>
>> Signed-off-by: Jeff Cody <jcody@redhat.com>
>> ---
>>  monitor.c | 16 ++++++++++++++++
>>  1 file changed, 16 insertions(+)
>>

> 
> I suggest using the new mechanisms added by:
> 
>   [PATCH 00/26] qapi: add #if pre-processor conditions to generated code

Those haven't landed yet, but as both series are proposed for 2.11, I
indeed agree that basing this series on top of that one will be a bit
cleaner.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [PATCH v2 0/3] Live block optional disable
  2017-08-30 17:01 [Qemu-devel] [PATCH v2 0/3] Live block optional disable Jeff Cody
                   ` (3 preceding siblings ...)
  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
  5 siblings, 0 replies; 14+ messages in thread
From: Eric Blake @ 2017-08-30 19:26 UTC (permalink / raw)
  To: Jeff Cody, qemu-devel
  Cc: ehabkost, qemu-block, dgilbert, peterx, mrezanin, jsnow

[-- Attachment #1: Type: text/plain, Size: 712 bytes --]

On 08/30/2017 12:01 PM, Jeff Cody wrote:
> This series adds a configurable option to disable live block operations.
> 
> The default is that live block operations are 'enabled'.
> 
> Jeffrey Cody (3):
>   configure: Add option in configure to disable live block ops
>   block-jobs: Optionally unregister live block operations
>   hmp: Optionally disable live block operations in HMP monitor

Series:
Reviewed-by: Eric Blake <eblake@redhat.com>

However, per the discussion on 2/3, you probably want a v2 of this
series after we land conditional QAPI support first.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2/3] block-jobs: Optionally unregister live block operations
  2017-08-30 19:23     ` Eric Blake
@ 2017-08-31  6:45       ` Markus Armbruster
  0 siblings, 0 replies; 14+ messages in thread
From: Markus Armbruster @ 2017-08-31  6:45 UTC (permalink / raw)
  To: Eric Blake
  Cc: Eduardo Habkost, Jeff Cody, qemu-block, qemu-devel, peterx,
	dgilbert, Marc-André Lureau, mrezanin, jsnow

Eric Blake <eblake@redhat.com> writes:

> On 08/30/2017 12:24 PM, Eduardo Habkost wrote:
>> On Wed, Aug 30, 2017 at 01:01:41PM -0400, Jeff Cody wrote:
>>> From: Jeffrey Cody <jcody@redhat.com>
>>>
>>> If configured without live block operations enabled, unregister the
>>> live block operation commands.
>>>
>>> Signed-off-by: Jeff Cody <jcody@redhat.com>
>>> ---
>>>  monitor.c | 16 ++++++++++++++++
>>>  1 file changed, 16 insertions(+)
>>>
>
>> 
>> I suggest using the new mechanisms added by:
>> 
>>   [PATCH 00/26] qapi: add #if pre-processor conditions to generated code
>
> Those haven't landed yet, but as both series are proposed for 2.11, I
> indeed agree that basing this series on top of that one will be a bit
> cleaner.

Rebasing shouldn't be hard.  However, we then have to hold it until the
QAPI series lands.  I don't think holding is necessary, as the conflicts
between the two are obvious, and should be straightforward to resolve.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [PATCH v2 3/3] hmp: Optionally disable live block operations in HMP monitor
  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
  0 siblings, 0 replies; 14+ messages in thread
From: Dr. David Alan Gilbert @ 2017-09-05 14:01 UTC (permalink / raw)
  To: Jeff Cody; +Cc: qemu-devel, qemu-block, mrezanin, ehabkost, peterx, jsnow

* 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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [Qemu-block] [PATCH v2 0/3] Live block optional disable
  2017-08-30 17:01 [Qemu-devel] [PATCH v2 0/3] Live block optional disable Jeff Cody
                   ` (4 preceding siblings ...)
  2017-08-30 19:26 ` Eric Blake
@ 2017-09-06 12:58 ` Kevin Wolf
  5 siblings, 0 replies; 14+ messages in thread
From: Kevin Wolf @ 2017-09-06 12:58 UTC (permalink / raw)
  To: Jeff Cody; +Cc: qemu-devel, ehabkost, qemu-block, dgilbert, peterx, mrezanin

Am 30.08.2017 um 19:01 hat Jeff Cody geschrieben:
> This series adds a configurable option to disable live block operations.
> 
> The default is that live block operations are 'enabled'.

Let me play dumb: Who would ever want to disable these? Is there a
legitimate reason to do this except artificially making qemu less
capable than it really is?

Kevin

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [Qemu-block] [PATCH v2 2/3] block-jobs: Optionally unregister live block operations
  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-09-06 13:00   ` Kevin Wolf
  2017-09-06 15:02     ` Eduardo Habkost
  1 sibling, 1 reply; 14+ messages in thread
From: Kevin Wolf @ 2017-09-06 13:00 UTC (permalink / raw)
  To: Jeff Cody; +Cc: qemu-devel, ehabkost, qemu-block, dgilbert, peterx, mrezanin

Am 30.08.2017 um 19:01 hat Jeff Cody geschrieben:
> From: Jeffrey Cody <jcody@redhat.com>
> 
> If configured without live block operations enabled, unregister the
> live block operation commands.
> 
> Signed-off-by: Jeff Cody <jcody@redhat.com>

How sure are we that libvirt will like a qemu that advertises these
commands in the schema, but doesn't actually provide them?

Kevin

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [Qemu-block] [PATCH v2 2/3] block-jobs: Optionally unregister live block operations
  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
  0 siblings, 1 reply; 14+ messages in thread
From: Eduardo Habkost @ 2017-09-06 15:02 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: Jeff Cody, qemu-devel, qemu-block, dgilbert, peterx, mrezanin

On Wed, Sep 06, 2017 at 03:00:41PM +0200, Kevin Wolf wrote:
> Am 30.08.2017 um 19:01 hat Jeff Cody geschrieben:
> > From: Jeffrey Cody <jcody@redhat.com>
> > 
> > If configured without live block operations enabled, unregister the
> > live block operation commands.
> > 
> > Signed-off-by: Jeff Cody <jcody@redhat.com>
> 
> How sure are we that libvirt will like a qemu that advertises these
> commands in the schema, but doesn't actually provide them?

If libvirt wants to know if a command is available, it uses
'query-commands', not 'query-qmp-schema'.

The only query-qmp-schema elements used by latest libvirt are
gluster-related blockdev-add options (see
libvirt/src/qemu/qemu_capabilities.c:virQEMUCapsQMPSchemaQueries]]).

-- 
Eduardo

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [Qemu-block] [PATCH v2 2/3] block-jobs: Optionally unregister live block operations
  2017-09-06 15:02     ` Eduardo Habkost
@ 2017-09-06 16:42       ` Eric Blake
  0 siblings, 0 replies; 14+ messages in thread
From: Eric Blake @ 2017-09-06 16:42 UTC (permalink / raw)
  To: Eduardo Habkost, Kevin Wolf
  Cc: qemu-block, Jeff Cody, qemu-devel, peterx, dgilbert, mrezanin

[-- Attachment #1: Type: text/plain, Size: 1319 bytes --]

On 09/06/2017 10:02 AM, Eduardo Habkost wrote:
> On Wed, Sep 06, 2017 at 03:00:41PM +0200, Kevin Wolf wrote:
>> Am 30.08.2017 um 19:01 hat Jeff Cody geschrieben:
>>> From: Jeffrey Cody <jcody@redhat.com>
>>>
>>> If configured without live block operations enabled, unregister the
>>> live block operation commands.
>>>
>>> Signed-off-by: Jeff Cody <jcody@redhat.com>
>>
>> How sure are we that libvirt will like a qemu that advertises these
>> commands in the schema, but doesn't actually provide them?
> 
> If libvirt wants to know if a command is available, it uses
> 'query-commands', not 'query-qmp-schema'.
> 
> The only query-qmp-schema elements used by latest libvirt are
> gluster-related blockdev-add options (see
> libvirt/src/qemu/qemu_capabilities.c:virQEMUCapsQMPSchemaQueries]]).

Indeed, libvirt is currently just fine with the fact that query-commands
introspection hides disabled commands, even if they are still leaked in
query-qmp-schema.  Besides, Marc-Andre's work on adding #if support to
QAPI should probably also land in 2.11, at which point the hack goes
away (because then we ARE properly hiding things from the schema
introspection).

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2017-09-06 16:43 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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.