[libvirt] [PATCHv2 44/62] qemu: monitor: Add APIs for cdrom tray handling for -blockdev

Ján Tomko jtomko at redhat.com
Thu Aug 16 14:13:31 UTC 2018


On Mon, Aug 13, 2018 at 06:00:18PM +0200, Peter Krempa wrote:
>With blockdev we can use the full range of commands to manipulate the
>tray and the medium separately. Implement monitor code for this.
>
>Schema testing done in the qemumonitorjsontest allows us to verify that
>we generate the commands correctly.
>
>Signed-off-by: Peter Krempa <pkrempa at redhat.com>
>---
> src/qemu/qemu_monitor.c      |  51 +++++++++++++++++++
> src/qemu/qemu_monitor.h      |  14 ++++++
> src/qemu/qemu_monitor_json.c | 114 +++++++++++++++++++++++++++++++++++++++++++
> src/qemu/qemu_monitor_json.h |  18 +++++++
> tests/qemumonitorjsontest.c  |   8 +++
> 5 files changed, 205 insertions(+)
>
>diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
>index 49dc478f5b..0a29ad7502 100644
>--- a/src/qemu/qemu_monitor.c
>+++ b/src/qemu/qemu_monitor.c
>@@ -4336,6 +4336,57 @@ qemuMonitorBlockdevDel(qemuMonitorPtr mon,
>     return qemuMonitorJSONBlockdevDel(mon, nodename);
> }
>
>+int
>+qemuMonitorBlockdevTrayOpen(qemuMonitorPtr mon,
>+                            const char *id,
>+                            bool force)
>+{
>+    VIR_DEBUG("id=%s force=%d", id, force);
>+
>+    QEMU_CHECK_MONITOR(mon);
>+
>+    return qemuMonitorJSONBlockdevTrayOpen(mon, id, force);
>+}
>+
>+
>+int
>+qemuMonitorBlockdevTrayClose(qemuMonitorPtr mon,
>+                             const char *id)
>+{
>+    VIR_DEBUG("id=%s", id);
>+
>+    QEMU_CHECK_MONITOR(mon);
>+
>+    return qemuMonitorJSONBlockdevTrayClose(mon, id);
>+}
>+
>+
>+int
>+qemuMonitorBlockdevMediumRemove(qemuMonitorPtr mon,
>+                                const char *id)
>+{
>+    VIR_DEBUG("id=%s", id);
>+
>+    QEMU_CHECK_MONITOR(mon);
>+
>+    return qemuMonitorJSONBlockdevMediumRemove(mon, id);
>+}
>+
>+
>+

Extra empty line.

>+int
>+qemuMonitorBlockdevMediumInsert(qemuMonitorPtr mon,
>+                                const char *id,
>+                                const char *nodename)
>+{
>+    VIR_DEBUG("id=%s nodename=%s", id, nodename);
>+
>+    QEMU_CHECK_MONITOR(mon);
>+
>+    return qemuMonitorJSONBlockdevMediumInsert(mon, id, nodename);
>+}
>+
>+
> char *
> qemuMonitorGetSEVMeasurement(qemuMonitorPtr mon)
> {

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180816/bcedb139/attachment-0001.sig>


More information about the libvir-list mailing list