From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=36499 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OvXxZ-0000OM-V8 for qemu-devel@nongnu.org; Tue, 14 Sep 2010 12:02:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OvXxT-00075F-SU for qemu-devel@nongnu.org; Tue, 14 Sep 2010 12:02:17 -0400 Received: from e9.ny.us.ibm.com ([32.97.182.139]:60228) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OvXxT-000752-NB for qemu-devel@nongnu.org; Tue, 14 Sep 2010 12:02:11 -0400 Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235]) by e9.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id o8EFhI5d007053 for ; Tue, 14 Sep 2010 11:43:18 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o8EG28VB340174 for ; Tue, 14 Sep 2010 12:02:08 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o8EG254U030513 for ; Tue, 14 Sep 2010 13:02:07 -0300 Subject: Re: [Qemu-devel] [PATCH] Disable virtio-balloon memory stats interface From: Adam Litke In-Reply-To: <20100914140932.GA12878@blackpad.lan.raisama.net> References: <1283955676-25119-1-git-send-email-agl@us.ibm.com> <20100914140932.GA12878@blackpad.lan.raisama.net> Content-Type: text/plain; charset="UTF-8" Date: Tue, 14 Sep 2010 11:01:42 -0500 Message-ID: <1284480102.2232.19.camel@aglitke> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: Markus Armbruster , qemu list , Amit Shah , Paolo Bonzini , Luiz Capitulino Ok, I can see how this will work better for the migration case. Acked-by: Adam Litke On Tue, 2010-09-14 at 11:09 -0300, Eduardo Habkost wrote: > This field is guest-visible, won't this cause problems on migration? > > Isn't it better to disable it on the "info balloon" side, so the guest > knows that the host may start requesting stat info eventually? I suggest > doing this: > > --- > diff --git a/hw/virtio-balloon.c b/hw/virtio-balloon.c > index 1e4dfdd..92e9057 100644 > --- a/hw/virtio-balloon.c > +++ b/hw/virtio-balloon.c > @@ -30,6 +30,10 @@ > #include > #endif > > +/* Disable guest-provided stats by now (bz#623903, bz#626544) */ > +#define ENABLE_GUEST_STATS 0 > + > + > typedef struct VirtIOBalloon > { > VirtIODevice vdev; > @@ -84,12 +88,14 @@ static QObject *get_stats_qobject(VirtIOBalloon *dev) > VIRTIO_BALLOON_PFN_SHIFT); > > stat_put(dict, "actual", actual); > +#if ENABLE_GUEST_STATS > stat_put(dict, "mem_swapped_in", dev->stats[VIRTIO_BALLOON_S_SWAP_IN]); > stat_put(dict, "mem_swapped_out", dev->stats[VIRTIO_BALLOON_S_SWAP_OUT]); > stat_put(dict, "major_page_faults", dev->stats[VIRTIO_BALLOON_S_MAJFLT]); > stat_put(dict, "minor_page_faults", dev->stats[VIRTIO_BALLOON_S_MINFLT]); > stat_put(dict, "free_mem", dev->stats[VIRTIO_BALLOON_S_MEMFREE]); > stat_put(dict, "total_mem", dev->stats[VIRTIO_BALLOON_S_MEMTOT]); > +#endif > > return QOBJECT(dict); > } > @@ -215,7 +221,7 @@ static void virtio_balloon_to_target(void *opaque, ram_addr_t target, > } > dev->stats_callback = cb; > dev->stats_opaque_callback_data = cb_data; > - if (dev->vdev.guest_features & (1 << VIRTIO_BALLOON_F_STATS_VQ)) { > + if (ENABLE_GUEST_STATS && (dev->vdev.guest_features & (1 << VIRTIO_BALLOON_F_STATS_VQ))) { > virtqueue_push(dev->svq, &dev->stats_vq_elem, dev->stats_vq_offset); > virtio_notify(&dev->vdev, dev->svq); > } else { > -- Thanks, Adam