From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53613) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TNsN8-0007rq-VC for qemu-devel@nongnu.org; Mon, 15 Oct 2012 17:38:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TNsN8-0004hz-0r for qemu-devel@nongnu.org; Mon, 15 Oct 2012 17:38:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45902) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TNsN7-0004ht-OK for qemu-devel@nongnu.org; Mon, 15 Oct 2012 17:38:49 -0400 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 q9FLcmRZ016785 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 15 Oct 2012 17:38:48 -0400 Date: Mon, 15 Oct 2012 18:39:43 -0300 From: Luiz Capitulino Message-ID: <20121015183943.72407c75@doriath.home> In-Reply-To: <5077D4F1.2030704@redhat.com> References: <1349990825-2659-1-git-send-email-lcapitulino@redhat.com> <1349990825-2659-4-git-send-email-lcapitulino@redhat.com> <5077D4F1.2030704@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC 3/7] block: bdrv_img_create(): move param printing to qemu-img List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com On Fri, 12 Oct 2012 10:29:37 +0200 Paolo Bonzini wrote: > Il 11/10/2012 23:27, Luiz Capitulino ha scritto: > > bdrv_img_create() is being used by the transaction QMP command and > > therefore shouldn't print directly to the user. > > > > Move the param printing to qemu-img instead. Has the side effect of > > only printing it when the bdrv_img_create() call succeeds, otherwise > > we can print errors before the action being taken, eg: > > > > ~/work/virt/ ./qemu-img create -f qcow2 /foo/foo 10G > > qemu-img: /foo/foo: error while creating qcow2: No such file or directory > > Formatting '/foo/foo', fmt=qcow2 size=10737418240 encryption=off cluster_size=65536 lazy_refcounts=off > > It is a small regression with -monitor stdio (and also with QMP it > doesn't appear anymore in the logs). Do we care? I don't think so. But if we do, than the current code is also wrong as it should work with any -monitor device and not only stdio. IMO, what's there today was really meant to be displayed when running qemu-img. > What alternatives > exist besides writing a QAPI key-value store and converting the output > QEMUOptionParameters to it (which I'm not suggesting to do)? Yes, the right way to have this would be to add it as a return value of the qmp command calling bdrv_img_create() (certainly not doable now for the transaction command due to compatibility issues). And/or add a query-block-image command and/or extend query-block to display the image options...