From 7d94e71b679469a33cdc00ce5989dfe8b0244646 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 17 Dec 2013 06:46:35 +0100 Subject: [PATCH 148/212] 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. Signed-off-by: Markus Armbruster --- qmp-commands.hx | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) Signed-off-by: Michal Novotny --- qmp-commands.hx | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/qmp-commands.hx b/qmp-commands.hx index 4a02a51..68ffc94 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -108,6 +108,37 @@ Note: The "force" argument defaults to false. EQMP { + .name = RFQDN_REDHAT "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 +__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_input_change, -- 1.7.1