[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC 3/7] block: bdrv_img_create(): move param printing
From: |
Luiz Capitulino |
Subject: |
Re: [Qemu-devel] [RFC 3/7] block: bdrv_img_create(): move param printing to qemu-img |
Date: |
Mon, 15 Oct 2012 18:39:43 -0300 |
On Fri, 12 Oct 2012 10:29:37 +0200
Paolo Bonzini <address@hidden> 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...
- [Qemu-devel] [RFC 0/7] block: bdrv_img_create(): propagate errors, Luiz Capitulino, 2012/10/11
- [Qemu-devel] [RFC 1/7] error: add error_set_errno and error_setg_errno, Luiz Capitulino, 2012/10/11
- [Qemu-devel] [RFC 2/7] block: bdrv_img_create(): add param_ret argument, Luiz Capitulino, 2012/10/11
- [Qemu-devel] [RFC 3/7] block: bdrv_img_create(): move param printing to qemu-img, Luiz Capitulino, 2012/10/11
- [Qemu-devel] [RFC 5/7] qemu-img: img_create(): use Error object, Luiz Capitulino, 2012/10/11
- [Qemu-devel] [RFC 4/7] block: bdrv_img_create(): add Error ** argument, Luiz Capitulino, 2012/10/11
- [Qemu-devel] [RFC 6/7] qmp: qmp_transaction(): pass Error object to bdrv_img_create(), Luiz Capitulino, 2012/10/11
- [Qemu-devel] [RFC 7/7] block: bdrv_img_create(): drop unused code, Luiz Capitulino, 2012/10/11
- Re: [Qemu-devel] [RFC 0/7] block: bdrv_img_create(): propagate errors, Paolo Bonzini, 2012/10/12