[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH v2 11/21] Implement dimm_add and dimm_del hmp/qm
From: |
Vasilis Liaskovitis |
Subject: |
[Qemu-devel] [RFC PATCH v2 11/21] Implement dimm_add and dimm_del hmp/qmp commands |
Date: |
Wed, 11 Jul 2012 12:31:56 +0200 |
Hot-add hmp syntax: dimm_add dimmid
Hot-remove hmp syntax: dimm_del dimmid
Respective qmp commands are "dimm-add", "dimm-del".
Signed-off-by: Vasilis Liaskovitis <address@hidden>
---
hmp-commands.hx | 32 ++++++++++++++++++++++++++++++++
monitor.c | 11 +++++++++++
monitor.h | 3 +++
qmp-commands.hx | 39 +++++++++++++++++++++++++++++++++++++++
4 files changed, 85 insertions(+), 0 deletions(-)
diff --git a/hmp-commands.hx b/hmp-commands.hx
index f5d9d91..012c150 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -618,6 +618,38 @@ Add device.
ETEXI
{
+ .name = "dimm_del",
+ .args_type = "id:s",
+ .params = "id",
+ .help = "hot-remove memory (dimm device)",
+ .user_print = monitor_user_noop,
+ .mhandler.cmd_new = do_dimm_del,
+ },
+
+STEXI
address@hidden dimm_del @var{config}
address@hidden dimm_del
+
+Hot-remove dimm.
+ETEXI
+
+ {
+ .name = "dimm_add",
+ .args_type = "id:s",
+ .params = "id",
+ .help = "hot-add memory (dimm device)",
+ .user_print = monitor_user_noop,
+ .mhandler.cmd_new = do_dimm_add,
+ },
+
+STEXI
address@hidden dimm_add @var{config}
address@hidden dimm_add
+
+Hot-add dimm.
+ETEXI
+
+ {
.name = "device_del",
.args_type = "id:s",
.params = "device",
diff --git a/monitor.c b/monitor.c
index f6107ba..d3d95a6 100644
--- a/monitor.c
+++ b/monitor.c
@@ -67,6 +67,7 @@
#include "qmp-commands.h"
#include "hmp.h"
#include "qemu-thread.h"
+#include "hw/dimm.h"
/* for pic/irq_info */
#if defined(TARGET_SPARC)
@@ -4813,3 +4814,13 @@ int monitor_read_block_device_key(Monitor *mon, const
char *device,
return monitor_read_bdrv_key_start(mon, bs, completion_cb, opaque);
}
+
+int do_dimm_add(Monitor *mon, const QDict *qdict, QObject **ret_data)
+{
+ return dimm_do(mon, qdict, true);
+}
+
+int do_dimm_del(Monitor *mon, const QDict *qdict, QObject **ret_data)
+{
+ return dimm_do(mon, qdict, false);
+}
diff --git a/monitor.h b/monitor.h
index 5f4de1b..afdd721 100644
--- a/monitor.h
+++ b/monitor.h
@@ -86,4 +86,7 @@ int qmp_qom_set(Monitor *mon, const QDict *qdict, QObject
**ret);
int qmp_qom_get(Monitor *mon, const QDict *qdict, QObject **ret);
+int do_dimm_add(Monitor *mon, const QDict *qdict, QObject **ret_data);
+int do_dimm_del(Monitor *mon, const QDict *qdict, QObject **ret_data);
+
#endif /* !MONITOR_H */
diff --git a/qmp-commands.hx b/qmp-commands.hx
index 2e1a38e..7efd628 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -2209,3 +2209,42 @@ EQMP
.args_type = "implements:s?,abstract:b?",
.mhandler.cmd_new = qmp_marshal_input_qom_list_types,
},
+ {
+ .name = "dimm-add",
+ .args_type = "id:s",
+ .mhandler.cmd_new = do_dimm_add,
+ },
+SQMP
+dimm-add
+-------------
+
+Hot-add memory DIMM
+
+Will hotplug memory DIMMs with given id.
+
+Example:
+
+-> { "execute": "dimm-add", "arguments": { "id": "dimm0" } }
+<- { "return": {} }
+
+EQMP
+
+ {
+ .name = "dimm-del",
+ .args_type = "id:s",
+ .mhandler.cmd_new = do_dimm_del,
+ },
+SQMP
+dimm-del
+-------------
+
+Hot-remove memory DIMM
+
+Will hot-unplug memory DIMMs with given id.
+
+Example:
+
+-> { "execute": "dimm-del", "arguments": { "id": "dimm0" } }
+<- { "return": {} }
+
+EQMP
--
1.7.9
- [Qemu-devel] [RFC PATCH v2 17/21][SeaBIOS] acpi_dsdt: Revert internal dimm state on _OST failure, (continued)
- [Qemu-devel] [RFC PATCH v2 17/21][SeaBIOS] acpi_dsdt: Revert internal dimm state on _OST failure, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 06/21] dimm: Implement memory device abstraction, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 03/21][SeaBIOS] acpi-dsdt: Implement functions for memory hotplug, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 12/21] fix live-migration when "populated=on" is missing, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 10/21] Implement "-dimm" command line option, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 09/21] pc: Add dimm paravirt SRAT info, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 11/21] Implement dimm_add and dimm_del hmp/qmp commands,
Vasilis Liaskovitis <=
- [Qemu-devel] [RFC PATCH v2 07/21] acpi_piix4: Implement memory device hotplug registers, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 16/21] acpi_piix4: Update dimm state on VM reboot, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 13/21] Implement memory hotplug notification lists, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 15/21] acpi_piix4: _OST dimm support, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 18/21] acpi_piix4: Update dimm bitmap state on hot-remove fail, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 19/21] Implement "info memtotal" and "query-memtotal", Vasilis Liaskovitis, 2012/07/11