From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41693) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tm1XZ-0001pR-Uu for qemu-devel@nongnu.org; Fri, 21 Dec 2012 07:17:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tm1XW-0003hY-G5 for qemu-devel@nongnu.org; Fri, 21 Dec 2012 07:17:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55242) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tm1XW-0003hU-7P for qemu-devel@nongnu.org; Fri, 21 Dec 2012 07:17:22 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qBLCHLHN021577 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 21 Dec 2012 07:17:21 -0500 Message-ID: <50D4534F.9000107@redhat.com> Date: Fri, 21 Dec 2012 13:17:19 +0100 From: Gerd Hoffmann MIME-Version: 1.0 References: <1355932747-1755-1-git-send-email-kraxel@redhat.com> <50D2ED39.6010608@redhat.com> <20121220105643.GK25577@redhat.com> <50D2F23D.9000908@redhat.com> <50D2FA5D.30602@redhat.com> <50D30C7B.3030802@redhat.com> <50D44BD5.8040003@redhat.com> <50D44DD0.7030003@redhat.com> In-Reply-To: <50D44DD0.7030003@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH RfC 0/9] chardev hotplug List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Michal Privoznik , qemu-devel@nongnu.org On 12/21/12 12:53, Paolo Bonzini wrote: > Il 21/12/2012 12:45, Gerd Hoffmann ha scritto: >> On 12/20/12 14:02, Gerd Hoffmann wrote: >>> Hi, >>> >>>> /me wades through the socket code (unix+tcp) right now, which needs some >>>> refactoring to make it fly. >>> >>> Sneak preview attached. Goes on top of the series. >>> Compile tested only so far. >> >> Now that it comes to testing: how does the union look (in josn) at the wire? > > Tests are your friends! (Especially qapi-schema-test.json and > test-qmp-input-visitor.c). Something like this: > > { 'type': 'UserDefA', > 'data': { 'boolean': 'bool' } } > > { 'type': 'UserDefB', > 'data': { 'integer': 'int' } } > > { 'union': 'UserDefUnion', > 'data': { 'a' : 'UserDefA', 'b' : 'UserDefB' } } > > looks like this: > > { 'type': 'b', 'data' : { 'integer': 42 } } So ... { 'type': 'ChardevDummy', 'data': { } } { 'union': 'ChardevBackend', 'data': { 'file' : 'ChardevFile', 'port' : 'ChardevPort', 'socket' : 'ChardevSocket', 'pty' : 'ChardevDummy', 'null' : 'ChardevDummy' } } { 'command': 'chardev-add', 'data': {'id' : 'str', 'backend' : 'ChardevBackend' }, ... should accept ... {'id': 'test-null', 'backend': {'data': {}, 'type': 'null'}} ... as parameters for chardev-add, no? But I get back ... {u'error': {u'class': u'GenericError', u'desc': u"Invalid parameter 'backend'"}} ... and can't see what is wrong there ... cheers, Gerd