Skip to contentSkip to conversation

Fix -device JSON support wrt hotplug

PATCH Applied Daniel P. Berrangé 6 participants 12 messages Jan 5, 2022 – Jan 14, 2022

lore
Share & tools
lore
#1 lore raw

PATCH 1/1 softmmu: fix device deletion events with -device JSON syntax

In reply to Daniel P. Berrangé

The -device JSON syntax impl leaks a reference on the created DeviceState instance. As a result when you hot-unplug the device, the device_finalize method won't be called and thus it will fail to emit the required DEVICE_DELETED event.

A 'json-cli' feature was previously added against the 'device_add' QMP command QAPI schema to indicated to mgmt apps that -device supported JSON syntax. Given the hotplug bug that feature flag is no unusable for its purpose, so we add a new 'json-cli-hotplug' feature to indicate the -device supports JSON without breaking hotplug.

---
 qapi/qdev.json                 |  5 ++++-
 softmmu/vl.c                   |  4 +++-
 tests/qtest/device-plug-test.c | 19 +++++++++++++++++++
 3 files changed, 26 insertions(+), 2 deletions(-)
qapi/qdev.json +4 -1
index 69656b14df..26cd10106b 100644
@@ -44,6 +44,9 @@
 # @json-cli: If present, the "-device" command line option supports JSON
 #            syntax with a structure identical to the arguments of this
 #            command.
+# @json-cli-hotplug: If present, the "-device" command line option supports JSON
+#                    syntax without the reference counting leak that broke
+#                    hot-unplug
 #
 # Notes:
 #
@@ -74,7 +77,7 @@
 { 'command': 'device_add',
   'data': {'driver': 'str', '*bus': 'str', '*id': 'str'},
   'gen': false, # so we can get the additional arguments
-  'features': ['json-cli'] }
+  'features': ['json-cli', 'json-cli-hotplug'] }
 
 ##
 # @device_del:
softmmu/vl.c +3 -1
index d9e4c619d3..b1fc7da104 100644
@@ -2684,6 +2684,7 @@ static void qemu_create_cli_devices(void)
     qemu_opts_foreach(qemu_find_opts("device"),
                       device_init_func, NULL, &error_fatal);
     QTAILQ_FOREACH(opt, &device_opts, next) {
+        DeviceState *dev;
         loc_push_restore(&opt->loc);
         /*
          * TODO Eventually we should call qmp_device_add() here to make sure it
@@ -2692,7 +2693,8 @@ static void qemu_create_cli_devices(void)
          * from the start, so call qdev_device_add_from_qdict() directly for
          * now.
          */
-        qdev_device_add_from_qdict(opt->opts, true, &error_fatal);
+        dev = qdev_device_add_from_qdict(opt->opts, true, &error_fatal);
+        object_unref(OBJECT(dev));
         loc_pop(&opt->loc);
     }
     rom_reset_order_override();
tests/qtest/device-plug-test.c +19 -0
index 559d47727a..ad79bd4c14 100644
@@ -77,6 +77,23 @@ static void test_pci_unplug_request(void)
     qtest_quit(qtest);
 }
 
