qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: Francesco Romani <fromani@redhat.com>,
	lcapitulino@redhat.com, qemu-devel@nongnu.org,
	stefanha@redhat.com, mdroth@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [RFC][PATCH v2] block: add write threshold reporting for block devices
Date: Thu, 20 Nov 2014 11:30:53 +0100	[thread overview]
Message-ID: <20141120103053.GA9266@noname.redhat.com> (raw)
In-Reply-To: <20141117164936.GL16192@stefanha-thinkpad.redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1785 bytes --]

Am 17.11.2014 um 17:49 hat Stefan Hajnoczi geschrieben:
> On Fri, Nov 07, 2014 at 02:12:13PM +0100, Francesco Romani wrote:
> > +void bdrv_set_usage_threshold(BlockDriverState *bs, int64_t threshold_bytes)
> > +{
> > +    BlockDriverState *target_bs = bs;
> > +    if (bs->file) {
> > +        target_bs = bs->file;
> > +    }
> 
> Hmm...I think now I understand why you are trying to use bs->file.  This
> is an attempt to make image formats work with the threshold.
> 
> Unfortunately the BlockDriverState topology can be more complicated than
> just 1 level.
> 
> If we hardcode a strategy to traverse bs->file then it will work in most
> cases:
> 
>   while (bs->file) {
>       bs = bs->file;
>   }
> 
> But there are cases like VMDK extent files where a BlockDriverState
> actually has multiple children.
> 
> One way to solve this is to require that the management tool tells QEMU
> which exact BlockDriverState node the threshold applies to.  Then QEMU
> doesn't need any hardcoded policy.  But I'm not sure how realistic that
> it at the moment (whether management tools are uses node names for each
> node yet), so it may be best to hardcode the bs->file traversal that
> I've suggested.
> 
> Kevin: Do you agree?

I have a feeling that we would regret this in the long run because it
would allow only one special case of a general problem (watching a BDS).
This means that we'll get inconsistent APIs.

We're "only" talking about an optimisation here, even though a very
useful one, so I wouldn't easily make compromises here. We should
probably insist on using the node-name. Management tools need new code
anyway to make use of the new functionality, so they can implement
node-name support as well while they're at it.

Kevin

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  parent reply	other threads:[~2014-11-20 10:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-07 13:12 [Qemu-devel] [RFC][PATCH v2] add write threshold reporting for block devices Francesco Romani
2014-11-07 13:12 ` [Qemu-devel] [RFC][PATCH v2] block: " Francesco Romani
2014-11-17 16:49   ` Stefan Hajnoczi
2014-11-18  8:12     ` Francesco Romani
2014-11-19 15:52       ` Stefan Hajnoczi
2014-11-20  8:23         ` Francesco Romani
2014-11-20 10:30     ` Kevin Wolf [this message]
2014-11-20 11:04       ` Stefan Hajnoczi
2014-11-20 11:34         ` Kevin Wolf
2014-11-21  8:43           ` Francesco Romani
2014-11-21 10:11             ` Kevin Wolf
2014-11-21 15:32               ` Francesco Romani
2014-11-21 16:24             ` Eric Blake
2014-11-21  0:10         ` Eric Blake

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=20141120103053.GA9266@noname.redhat.com \
    --to=kwolf@redhat.com \
    --cc=fromani@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    --cc=stefanha@redhat.com \
    /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).