qdev hotplug: infrastructure and monitor commands.
Adds device_add and device_del commands. device_add accepts accepts
the same syntax like the -device command line switch. device_del
expects a device id. So you should tag your devices with ids if you
want to remove them later on, like this:
device_add pci-ohci,id=ohci
device_del ohci
Unplugging via pci_del or usb_del works too.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
diff --git a/qemu-monitor.hx b/qemu-monitor.hx
index 6aa99ce..784d30e 100644
--- a/qemu-monitor.hx
+++ b/qemu-monitor.hx
@@ -369,8 +369,24 @@
command @code{info usb} to see the devices you can remove.
ETEXI
- { "cpu", "index:i", do_cpu_set,
- "index", "set the default CPU" },
+ { "device_add", "config:s", do_device_add,
+ "device", "add device, like -device on the command line" },
+STEXI
+@item device_add @var{config}
+
+Add device.
+ETEXI
+
+ { "device_del", "id:s", do_device_del,
+ "device", "remove device" },
+STEXI
+@item device_del @var{id}
+
+Remove device @var{id}.
+ETEXI
+
+ { "cpu", "index:i", do_cpu_set, "index", "set the default CPU" },
+
STEXI
Set the default CPU.
ETEXI