From: Ian Jackson Subject: Re: [PATCH 1/3] libxl_qmp, Introduce libxl__qmp_insert_cdrom. Date: Tue, 31 Jul 2012 13:44:09 +0100 Message-ID: <20503.54041.906215.220212@mariner.uk.xensource.com> References: <1343409451-30136-1-git-send-email-anthony.perard@citrix.com> <1343409451-30136-2-git-send-email-anthony.perard@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1343409451-30136-2-git-send-email-anthony.perard@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Anthony PERARD Cc: Roger Pau Monne , Ian Campbell , Xen Devel List-Id: xen-devel@lists.xenproject.org Anthony PERARD writes ("[PATCH 1/3] 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. ... > +int libxl__qmp_insert_cdrom(libxl__gc *gc, int domid, > + const libxl_device_disk *disk) > +{ > + libxl__qmp_handler *qmp = NULL; > + char *device_id; > + int rc = 0; > + > + device_id = libxl__sprintf(gc, "ide-%s", disk->vdev); > + if (!device_id) > + return ERROR_NOMEM; Use GCSPRINTF (and ditch the error check) ? > + qmp = libxl__qmp_initialize(gc, domid); > + if (!qmp) > + return ERROR_FAIL; AIUI qemu only supports one concurrent user of its qmp. You don't seem to have anything here to deal with that. Personally I think that needs to be fixed in qemu. > + if (disk->format == LIBXL_DISK_FORMAT_EMPTY) { > + libxl__json_object *args = NULL; > + > + args = qmp_parameters_add_string(gc, NULL, "device", device_id); What is this function ? I don't seem to be able to find it. Perhaps it's in another patch series of yours ? Thanks, Ian.