All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: Dietmar Maurer <dietmar@proxmox.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"aliguori@us.ibm.com" <aliguori@us.ibm.com>,
	mdroth <mdroth@linux.vnet.ibm.com>,
	"agl@us.ibm.com" <agl@us.ibm.com>
Subject: Re: [Qemu-devel] [PATCH 0/3] re-enable balloon stats
Date: Wed, 12 Dec 2012 11:29:30 -0200	[thread overview]
Message-ID: <20121212112930.7fa8effd@doriath.home> (raw)
In-Reply-To: <24E144B8C0207547AD09C467A8259F75578AC74C@lisa.maurer-it.com>

On Wed, 12 Dec 2012 13:17:15 +0000
Dietmar Maurer <dietmar@proxmox.com> wrote:

> > > > > Why don't we raise the error when we query the values?
> 
> You already raise an error here, so that works out of the box:
> 
>     if (s->stats[i] == -1) {
>         error_setg(errp,
>             "timer hasn't been enabled or guest doesn't support '%s'", name);
> 
> > > >
> > > > Hmm, that's a good idea.
> > > >
> > > > Only small nit is that, today old stats will remain available to be
> > > > queried even if you disable the timer. If we do what you suggest,
> > > > old stats won't be available if the module is unloaded (well, I
> > > > *guess* the guest will unset the feature bit on module removal).
> > >
> > > What is the problem with that? It would be no problem to simulate the
> > > old behavior, but why do you want that?
> > 
> > I actually just thought that it's a nice to have.
> 
> The following patch seems to work for me:

Yeah, that's what I'll do and the doc has to be updated too.

> 
> Index: new/hw/virtio-balloon.c
> ===================================================================
> --- new.orig/hw/virtio-balloon.c	2012-12-12 14:05:56.000000000 +0100
> +++ new/hw/virtio-balloon.c	2012-12-12 14:07:43.000000000 +0100
> @@ -111,6 +111,10 @@
>  {
>      VirtIOBalloon *s = opaque;
>  
> +    if (!balloon_stats_supported(s) || !runstate_is_running()) {
> +        return;
> +    }
> +
>      virtqueue_push(s->svq, &s->stats_vq_elem, s->stats_vq_offset);
>      virtio_notify(&s->vdev, s->svq);
>  }
> @@ -164,11 +168,6 @@
>      VirtIOBalloon *s = opaque;
>      int64_t value;
>  
> -    if (!balloon_stats_supported(s)) {
> -        error_setg(errp, "guest doesn\'t support balloon stats");
> -        return;
> -    }
> -
>      visit_type_int(v, &value, name, errp);
>      if (error_is_set(errp)) {
>          return;
> 
> 
> 

  reply	other threads:[~2012-12-12 13:31 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-10 19:36 [Qemu-devel] [PATCH 0/3] re-enable balloon stats Luiz Capitulino
2012-12-10 19:36 ` [Qemu-devel] [PATCH 1/3] virtio-balloon: drop old stats code Luiz Capitulino
2012-12-10 19:36 ` [Qemu-devel] [PATCH 2/3] virtio-balloon: re-enable balloon stats Luiz Capitulino
2012-12-10 19:36 ` [Qemu-devel] [PATCH 3/3] docs: document virtio-balloon stats Luiz Capitulino
2012-12-11  5:12 ` [Qemu-devel] [PATCH 0/3] re-enable balloon stats Dietmar Maurer
2012-12-11 11:45   ` Luiz Capitulino
2012-12-11 12:05     ` Dietmar Maurer
2012-12-11 12:10       ` Luiz Capitulino
2012-12-11 12:29     ` Dietmar Maurer
2012-12-11 12:59       ` Luiz Capitulino
2012-12-11 15:14         ` Dietmar Maurer
2012-12-11 17:38           ` mdroth
2012-12-11 18:28             ` Luiz Capitulino
2012-12-11 18:30               ` Luiz Capitulino
2012-12-11 19:07               ` Dietmar Maurer
2012-12-11 19:23                 ` Luiz Capitulino
2012-12-11 19:39                   ` Dietmar Maurer
2012-12-11 19:41                     ` Luiz Capitulino
2012-12-12 13:17                       ` Dietmar Maurer
2012-12-12 13:29                         ` Luiz Capitulino [this message]
2012-12-12 13:36                           ` Dietmar Maurer
2012-12-12 13:40                             ` Luiz Capitulino
2012-12-12 13:45                               ` Dietmar Maurer
2012-12-13 12:41                                 ` Luiz Capitulino
2012-12-11 22:26               ` mdroth
2012-12-12  5:56                 ` Dietmar Maurer

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=20121212112930.7fa8effd@doriath.home \
    --to=lcapitulino@redhat.com \
    --cc=agl@us.ibm.com \
    --cc=aliguori@us.ibm.com \
    --cc=dietmar@proxmox.com \
    --cc=mdroth@linux.vnet.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.