qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [Qemu-block] [PATCH RFC] qemu-io: Prefer stderr for err


From: Nir Soffer
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH RFC] qemu-io: Prefer stderr for error messages
Date: Thu, 13 Dec 2018 19:15:47 +0200

On Thu, Dec 13, 2018 at 12:47 PM Daniel P. Berrangé <address@hidden>
wrote:

> On Thu, Dec 13, 2018 at 01:52:29AM +0200, Nir Soffer wrote:
> > On Thu, Dec 13, 2018 at 12:13 AM Eric Blake <address@hidden> wrote:
> > >
> > > When a qemu-io command fails, it's best if the failure message
> > > goes to stderr rather than stdout.
> >
> > This makes sense, but it will break users like this:
> >
> >
> https://github.com/oVirt/vdsm/blob/a2836b1d58ffaa0f48cc9c814b6002161a81f044/tests/storage/qemuio.py#L45
> >
> > We need a way to detect qemu-io verification failures, maybe a special
> > exit code?
> >
> > 0 - verification succeeded
> > 1 - verification failed
> > 2 - other error (e.g no such file)
>
> This makes sense. We should *never* expect applications to parse the
> messages on stdout/err, because we reserve the right to change text
> arbitrarily at any time. So we need to use exit status IMHO.
>
> > Or, if qemu-io had a way to read data and write it to stdout, we could
> > compare the data and avoid the need for special exit code.
>
> That should be trivial to do, and quite desirable too IMHO - libvirt would
> in fact quite like such a feature, as it would let us support format
> conversions when using our upload/download APIs, without having to create
> intermediate files.  Alternatively 'qemu-img convert' could allow for
> /dev/stdin and /dev/stdout as raw files, but that looks considerably
> harder to implement.
>
> For your usecase that feels rather inefficient as you're introducing
> multiple data copies, which will be bad for large images. Much better
> if we just make qemu-io set good exit codes.
>

We use qemu-io for testing changes to tiny images, so multiple copies are
fine.

Nir


reply via email to

[Prev in Thread] Current Thread [Next in Thread]