From b7893c41a586bb305f3a7aab8c541367d7cced90 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 17 Dec 2013 06:46:35 +0100 Subject: QMP: Forward-port __com.redhat_drive_del from RHEL-6 RH-Author: Markus Armbruster Message-id: <1387262799-10350-3-git-send-email-armbru@redhat.com> Patchwork-id: 56292 O-Subject: [PATCH v2 2/6] QMP: Forward-port __com.redhat_drive_del from RHEL-6 Bugzilla: 889051 RH-Acked-by: Fam Zheng RH-Acked-by: Stefan Hajnoczi RH-Acked-by: Luiz Capitulino From: Markus Armbruster Upstream has drive_del, but only in HMP. The backport to RHEL-6 added it to QMP as well. Since the QMP command is a downstream extension, it needs the __com.redhat_ prefix. Since RHEL-6 doesn't have separate definition of QMP and HMP commands, both the QMP and the HMP command got the prefix. RHEL-7 inherits HMP command drive_del from upstream. Add QMP command __com.redhat_drive_del for RHEL-6 compatibility. If we needed similar compatibility for the HMP command, we'd have to add __com.redhat_drive_del as alias for drive_del. But we don't. Code copied from RHEL-6's qemu-monitor.hx as of qemu-kvm-0.12.1.2-2.418.el6. It has a "drive_del" without the prefix in the documentation. Fixed here. Hardly worth fixing in RHEL-6 now. Rebase notes (2.4.): - use traditional cmd for qmp - remove user_print Signed-off-by: Markus Armbruster --- qmp-commands.hx | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/qmp-commands.hx b/qmp-commands.hx index 8274cb3..5fce460 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -108,6 +108,36 @@ Note: The "force" argument defaults to false. EQMP { + .name = RFQDN_REDHAT "drive_del", + .args_type = "id:s", + .params = "device", + .help = "remove host block device", + .mhandler.cmd = hmp_drive_del, + }, + +SQMP +__com.redhat_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. +These errors are always reported to the guest, regardless of the drive's error +actions (drive options rerror, werror). + +Arguments: + +- "id": the device's ID (json-string) + +Example: + +-> { "execute": "__com.redhat_drive_del", "arguments": { "id": "block1" } } +<- { "return": {} } + +EQMP + + { .name = "change", .args_type = "device:B,target:F,arg:s?", .mhandler.cmd_new = qmp_marshal_change, -- 2.5.5