[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] libxl_qmp: Introduce libxl__qmp_insert_cdrom.


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Wed, 10 Oct 2012 22:11:16 +0000
  • Delivery-date: Wed, 10 Oct 2012 22:11:21 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Anthony PERARD <anthony.perard@xxxxxxxxxx>
# Date 1349777299 -3600
# Node ID 694f997be9bfc63a3efe27329c7266dbdf0bf352
# Parent  dbd1e837cb5485c0961082b5f6464e01a2d9979d
libxl_qmp: Introduce libxl__qmp_insert_cdrom.

This function can eject or change the CDROM for a guest that use qemu-xen as a
device-model.

Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Committed-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---


diff -r dbd1e837cb54 -r 694f997be9bf tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h      Tue Oct 09 10:39:09 2012 +0100
+++ b/tools/libxl/libxl_internal.h      Tue Oct 09 11:08:19 2012 +0100
@@ -1406,6 +1406,7 @@ _hidden int libxl__qmp_resume(libxl__gc 
 _hidden int libxl__qmp_save(libxl__gc *gc, int domid, const char *filename);
 /* Set dirty bitmap logging status */
 _hidden int libxl__qmp_set_global_dirty_log(libxl__gc *gc, int domid, bool 
enable);
+_hidden int libxl__qmp_insert_cdrom(libxl__gc *gc, int domid, const 
libxl_device_disk *disk);
 /* close and free the QMP handler */
 _hidden void libxl__qmp_close(libxl__qmp_handler *qmp);
 /* remove the socket file, if the file has already been removed,
diff -r dbd1e837cb54 -r 694f997be9bf tools/libxl/libxl_qmp.c
--- a/tools/libxl/libxl_qmp.c   Tue Oct 09 10:39:09 2012 +0100
+++ b/tools/libxl/libxl_qmp.c   Tue Oct 09 11:08:19 2012 +0100
@@ -913,6 +913,22 @@ int libxl__qmp_set_global_dirty_log(libx
                            NULL, NULL);
 }
 
+int libxl__qmp_insert_cdrom(libxl__gc *gc, int domid,
+                            const libxl_device_disk *disk)
+{
+    libxl__json_object *args = NULL;
+    int dev_number = libxl__device_disk_dev_number(disk->vdev, NULL, NULL);
+
+    QMP_PARAMETERS_SPRINTF(&args, "device", "ide-%i", dev_number);
+
+    if (disk->format == LIBXL_DISK_FORMAT_EMPTY) {
+        return qmp_run_command(gc, domid, "eject", args, NULL, NULL);
+    } else {
+        qmp_parameters_add_string(gc, &args, "target", disk->pdev_path);
+        return qmp_run_command(gc, domid, "change", args, NULL, NULL);
+    }
+}
+
 int libxl__qmp_initializations(libxl__gc *gc, uint32_t domid,
                                const libxl_domain_config *guest_config)
 {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.