* [Qemu-devel] [PATCH] Add drive_add/drive_del to qmp_commands.hx
@ 2011-02-17 8:57 Hu Tao
2011-02-17 12:09 ` Anthony Liguori
2011-02-17 12:22 ` Markus Armbruster
0 siblings, 2 replies; 3+ messages in thread
From: Hu Tao @ 2011-02-17 8:57 UTC (permalink / raw)
To: qemu-devel-list
This patch enables drive_add/drive_del qmp commands, which are required
by libvirt when connecting to qemu using QMP.
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
---
qmp-commands.hx | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 59 insertions(+), 0 deletions(-)
diff --git a/qmp-commands.hx b/qmp-commands.hx
index df40a3d..cf1cd13 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -1774,3 +1774,62 @@ Example:
EQMP
+ {
+ .name = "drive_add",
+ .args_type = "pci_addr:s,opts:s",
+ .params = "[[<domain>:]<bus>:]<slot>\n"
+ "[file=file][,if=type][,bus=n]\n"
+ "[,unit=m][,media=d][index=i]\n"
+ "[,cyls=c,heads=h,secs=s[,trans=t]]\n"
+ "[snapshot=on|off][,cache=on|off]",
+
+ .help = "add drive to PCI storage controller",
+ .mhandler.cmd = drive_hot_add,
+ },
+
+SQMP
+drive_add
+---------
+
+Add drive to PCI storage controller.
+
+Arguments:
+
+- "pci_addr": pci address.
+- "opts": options of the drive to be added.
+
+Example:
+
+-> { "execute": "drive_add", "arguments": { "pci_addr": "dummy", "opts": "file=/path/to/disk.img, if=none, id=drive-virtio-disk1, format=raw" } }
+<- { "return": {} }
+
+EQMP
+
+ {
+ .name = "drive_del",
+ .args_type = "id:s",
+ .params = "device",
+ .help = "remove host block device",
+ .user_print = monitor_user_noop,
+ .mhandler.cmd_new = do_drive_del,
+ },
+
+SQMP
+drive_del
+---------
+
+Remove host block device. The result is that guest generated IO is no longer
+submitted against the host device underlying the disk. Once a drive has
+been deleted, the QEMU Block layer returns -EIO which results in IO
+errors in the guest for applications that are reading/writing to the device.
+
+Arguments:
+
+- "id": id of device to be removed.
+
+Examples:
+
+-> { "execute": "drive_del", "arguments": { "id": "drive-virtio-disk1"} }
+<- { "return": {} }
+
+EQMP
--
1.7.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] Add drive_add/drive_del to qmp_commands.hx
2011-02-17 8:57 [Qemu-devel] [PATCH] Add drive_add/drive_del to qmp_commands.hx Hu Tao
@ 2011-02-17 12:09 ` Anthony Liguori
2011-02-17 12:22 ` Markus Armbruster
1 sibling, 0 replies; 3+ messages in thread
From: Anthony Liguori @ 2011-02-17 12:09 UTC (permalink / raw)
To: Hu Tao; +Cc: qemu-devel-list
On 02/17/2011 02:57 AM, Hu Tao wrote:
> This patch enables drive_add/drive_del qmp commands, which are required
> by libvirt when connecting to qemu using QMP.
>
> Signed-off-by: Hu Tao<hutao@cn.fujitsu.com>
> ---
> qmp-commands.hx | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 59 insertions(+), 0 deletions(-)
>
> diff --git a/qmp-commands.hx b/qmp-commands.hx
> index df40a3d..cf1cd13 100644
> --- a/qmp-commands.hx
> +++ b/qmp-commands.hx
> @@ -1774,3 +1774,62 @@ Example:
>
> EQMP
>
> + {
> + .name = "drive_add",
> + .args_type = "pci_addr:s,opts:s",
> + .params = "[[<domain>:]<bus>:]<slot>\n"
> + "[file=file][,if=type][,bus=n]\n"
> + "[,unit=m][,media=d][index=i]\n"
> + "[,cyls=c,heads=h,secs=s[,trans=t]]\n"
> + "[snapshot=on|off][,cache=on|off]",
> +
> + .help = "add drive to PCI storage controller",
> + .mhandler.cmd = drive_hot_add,
> + },
> +
> +SQMP
> +drive_add
> +---------
> +
> +Add drive to PCI storage controller.
> +
> +Arguments:
> +
> +- "pci_addr": pci address.
> +- "opts": options of the drive to be added.
> +
> +Example:
> +
> +-> { "execute": "drive_add", "arguments": { "pci_addr": "dummy", "opts": "file=/path/to/disk.img, if=none, id=drive-virtio-disk1, format=raw" } }
>
QMP command should not take encoded arguments.
Regards,
Anthony Liguori
> +<- { "return": {} }
> +
> +EQMP
> +
> + {
> + .name = "drive_del",
> + .args_type = "id:s",
> + .params = "device",
> + .help = "remove host block device",
> + .user_print = monitor_user_noop,
> + .mhandler.cmd_new = do_drive_del,
> + },
> +
> +SQMP
> +drive_del
> +---------
> +
> +Remove host block device. The result is that guest generated IO is no longer
> +submitted against the host device underlying the disk. Once a drive has
> +been deleted, the QEMU Block layer returns -EIO which results in IO
> +errors in the guest for applications that are reading/writing to the device.
> +
> +Arguments:
> +
> +- "id": id of device to be removed.
> +
> +Examples:
> +
> +-> { "execute": "drive_del", "arguments": { "id": "drive-virtio-disk1"} }
> +<- { "return": {} }
> +
> +EQMP
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] Add drive_add/drive_del to qmp_commands.hx
2011-02-17 8:57 [Qemu-devel] [PATCH] Add drive_add/drive_del to qmp_commands.hx Hu Tao
2011-02-17 12:09 ` Anthony Liguori
@ 2011-02-17 12:22 ` Markus Armbruster
1 sibling, 0 replies; 3+ messages in thread
From: Markus Armbruster @ 2011-02-17 12:22 UTC (permalink / raw)
To: Hu Tao; +Cc: qemu-devel-list
Hu Tao <hutao@cn.fujitsu.com> writes:
> This patch enables drive_add/drive_del qmp commands, which are required
> by libvirt when connecting to qemu using QMP.
These commands were intentionally left out of QMP because they are badly
designed.
I understand the need for drive hot plug in QMP. I started to work on
saner commands some time ago, but too many other things took priority.
I still hope to finish the job.
Can you use human monitor passthrough in the meantime?
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-02-17 12:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-17 8:57 [Qemu-devel] [PATCH] Add drive_add/drive_del to qmp_commands.hx Hu Tao
2011-02-17 12:09 ` Anthony Liguori
2011-02-17 12:22 ` Markus Armbruster
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).