From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48445) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtHLu-0001Wb-8l for qemu-devel@nongnu.org; Thu, 10 Jan 2013 07:35:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TtHLq-0003zr-BW for qemu-devel@nongnu.org; Thu, 10 Jan 2013 07:35:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37232) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtHLq-0003zi-4G for qemu-devel@nongnu.org; Thu, 10 Jan 2013 07:35:18 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0ACZHqR008198 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 10 Jan 2013 07:35:17 -0500 Date: Thu, 10 Jan 2013 10:35:22 -0200 From: Luiz Capitulino Message-ID: <20130110103522.5317b0b2@doriath.home> In-Reply-To: <50EE98FF.3090607@redhat.com> References: <1357566928-25361-1-git-send-email-kraxel@redhat.com> <1357566928-25361-6-git-send-email-kraxel@redhat.com> <50EE98FF.3090607@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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: Paolo Bonzini Cc: Gerd Hoffmann , qemu-devel@nongnu.org On Thu, 10 Jan 2013 11:33:35 +0100 Paolo Bonzini wrote: > 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). Fine with me. But please, add a comment if you respin.