|
|
4a2fec |
From 365e9ae133897df34817774c93b40ecee0821cf1 Mon Sep 17 00:00:00 2001
|
|
|
4a2fec |
From: Markus Armbruster <armbru@redhat.com>
|
|
|
4a2fec |
Date: Tue, 14 Mar 2017 14:25:44 +0100
|
|
|
4a2fec |
Subject: HMP: Forward-port __com.redhat_drive_add from RHEL-6
|
|
|
4a2fec |
|
|
|
4a2fec |
RH-Author: Markus Armbruster <armbru@redhat.com>
|
|
|
4a2fec |
Message-id: <1387262799-10350-5-git-send-email-armbru@redhat.com>
|
|
|
4a2fec |
Patchwork-id: 56295
|
|
|
4a2fec |
O-Subject: [PATCH v2 4/6] HMP: Forward-port __com.redhat_drive_add from RHEL-6
|
|
|
4a2fec |
Bugzilla: 889051
|
|
|
4a2fec |
RH-Acked-by: Fam Zheng <famz@redhat.com>
|
|
|
4a2fec |
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
4a2fec |
RH-Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
|
|
|
4a2fec |
|
|
|
4a2fec |
From: Markus Armbruster <armbru@redhat.com>
|
|
|
4a2fec |
|
|
|
4a2fec |
Signed-off-by: Markus Armbruster <armbru@redhat.com>
|
|
|
4a2fec |
|
|
|
4a2fec |
Rebase notes (2.8.0):
|
|
|
4a2fec |
- qmp-commands.hx replaced by docs/qmp-commands.txt (commit bd6092e)
|
|
|
4a2fec |
- mhandler.cmd attribute renamed to cmd (commit 2b9e357)
|
|
|
4a2fec |
|
|
|
4a2fec |
Rebase notes (2.4.0):
|
|
|
4a2fec |
- removed user_print
|
|
|
4a2fec |
|
|
|
4a2fec |
Merged patches (2.9.0):
|
|
|
4a2fec |
- 854d5bf Drop macro RFQDN_REDHAT (partially)
|
|
|
4a2fec |
- 4804631 HMP: Clean up botched conflict resolution in user manual
|
|
|
4a2fec |
- bb06f4 HMP: Fix documentation of __com.redhat.drive_add
|
|
|
4a2fec |
|
|
|
4a2fec |
Merged patches (2.7.0):
|
|
|
4a2fec |
- a28dcc5 Fix crash bug in rebase of__com.redhat_drive_add
|
|
|
4a2fec |
|
|
|
4a2fec |
(cherry picked from commit 913177df4933b58f50ba55ad2e1205b03b61fc54)
|
|
|
4a2fec |
---
|
|
|
4a2fec |
blockdev.c | 14 ++++++++++++++
|
|
|
4a2fec |
device-hotplug.c | 12 +++++++++++-
|
|
|
4a2fec |
hmp-commands.hx | 14 ++++++++++++++
|
|
|
4a2fec |
include/sysemu/blockdev.h | 4 +++-
|
|
|
4a2fec |
include/sysemu/sysemu.h | 1 +
|
|
|
4a2fec |
monitor.c | 2 +-
|
|
|
4a2fec |
vl.c | 1 +
|
|
|
4a2fec |
7 files changed, 45 insertions(+), 3 deletions(-)
|
|
|
4a2fec |
|
|
|
4a2fec |
diff --git a/blockdev.c b/blockdev.c
|
|
|
4a2fec |
index d5e8ee3..e525ebf 100644
|
|
|
4a2fec |
--- a/blockdev.c
|
|
|
4a2fec |
+++ b/blockdev.c
|
|
|
4a2fec |
@@ -4132,3 +4132,17 @@ QemuOptsList qemu_drive_opts = {
|
|
|
4a2fec |
{ /* end of list */ }
|
|
|
4a2fec |
},
|
|
|
4a2fec |
};
|
|
|
4a2fec |
+
|
|
|
4a2fec |
+QemuOptsList qemu_simple_drive_opts = {
|
|
|
4a2fec |
+ .name = "simple-drive",
|
|
|
4a2fec |
+ .implied_opt_name = "format",
|
|
|
4a2fec |
+ .head = QTAILQ_HEAD_INITIALIZER(qemu_simple_drive_opts.head),
|
|
|
4a2fec |
+ .desc = {
|
|
|
4a2fec |
+ /*
|
|
|
4a2fec |
+ * no elements => accept any
|
|
|
4a2fec |
+ * sanity checking will happen later
|
|
|
4a2fec |
+ * when setting device properties
|
|
|
4a2fec |
+ */
|
|
|
4a2fec |
+ { /* end if list */ }
|
|
|
4a2fec |
+ }
|
|
|
4a2fec |
+};
|
|
|
4a2fec |
diff --git a/device-hotplug.c b/device-hotplug.c
|
|
|
4a2fec |
index 12c17e5..218f7b3 100644
|
|
|
4a2fec |
--- a/device-hotplug.c
|
|
|
4a2fec |
+++ b/device-hotplug.c
|
|
|
4a2fec |
@@ -117,7 +117,7 @@ static void check_parm(const char *key, QObject *obj, void *opaque)
|
|
|
4a2fec |
}
|
|
|
4a2fec |
}
|
|
|
4a2fec |
|
|
|
4a2fec |
-void simple_drive_add(QDict *qdict, QObject **ret_data, Error **errp)
|
|
|
4a2fec |
+void qmp_simple_drive_add(QDict *qdict, QObject **ret_data, Error **errp)
|
|
|
4a2fec |
{
|
|
|
4a2fec |
int stopped;
|
|
|
4a2fec |
Error *local_err = NULL;
|
|
|
4a2fec |
@@ -153,3 +153,13 @@ void simple_drive_add(QDict *qdict, QObject **ret_data, Error **errp)
|
|
|
4a2fec |
|
|
|
4a2fec |
return;
|
|
|
4a2fec |
}
|
|
|
4a2fec |
+
|
|
|
4a2fec |
+void hmp_simple_drive_add(Monitor *mon, const QDict *qdict)
|
|
|
4a2fec |
+{
|
|
|
4a2fec |
+ Error *err = NULL;
|
|
|
4a2fec |
+
|
|
|
4a2fec |
+ qmp_simple_drive_add((QDict *)qdict, NULL, &err;;
|
|
|
4a2fec |
+ if (err) {
|
|
|
4a2fec |
+ error_report_err(err);
|
|
|
4a2fec |
+ }
|
|
|
4a2fec |
+}
|
|
|
4a2fec |
diff --git a/hmp-commands.hx b/hmp-commands.hx
|
|
|
4a2fec |
index 3cd63be..5b4cf6b 100644
|
|
|
4a2fec |
--- a/hmp-commands.hx
|
|
|
4a2fec |
+++ b/hmp-commands.hx
|
|
|
4a2fec |
@@ -1315,6 +1315,20 @@ Add drive to PCI storage controller.
|
|
|
4a2fec |
ETEXI
|
|
|
4a2fec |
|
|
|
4a2fec |
{
|
|
|
4a2fec |
+ .name = "__com.redhat_drive_add",
|
|
|
4a2fec |
+ .args_type = "simple-drive:O",
|
|
|
4a2fec |
+ .params = "id=name,[file=file][,format=f][,media=d]...",
|
|
|
4a2fec |
+ .help = "Create a drive similar to -drive if=none.",
|
|
|
4a2fec |
+ .cmd = hmp_simple_drive_add,
|
|
|
4a2fec |
+ },
|
|
|
4a2fec |
+
|
|
|
4a2fec |
+STEXI
|
|
|
4a2fec |
+@item __com.redhat_drive_add
|
|
|
4a2fec |
+@findex __com.redhat_drive_add
|
|
|
4a2fec |
+Create a drive similar to -drive if=none.
|
|
|
4a2fec |
+ETEXI
|
|
|
4a2fec |
+
|
|
|
4a2fec |
+ {
|
|
|
4a2fec |
.name = "pcie_aer_inject_error",
|
|
|
4a2fec |
.args_type = "advisory_non_fatal:-a,correctable:-c,"
|
|
|
4a2fec |
"id:s,error_status:s,"
|
|
|
4a2fec |
diff --git a/include/sysemu/blockdev.h b/include/sysemu/blockdev.h
|
|
|
4a2fec |
index 3bda14c..c19c36a 100644
|
|
|
4a2fec |
--- a/include/sysemu/blockdev.h
|
|
|
4a2fec |
+++ b/include/sysemu/blockdev.h
|
|
|
4a2fec |
@@ -64,5 +64,7 @@ DriveInfo *drive_new(QemuOpts *arg, BlockInterfaceType block_default_type);
|
|
|
4a2fec |
void hmp_commit(Monitor *mon, const QDict *qdict);
|
|
|
4a2fec |
void hmp_drive_del(Monitor *mon, const QDict *qdict);
|
|
|
4a2fec |
|
|
|
4a2fec |
-void simple_drive_add(QDict *qdict, QObject **ret_data, Error **errp);
|
|
|
4a2fec |
+void hmp_simple_drive_add(Monitor *mon, const QDict *qdict);
|
|
|
4a2fec |
+void qmp_simple_drive_add(QDict *qdict, QObject **ret_data, Error **errp);
|
|
|
4a2fec |
+
|
|
|
4a2fec |
#endif
|
|
|
4a2fec |
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
|
|
|
4a2fec |
index 9caaacf..54fdc4f 100644
|
|
|
4a2fec |
--- a/include/sysemu/sysemu.h
|
|
|
4a2fec |
+++ b/include/sysemu/sysemu.h
|
|
|
4a2fec |
@@ -199,6 +199,7 @@ extern QemuOptsList qemu_legacy_drive_opts;
|
|
|
4a2fec |
extern QemuOptsList qemu_common_drive_opts;
|
|
|
4a2fec |
extern QemuOptsList qemu_drive_opts;
|
|
|
4a2fec |
extern QemuOptsList bdrv_runtime_opts;
|
|
|
4a2fec |
+extern QemuOptsList qemu_simple_drive_opts;
|
|
|
4a2fec |
extern QemuOptsList qemu_chardev_opts;
|
|
|
4a2fec |
extern QemuOptsList qemu_device_opts;
|
|
|
4a2fec |
extern QemuOptsList qemu_netdev_opts;
|
|
|
4a2fec |
diff --git a/monitor.c b/monitor.c
|
|
|
4a2fec |
index 76b8605..bade261 100644
|
|
|
4a2fec |
--- a/monitor.c
|
|
|
4a2fec |
+++ b/monitor.c
|
|
|
4a2fec |
@@ -1034,7 +1034,7 @@ void monitor_init_qmp_commands(void)
|
|
|
4a2fec |
QCO_NO_OPTIONS);
|
|
|
4a2fec |
qmp_register_command(&qmp_commands, "netdev_add", qmp_netdev_add,
|
|
|
4a2fec |
QCO_NO_OPTIONS);
|
|
|
4a2fec |
- qmp_register_command(&qmp_commands, "__com.redhat_drive_add", simple_drive_add,
|
|
|
4a2fec |
+ qmp_register_command(&qmp_commands, "__com.redhat_drive_add", qmp_simple_drive_add,
|
|
|
4a2fec |
QCO_NO_OPTIONS);
|
|
|
4a2fec |
|
|
|
4a2fec |
qmp_unregister_commands_hack();
|
|
|
4a2fec |
diff --git a/vl.c b/vl.c
|
|
|
4a2fec |
index a64b349..253da17 100644
|
|
|
4a2fec |
--- a/vl.c
|
|
|
4a2fec |
+++ b/vl.c
|
|
|
4a2fec |
@@ -3054,6 +3054,7 @@ int main(int argc, char **argv, char **envp)
|
|
|
4a2fec |
qemu_add_drive_opts(&qemu_common_drive_opts);
|
|
|
4a2fec |
qemu_add_drive_opts(&qemu_drive_opts);
|
|
|
4a2fec |
qemu_add_drive_opts(&bdrv_runtime_opts);
|
|
|
4a2fec |
+ qemu_add_opts(&qemu_simple_drive_opts);
|
|
|
4a2fec |
qemu_add_opts(&qemu_chardev_opts);
|
|
|
4a2fec |
qemu_add_opts(&qemu_device_opts);
|
|
|
4a2fec |
qemu_add_opts(&qemu_netdev_opts);
|
|
|
4a2fec |
--
|
|
|
4a2fec |
1.8.3.1
|
|
|
4a2fec |
|