From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49279) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtFS9-0007WQ-1m for qemu-devel@nongnu.org; Thu, 10 Jan 2013 05:33:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TtFS7-0003Rb-VE for qemu-devel@nongnu.org; Thu, 10 Jan 2013 05:33:40 -0500 Received: from mail-qc0-f174.google.com ([209.85.216.174]:47087) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtFS7-0003RW-Ql for qemu-devel@nongnu.org; Thu, 10 Jan 2013 05:33:39 -0500 Received: by mail-qc0-f174.google.com with SMTP id o22so239100qcr.5 for ; Thu, 10 Jan 2013 02:33:39 -0800 (PST) Sender: Paolo Bonzini Message-ID: <50EE98FF.3090607@redhat.com> Date: Thu, 10 Jan 2013 11:33:35 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1357566928-25361-1-git-send-email-kraxel@redhat.com> <1357566928-25361-6-git-send-email-kraxel@redhat.com> In-Reply-To: <1357566928-25361-6-git-send-email-kraxel@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 05/11] chardev: add hmp hotplug commands List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org Il 07/01/2013 14:55, Gerd Hoffmann ha scritto: > +void hmp_chardev_add(Monitor *mon, const QDict *qdict) > +{ > + const char *args = qdict_get_str(qdict, "args"); > + Error *err = NULL; > + QemuOpts *opts; > + > + opts = qemu_opts_parse(qemu_find_opts("chardev"), args, 1); > + if (opts == NULL) { > + error_setg(&err, "Parsing chardev args failed\n"); > + } else { > + qemu_chr_new_from_opts(opts, NULL, &err); This ought to use qmp_chardev_add and a generic opts->ChardevBackend conversion. But IMHO, this kind of intermediate conversion is okay, with the "correct" thing deferred; being able to play with hotplug from HMP is worth the small wart. It's really Luiz's decision, so I'm not giving the reviewed-by (yet). Paolo > + } > + hmp_handle_error(mon, &err); > +} > +