+static void test_pci_unplug_json_request(void)
+{
+    QTestState *qtest = qtest_initf(
+        "-device '{\"driver\": \"virtio-mouse-pci\", \"id\": \"dev0\"}'");
+
+    /*
+     * Request device removal. As the guest is not running, the request won't
+     * be processed. However during system reset, the removal will be
+     * handled, removing the device.
+     */
+    device_del(qtest, "dev0");
+    system_reset(qtest);
+    wait_device_deleted_event(qtest, "dev0");
+
+    qtest_quit(qtest);
+}
+
 static void test_ccw_unplug(void)
 {
     QTestState *qtest = qtest_initf("-device virtio-balloon-ccw,id=dev0");
@@ -145,6 +162,8 @@ int main(int argc, char **argv)
      */
     qtest_add_func("/device-plug/pci-unplug-request",
                    test_pci_unplug_request);
+    qtest_add_func("/device-plug/pci-unplug-json-request",
+                   test_pci_unplug_json_request);
 
     if (!strcmp(arch, "s390x")) {
         qtest_add_func("/device-plug/ccw-unplug",
Signature · 1 line
2.33.1
#0 lore raw

cover Fix -device JSON support wrt hotplug

Libvirt switched to using -device JSON support, but we discovered in testing that it is broken for hotplug, never sending DEVICE_DELETED events. This is caused by a subtle refcount leak.

Daniel P. Berrangé (1):
softmmu: fix device deletion events with -device JSON syntax

 qapi/qdev.json                 |  5 ++++-
 softmmu/vl.c                   |  4 +++-
 tests/qtest/device-plug-test.c | 19 +++++++++++++++++++
 3 files changed, 26 insertions(+), 2 deletions(-)
Signature · 1 line
2.33.1
Reviewed-by on v1 1/1
#2 lore raw

Re: [PATCH 1/1] softmmu: fix device deletion events with -device JSON syntax

In reply to Daniel P. Berrangé
Quoted 5 lines · Daniel P. Berrangé

The -device JSON syntax impl leaks a reference on the created DeviceState instance. As a result when you hot-unplug the device, the device_finalize method won't be called and thus it will fail to emit the required DEVICE_DELETED event.

Quoted 8 lines

A 'json-cli' feature was previously added against the 'device_add' QMP command QAPI schema to indicated to mgmt apps that -device supported JSON syntax. Given the hotplug bug that feature flag is no unusable for its purpose, so we add a new 'json-cli-hotplug' feature to indicate the -device supports JSON without breaking hotplug.

We're mostly using "Fixes:" to refer to previous commit IDs, and "Resolves:" for referring to bugs in the gitlab issue tracker, so in case you respin, I'd suggest to replace it (but both keywords should work to close issues, so it's just a cosmetical thing).

Quoted 6 lines
---
  qapi/qdev.json                 |  5 ++++-
  softmmu/vl.c                   |  4 +++-
  tests/qtest/device-plug-test.c | 19 +++++++++++++++++++
  3 files changed, 26 insertions(+), 2 deletions(-)
Tested-by on v1 1/1
#3 lore raw

Re: [PATCH 1/1] softmmu: fix device deletion events with -device JSON syntax

In reply to Daniel P. Berrangé
Quoted 12 lines · Daniel P. Berrangé

The -device JSON syntax impl leaks a reference on the created DeviceState instance. As a result when you hot-unplug the device, the device_finalize method won't be called and thus it will fail to emit the required DEVICE_DELETED event.

A 'json-cli' feature was previously added against the 'device_add' QMP command QAPI schema to indicated to mgmt apps that -device supported JSON syntax. Given the hotplug bug that feature flag is no unusable for its purpose, so we add a new 'json-cli-hotplug' feature to indicate the -device supports JSON without breaking hotplug.

Quoted 8 lines

---

qapi/qdev.json                 |  5 ++++-
softmmu/vl.c                   |  4 +++-
tests/qtest/device-plug-test.c | 19 +++++++++++++++++++
3 files changed, 26 insertions(+), 2 deletions(-)

Jano

#6 lore raw

Re: [PATCH 1/1] softmmu: fix device deletion events with -device JSON syntax

In reply to Daniel P. Berrangé
Quoted 14 lines · Daniel P. Berrangé
Quoted 6 lines · Laurent Vivier
Quoted 5 lines · Daniel P. Berrangé

The -device JSON syntax impl leaks a reference on the created DeviceState instance. As a result when you hot-unplug the device, the device_finalize method won't be called and thus it will fail to emit the required DEVICE_DELETED event.

Quoted 6 lines
Quoted 4 lines

A 'json-cli' feature was previously added against the 'device_add' QMP command QAPI schema to indicated to mgmt apps that -device supported JSON syntax. Given the hotplug bug that feature flag is no unusable for its purpose, so

Not sure to understand: do you mean "now unusable"?

Quoted 7 lines

An application wants to known whether QEMU can support JSON syntax with -device. If they look for the 'json-cli' feature as a witness, they'll end up using JSON with QEMU 6.2 which is giving them broken hotplug. This is unusable for any non-trivial use cases. So we need a new witness to indicate whether JSON is viable with -device, that only the newly fixed QEMU will report.

I understand that, my problem was with your sentence:

"Given the hotplug bug that feature flag is no unusable for its purpose"

Thanks,
Laurent

#5 lore raw

Re: [PATCH 1/1] softmmu: fix device deletion events with -device JSON syntax

In reply to Laurent Vivier
Quoted 6 lines · Laurent Vivier
Quoted 5 lines · Daniel P. Berrangé

The -device JSON syntax impl leaks a reference on the created DeviceState instance. As a result when you hot-unplug the device, the device_finalize method won't be called and thus it will fail to emit the required DEVICE_DELETED event.

Quoted 6 lines
Quoted 4 lines

A 'json-cli' feature was previously added against the 'device_add' QMP command QAPI schema to indicated to mgmt apps that -device supported JSON syntax. Given the hotplug bug that feature flag is no unusable for its purpose, so

Not sure to understand: do you mean "now unusable"?

An application wants to known whether QEMU can support JSON syntax with -device. If they look for the 'json-cli' feature as a witness, they'll end up using JSON with QEMU 6.2 which is giving them broken hotplug. This is unusable for any non-trivial use cases. So we need a new witness to indicate whether JSON is viable with -device, that only the newly fixed QEMU will report.

Quoted 89 lines
Quoted 65 lines

we add a new 'json-cli-hotplug' feature to indicate the -device supports JSON without breaking hotplug.

---
  qapi/qdev.json                 |  5 ++++-
  softmmu/vl.c                   |  4 +++-
  tests/qtest/device-plug-test.c | 19 +++++++++++++++++++
  3 files changed, 26 insertions(+), 2 deletions(-)
qapi/qdev.json +4 -1
index 69656b14df..26cd10106b 100644
@@ -44,6 +44,9 @@
  # @json-cli: If present, the "-device" command line option supports JSON
  #            syntax with a structure identical to the arguments of this
  #            command.
+# @json-cli-hotplug: If present, the "-device" command line option supports JSON
+#                    syntax without the reference counting leak that broke
+#                    hot-unplug
  #
  # Notes:
  #
@@ -74,7 +77,7 @@
  { 'command': 'device_add',
    'data': {'driver': 'str', '*bus': 'str', '*id': 'str'},
    'gen': false, # so we can get the additional arguments
-  'features': ['json-cli'] }
+  'features': ['json-cli', 'json-cli-hotplug'] }
  ##
  # @device_del:
softmmu/vl.c +3 -1
index d9e4c619d3..b1fc7da104 100644
@@ -2684,6 +2684,7 @@ static void qemu_create_cli_devices(void)
      qemu_opts_foreach(qemu_find_opts("device"),
                        device_init_func, NULL, &error_fatal);
      QTAILQ_FOREACH(opt, &device_opts, next) {
+        DeviceState *dev;
          loc_push_restore(&opt->loc);
          /*
           * TODO Eventually we should call qmp_device_add() here to make sure it
@@ -2692,7 +2693,8 @@ static void qemu_create_cli_devices(void)
           * from the start, so call qdev_device_add_from_qdict() directly for
           * now.
           */
-        qdev_device_add_from_qdict(opt->opts, true, &error_fatal);
+        dev = qdev_device_add_from_qdict(opt->opts, true, &error_fatal);
+        object_unref(OBJECT(dev));
          loc_pop(&opt->loc);
      }
      rom_reset_order_override();
tests/qtest/device-plug-test.c +2 -0
index 559d47727a..ad79bd4c14 100644
@@ -77,6 +77,23 @@ static void test_pci_unplug_request(void)
      qtest_quit(qtest);
  }
+static void test_pci_unplug_json_request(void)
+{

tests/qtest/device-plug-test.c static void test_pci_unplug_request(void) · line 90

Quoted 10 lines
tests/qtest/device-plug-test.c +10 -0
+    QTestState *qtest = qtest_initf(
+        "-device '{\"driver\": \"virtio-mouse-pci\", \"id\": \"dev0\"}'");
+
+    /*
+     * Request device removal. As the guest is not running, the request won't
+     * be processed. However during system reset, the removal will be
+     * handled, removing the device.
+     */
+    device_del(qtest, "dev0");
+    system_reset(qtest);

You can use qpci_unplug_acpi_device_test() to process the request... but I see this is done like that too in test_pci_unplug_request()

Quoted 10 lines
tests/qtest/device-plug-test.c +5 -0
+    wait_device_deleted_event(qtest, "dev0");
+
+    qtest_quit(qtest);
+}
+
  static void test_ccw_unplug(void)
  {
      QTestState *qtest = qtest_initf("-device virtio-balloon-ccw,id=dev0");
@@ -145,6 +162,8 @@ int main(int argc, char **argv)
       */
Quoted 9 lines

tests/qtest/device-plug-test.c int main(int argc, char **argv) · line 169

Quoted 6 lines
tests/qtest/device-plug-test.c +2 -0
      qtest_add_func("/device-plug/pci-unplug-request",
                     test_pci_unplug_request);
+    qtest_add_func("/device-plug/pci-unplug-json-request",
+                   test_pci_unplug_json_request);
      if (!strcmp(arch, "s390x")) {
          qtest_add_func("/device-plug/ccw-unplug",

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
Reviewed-by on v1 1/1
#4 lore raw

Re: [PATCH 1/1] softmmu: fix device deletion events with -device JSON syntax

In reply to Daniel P. Berrangé
Quoted 9 lines · Daniel P. Berrangé

The -device JSON syntax impl leaks a reference on the created DeviceState instance. As a result when you hot-unplug the device, the device_finalize method won't be called and thus it will fail to emit the required DEVICE_DELETED event.

A 'json-cli' feature was previously added against the 'device_add' QMP command QAPI schema to indicated to mgmt apps that -device supported JSON syntax. Given the hotplug bug that feature flag is no unusable for its purpose, so

Not sure to understand: do you mean "now unusable"?

Quoted 66 lines

we add a new 'json-cli-hotplug' feature to indicate the -device supports JSON without breaking hotplug.

---
  qapi/qdev.json                 |  5 ++++-
  softmmu/vl.c                   |  4 +++-
  tests/qtest/device-plug-test.c | 19 +++++++++++++++++++
  3 files changed, 26 insertions(+), 2 deletions(-)
qapi/qdev.json +4 -1
index 69656b14df..26cd10106b 100644
@@ -44,6 +44,9 @@
  # @json-cli: If present, the "-device" command line option supports JSON
  #            syntax with a structure identical to the arguments of this
  #            command.
+# @json-cli-hotplug: If present, the "-device" command line option supports JSON
+#                    syntax without the reference counting leak that broke
+#                    hot-unplug
  #
  # Notes:
  #
@@ -74,7 +77,7 @@
  { 'command': 'device_add',
    'data': {'driver': 'str', '*bus': 'str', '*id': 'str'},
    'gen': false, # so we can get the additional arguments
-  'features': ['json-cli'] }
+  'features': ['json-cli', 'json-cli-hotplug'] }
 
  ##
  # @device_del:
softmmu/vl.c +3 -1
index d9e4c619d3..b1fc7da104 100644
@@ -2684,6 +2684,7 @@ static void qemu_create_cli_devices(void)
      qemu_opts_foreach(qemu_find_opts("device"),
                        device_init_func, NULL, &error_fatal);
      QTAILQ_FOREACH(opt, &device_opts, next) {
+        DeviceState *dev;
          loc_push_restore(&opt->loc);
          /*
           * TODO Eventually we should call qmp_device_add() here to make sure it
@@ -2692,7 +2693,8 @@ static void qemu_create_cli_devices(void)
           * from the start, so call qdev_device_add_from_qdict() directly for
           * now.
           */
-        qdev_device_add_from_qdict(opt->opts, true, &error_fatal);
+        dev = qdev_device_add_from_qdict(opt->opts, true, &error_fatal);
+        object_unref(OBJECT(dev));
          loc_pop(&opt->loc);
      }
      rom_reset_order_override();
tests/qtest/device-plug-test.c +2 -0
index 559d47727a..ad79bd4c14 100644
@@ -77,6 +77,23 @@ static void test_pci_unplug_request(void)
      qtest_quit(qtest);
  }
 
+static void test_pci_unplug_json_request(void)
+{

tests/qtest/device-plug-test.c static void test_pci_unplug_request(void) · line 91

Quoted 10 lines
tests/qtest/device-plug-test.c +10 -0
+    QTestState *qtest = qtest_initf(
+        "-device '{\"driver\": \"virtio-mouse-pci\", \"id\": \"dev0\"}'");
+
+    /*
+     * Request device removal. As the guest is not running, the request won't
+     * be processed. However during system reset, the removal will be
+     * handled, removing the device.
+     */
+    device_del(qtest, "dev0");
+    system_reset(qtest);

You can use qpci_unplug_acpi_device_test() to process the request... but I see this is done like that too in test_pci_unplug_request()

Quoted 9 lines
tests/qtest/device-plug-test.c +5 -0
+    wait_device_deleted_event(qtest, "dev0");
+
+    qtest_quit(qtest);
+}
+
  static void test_ccw_unplug(void)
  {
      QTestState *qtest = qtest_initf("-device virtio-balloon-ccw,id=dev0");

tests/qtest/device-plug-test.c int main(int argc, char **argv) · line 169

Quoted 8 lines
tests/qtest/device-plug-test.c +2 -0
@@ -145,6 +162,8 @@ int main(int argc, char **argv)
       */
      qtest_add_func("/device-plug/pci-unplug-request",
                     test_pci_unplug_request);
+    qtest_add_func("/device-plug/pci-unplug-json-request",
+                   test_pci_unplug_json_request);
 
      if (!strcmp(arch, "s390x")) {
          qtest_add_func("/device-plug/ccw-unplug",
#7 lore raw

Re: [PATCH 1/1] softmmu: fix device deletion events with -device JSON syntax

In reply to Laurent Vivier
Quoted 23 lines · Laurent Vivier
Quoted 14 lines · Daniel P. Berrangé
Quoted 6 lines · Laurent Vivier
Quoted 5 lines · Daniel P. Berrangé

The -device JSON syntax impl leaks a reference on the created DeviceState instance. As a result when you hot-unplug the device, the device_finalize method won't be called and thus it will fail to emit the required DEVICE_DELETED event.

Quoted 6 lines
Quoted 4 lines

A 'json-cli' feature was previously added against the 'device_add' QMP command QAPI schema to indicated to mgmt apps that -device supported JSON syntax. Given the hotplug bug that feature flag is no unusable for its purpose, so

Not sure to understand: do you mean "now unusable"?

Quoted 7 lines

An application wants to known whether QEMU can support JSON syntax with -device. If they look for the 'json-cli' feature as a witness, they'll end up using JSON with QEMU 6.2 which is giving them broken hotplug. This is unusable for any non-trivial use cases. So we need a new witness to indicate whether JSON is viable with -device, that only the newly fixed QEMU will report.

Quoted 3 lines

I understand that, my problem was with your sentence:

"Given the hotplug bug that feature flag is no unusable for its purpose"

What's the problem with that ? It is reasonabled to say a -device impl which is broken for hotplug is not usable for non-toy use cases.

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#8 lore raw

Re: [PATCH 1/1] softmmu: fix device deletion events with -device JSON syntax

Quoted 24 lines · Daniel P. Berrangé
Quoted 23 lines · Laurent Vivier
Quoted 21 lines · Daniel P. Berrangé
Quoted 6 lines · Laurent Vivier
Quoted 5 lines · Daniel P. Berrangé

The -device JSON syntax impl leaks a reference on the created DeviceState instance. As a result when you hot-unplug the device, the device_finalize method won't be called and thus it will fail to emit the required DEVICE_DELETED event.

Quoted 6 lines
Quoted 4 lines

A 'json-cli' feature was previously added against the 'device_add' QMP command QAPI schema to indicated to mgmt apps that -device supported JSON syntax. Given the hotplug bug that feature flag is no unusable for its purpose, so

Not sure to understand: do you mean "now unusable"?

An application wants to known whether QEMU can support JSON syntax with -device. If they look for the 'json-cli' feature as a witness, they'll end up using JSON with QEMU 6.2 which is giving them broken hotplug. This is unusable for any non-trivial use cases. So we need a new witness to indicate whether JSON is viable with -device, that only the newly fixed QEMU will report.

Quoted 6 lines
Quoted 3 lines

I understand that, my problem was with your sentence:

"Given the hotplug bug that feature flag is no unusable for its purpose"

What's the problem with that ? It is reasonabled to say a -device impl which is broken for hotplug is not usable for non-toy use cases.

So it should be "not usable" instead of "no usable" in the commit description.

Thomas

#9 lore raw

Re: [PATCH 1/1] softmmu: fix device deletion events with -device JSON syntax

In reply to Daniel P. Berrangé
Quoted 24 lines · Daniel P. Berrangé
Quoted 23 lines · Laurent Vivier
Quoted 21 lines · Daniel P. Berrangé
Quoted 6 lines · Laurent Vivier
Quoted 5 lines · Daniel P. Berrangé

The -device JSON syntax impl leaks a reference on the created DeviceState instance. As a result when you hot-unplug the device, the device_finalize method won't be called and thus it will fail to emit the required DEVICE_DELETED event.

Quoted 6 lines
Quoted 4 lines

A 'json-cli' feature was previously added against the 'device_add' QMP command QAPI schema to indicated to mgmt apps that -device supported JSON syntax. Given the hotplug bug that feature flag is no unusable for its purpose, so

Not sure to understand: do you mean "now unusable"?

An application wants to known whether QEMU can support JSON syntax with -device. If they look for the 'json-cli' feature as a witness, they'll end up using JSON with QEMU 6.2 which is giving them broken hotplug. This is unusable for any non-trivial use cases. So we need a new witness to indicate whether JSON is viable with -device, that only the newly fixed QEMU will report.

Quoted 6 lines
Quoted 3 lines

I understand that, my problem was with your sentence:

"Given the hotplug bug that feature flag is no unusable for its purpose"

What's the problem with that ? It is reasonabled to say a -device impl which is broken for hotplug is not usable for non-toy use cases.

The problem for me is the double negation: "no" and "unusable"

Thanks,
Laurent

Applied
#11 lore raw
In reply to Daniel P. Berrangé

Am 05.01.2022 um 13:38 hat Daniel P. Berrangé geschrieben:

Quoted 3 lines

Libvirt switched to using -device JSON support, but we discovered in testing that it is broken for hotplug, never sending DEVICE_DELETED events. This is caused by a subtle refcount leak.

Oops, so I fell again in the trap of this interface returning a strong reference... Maybe it's just me, but I find it highly unintuitive.

Thanks, applied to the block branch.

Kevin

Acked-by on v1 1/1
#10 lore raw

Re: [PATCH 1/1] softmmu: fix device deletion events with -device JSON syntax

In reply to Daniel P. Berrangé
Quoted 9 lines · Daniel P. Berrangé

The -device JSON syntax impl leaks a reference on the created DeviceState instance. As a result when you hot-unplug the device, the device_finalize method won't be called and thus it will fail to emit the required DEVICE_DELETED event.

A 'json-cli' feature was previously added against the 'device_add' QMP command QAPI schema to indicated to mgmt apps that -device supported JSON syntax. Given the hotplug bug that feature flag is no unusable for its purpose, so

As Laurent and Thomas pointed out, this should be "is not usable" or "is unusable".

Quoted 16 lines

we add a new 'json-cli-hotplug' feature to indicate the -device supports JSON without breaking hotplug.

---
 qapi/qdev.json                 |  5 ++++-
 softmmu/vl.c                   |  4 +++-
 tests/qtest/device-plug-test.c | 19 +++++++++++++++++++
 3 files changed, 26 insertions(+), 2 deletions(-)
qapi/qdev.json +0 -0
index 69656b14df..26cd10106b 100644

qapi/qdev.json line 49

Quoted 6 lines
qapi/qdev.json +3 -0
@@ -44,6 +44,9 @@
 # @json-cli: If present, the "-device" command line option supports JSON
 #            syntax with a structure identical to the arguments of this
 #            command.
+# @json-cli-hotplug: If present, the "-device" command line option supports JSON
+#                    syntax without the reference counting leak that broke
+#                    hot-unplug

For local consistency, please end the sentence with a period and wrap lines like so:

# @json-cli-hotplug: If present, the "-device" command line option supports
# JSON syntax without the reference counting leak that
# broke hot-unplug.

qapi/qdev.json line 83

Quoted 12 lines
qapi/qdev.json +1 -1
 #
 # Notes:
 #
@@ -74,7 +77,7 @@
 { 'command': 'device_add',
   'data': {'driver': 'str', '*bus': 'str', '*id': 'str'},
   'gen': false, # so we can get the additional arguments
-  'features': ['json-cli'] }
+  'features': ['json-cli', 'json-cli-hotplug'] }
 
 ##
 # @device_del:

Kevin, I hope you can apply these touch-ups in your tree. Then, QAPI schema

[...]