From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [Qemu-devel] KVM call minutes for Feb 15 Date: Wed, 16 Feb 2011 12:24:41 +0200 Message-ID: <4D5BA5E9.90307@redhat.com> References: <20110215162629.GN21720@x200.localdomain> <4D5B0889.4030303@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Chris Wright , kvm@vger.kernel.org, qemu-devel@nongnu.org To: Anthony Liguori Return-path: Received: from mx1.redhat.com ([209.132.183.28]:6341 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754727Ab1BPKYt (ORCPT ); Wed, 16 Feb 2011 05:24:49 -0500 In-Reply-To: <4D5B0889.4030303@codemonkey.ws> Sender: kvm-owner@vger.kernel.org List-ID: On 02/16/2011 01:13 AM, Anthony Liguori wrote: > On 02/15/2011 10:26 AM, Chris Wright wrote: >> QAPI and QMP >> - Anthony adding a new wiki page to describe all of this > > http://wiki.qemu.org/Features/QAPI > [ 'change', {'device': 'str', 'target': 'str'}, {'arg': 'str'}, 'none' ] -> void qmp_change(const char *device, const char *target, bool has_arg, const char *arg, Error **errp); AFAICT a json-string allows embedded NULs ('\0000'). There translate to UTF-8 as '\0', terminating your char *s. Either we use some length/pointer structure, or the parser has to look for them and kill them, and we have to specify them as verboten. BlockDeviceInfo *qmp_query_block_device_info(const char *device, Error **errp) { BlockDeviceInfo *info; BlockDriverState *bs; Error *local_err = NULL; bs = bdrv_find(device,&local_err); if (local_err) { error_propagate(errp, local_err); return NULL; } info->file = qemu_strdup(bs->filename); info->ro = bs->readonly; info->drv = qemu_strdup(bs->drv); info->encrypted = bs->encrypted; if (bs->backing_file[0]) { info->has_backing_file = true; info->backing_file = qemu_strdup(info->backing_file); } return info; } So, info and all its pointer-typed members are required to be qemu_free() compatible, with just a single pointer pointing to an object, and generated code will qemu_free() everything? Recommend translating '-' in identifiers to '_' so we can use '-' in the schema as a word separator. -- error compiling committee.c: too many arguments to function