qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com
Subject: Re: [Qemu-devel] [RFC 0/3] QMP: extend BLOCK_IO_ERROR event
Date: Thu, 14 Aug 2014 09:05:23 -0400	[thread overview]
Message-ID: <20140814090523.6de078e6@redhat.com> (raw)
In-Reply-To: <20140805091339.GD4391@noname.str.redhat.com>

On Tue, 5 Aug 2014 11:13:39 +0200
Kevin Wolf <kwolf@redhat.com> wrote:

> Am 23.07.2014 um 15:17 hat Luiz Capitulino geschrieben:
> > 
> > Management software, such as OpenStack and RHEV's vdsm, wants to be able
> > to allocate VM disk space on demand. The basic use case is to start a VM
> > with a small disk and then the disk is enlarged when QEMU hits a ENOSPC
> > condition.
> > 
> > To this end, the management software has to be notified when QEMU
> > encounters ENOSPC. The most straightforward solution is to extend QMP's
> > BLOCK_IO_ERROR event with that information.
> > 
> > This series does exactly that. The approach taken is the simplest possible:
> > the BLOCK_IO_ERROR event is extended to contain a "nospace" key, which
> > will be true whenever the guest runs out of space *and* werror=stop|enospc.
> > Here's an example:
> > 
> > { "event": "BLOCK_IO_ERROR",
> >     "data": { "device": "ide0-hd1",
> > 	          "operation": "write",
> > 			  "action": "stop",
> > 			  "nospace": true },
> >     "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
> > 
> > There are three important things to observe:
> > 
> >  1. query-block already supports querying the event by means of the
> >     "io-status" key. Actually, "nospace" and "io-status" keys share
> >     the same semantics. This is a big advantage of this approach, no
> >     further extension of query-block is needed
> > 
> >  2. The event could also contain an error message key for debugging,
> >     But if we add it to the event, should we add it to query-block too?
> 
> I don't think it's strictly necessary, but I can imagine that it would
> be a very nice feature for debugging if you could check after that fact
> what caused the VM stop even if you don't have a QMP log with the event.
> 
> >  3. I'm not extending BLOCK_JOB_ERROR. The reason is that it seems
> >     that BLOCK_IO_ERROR is also emitted on BLOCK_JOB_ERROR
> 
> Hm, I can't see this in the code. Where do I need to look?
> 
> Or did you get both a BLOCK_JOB_ERROR and a BLOCK_IO_ERROR because the
> guest tried to access the image, too, and caused a separate error?

Yes. I saw this behavior while testing my code where BLOCK_IO_ERROR always
followed BLOCK_JOB_ERROR. I assumed this was not a coincidence. If I'm
wrong I can just extend BLOCK_JOB_ERROR too.

> 
> > Now, this series is an RFC because there's an alternative solution for
> > this problem: instead of extending the BLOCK_IO_ERROR event with no-space
> > indicator, we could have a stringfied errno. This way management apps
> > would also be able to distinguish among other errors.
> 
> I don't think sending errnos is a good approach (but if we took it,
> we should use an enum rather than strings) and prefer exposing the
> exact information that is actually needed.
> 
> > For example, we could have a "error-details" dict containing a
> > "reason" and a "message" key:
> > 
> > { "event": "BLOCK_IO_ERROR",
> >     "data": { "device": "ide0-hd1",
> >               "operation": "write",
> >               "action": "stop",
> > 			  "error-details": { "reason": "eio", "message": "I/O error" },
> >     "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
> > 
> > And then query-block would have to be extended to contain the same
> > information.
> > 
> > IMO, this series implementation is good enough for the requirement we
> > currently have but I'm open to go complex if needed.
> 
> Agreed. I would like to see the human-readable strerror() string added,
> but that doesn't make this series any worse as a first step:
> 
> Acked-by: Kevin Wolf <kwolf@redhat.com>
> 

      reply	other threads:[~2014-08-14 13:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-23 13:17 [Qemu-devel] [RFC 0/3] QMP: extend BLOCK_IO_ERROR event Luiz Capitulino
2014-07-23 13:17 ` [Qemu-devel] [RFC 1/3] qapi: block-core.json: improve query-block doc Luiz Capitulino
2014-08-05 12:13   ` Eric Blake
2014-07-23 13:17 ` [Qemu-devel] [RFC 2/3] QMP: rate limit BLOCK_IO_ERROR Luiz Capitulino
2014-08-05 12:14   ` Eric Blake
2014-08-11  8:17   ` Daniel P. Berrange
2014-08-11 11:07     ` Markus Armbruster
2014-08-11 11:15       ` Daniel P. Berrange
2014-08-17  6:08         ` Paolo Bonzini
2014-08-14 13:13     ` Luiz Capitulino
2014-07-23 13:17 ` [Qemu-devel] [RFC 3/3] QMP: extend BLOCK_IO_ERROR event with no-space indicator Luiz Capitulino
2014-08-05 12:19   ` Eric Blake
2014-08-14 13:07     ` Luiz Capitulino
2014-08-05  9:13 ` [Qemu-devel] [RFC 0/3] QMP: extend BLOCK_IO_ERROR event Kevin Wolf
2014-08-14 13:05   ` Luiz Capitulino [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140814090523.6de078e6@redhat.com \
    --to=lcapitulino@redhat.com \
    --cc=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).