From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46197) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMcOf-000823-Lg for qemu-devel@nongnu.org; Fri, 12 Oct 2012 06:23:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TMcOZ-0005oG-SE for qemu-devel@nongnu.org; Fri, 12 Oct 2012 06:23:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33519) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMcOZ-0005oA-II for qemu-devel@nongnu.org; Fri, 12 Oct 2012 06:23:07 -0400 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 q9CAN6XT007131 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 12 Oct 2012 06:23:06 -0400 Message-ID: <5077EF88.2070708@redhat.com> Date: Fri, 12 Oct 2012 12:23:04 +0200 From: Gerd Hoffmann MIME-Version: 1.0 References: <1350033962-16665-1-git-send-email-kraxel@redhat.com> <1350033962-16665-8-git-send-email-kraxel@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 7/7] chardev: add hotplug support. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org On 10/12/12 11:40, Paolo Bonzini wrote: > Il 12/10/2012 11:26, Gerd Hoffmann ha scritto: >> This patch adds chardev_add and chardev_del monitor commands. >> >> chardev_del is pretty straight forward, it just takes an id argument and >> zaps the chardev specified. >> >> chardev_add is more tricky as there are tons of arguments for the >> different backends. The hmp version limited to the most common use >> cases, especially when it comes to sockets: You can only specify port >> (tcp) or path (unix) and qemu will create a listening socket. For >> example this ... >> >> (qemu) chardev_add foo socket 42 >> >> ... will do the same as ... >> >> -chardev socket,id=foo,port=42,server,nowait > > Why not > > chardev_add socket,id=foo,port=42,server,nowait > > ? Yea, maybe, but see below. >> +{ 'command': 'chardev_add', 'data': {'id' : 'str', >> + 'backend' : 'str', >> + 'path' : 'str', >> + 'name' : 'str', >> + 'host' : 'str', >> + 'port' : 'str', > > You cannot pass NULLs via QMP, so these need to be optional. Fixed. > I suggest that you implement the commands in a similar way as netdev_add. Why? Isn't the whole point of using josn is that you'll get the stuff from the josn parser & marshaller in a usable form instead of having it to feed into yet another parser? I think the only reason netdev_add exists in the current form is that it predates qmp. cheers, Gerd