From: Luiz Capitulino <lcapitulino@redhat.com>
To: qemu-devel@nongnu.org
Cc: aliguori@us.ibm.com, armbru@redhat.com,
mdroth@linux.vnet.ibm.com, agl@us.ibm.com, amit.shah@redhat.com,
eblake@redhat.com
Subject: [Qemu-devel] [PATCH 4/5] balloon: Rename QEMUBalloonStatus to QEMUBalloonInfo
Date: Thu, 19 Jan 2012 13:56:30 -0200 [thread overview]
Message-ID: <1326988591-27241-5-git-send-email-lcapitulino@redhat.com> (raw)
In-Reply-To: <1326988591-27241-1-git-send-email-lcapitulino@redhat.com>
Next commit will introduce the QEMUBalloonStats type, which can
cause confusion with QEMUBalloonStatus. Also, QEMUBalloonInfo
matches better with the BalloonInfo type, where the current
balloon information is returned.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
balloon.c | 18 +++++++++---------
balloon.h | 4 ++--
hw/virtio-balloon.c | 4 ++--
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/balloon.c b/balloon.c
index aa354f7..b32b487 100644
--- a/balloon.c
+++ b/balloon.c
@@ -32,13 +32,13 @@
#include "qmp-commands.h"
static QEMUBalloonEvent *balloon_event_fn;
-static QEMUBalloonStatus *balloon_stat_fn;
+static QEMUBalloonInfo *balloon_info_fn;
static void *balloon_opaque;
int qemu_add_balloon_handler(QEMUBalloonEvent *event_func,
- QEMUBalloonStatus *stat_func, void *opaque)
+ QEMUBalloonInfo *info_func, void *opaque)
{
- if (balloon_event_fn || balloon_stat_fn || balloon_opaque) {
+ if (balloon_event_fn || balloon_info_fn || balloon_opaque) {
/* We're already registered one balloon handler. How many can
* a guest really have?
*/
@@ -46,7 +46,7 @@ int qemu_add_balloon_handler(QEMUBalloonEvent *event_func,
return -1;
}
balloon_event_fn = event_func;
- balloon_stat_fn = stat_func;
+ balloon_info_fn = info_func;
balloon_opaque = opaque;
return 0;
}
@@ -57,7 +57,7 @@ void qemu_remove_balloon_handler(void *opaque)
return;
}
balloon_event_fn = NULL;
- balloon_stat_fn = NULL;
+ balloon_info_fn = NULL;
balloon_opaque = NULL;
}
@@ -71,12 +71,12 @@ static int qemu_balloon(ram_addr_t target)
return 1;
}
-static int qemu_balloon_status(BalloonInfo *info)
+static int qemu_balloon_info(BalloonInfo *info)
{
- if (!balloon_stat_fn) {
+ if (!balloon_info_fn) {
return 0;
}
- balloon_stat_fn(balloon_opaque, info);
+ balloon_info_fn(balloon_opaque, info);
return 1;
}
@@ -91,7 +91,7 @@ BalloonInfo *qmp_query_balloon(Error **errp)
info = g_malloc0(sizeof(*info));
- if (qemu_balloon_status(info) == 0) {
+ if (qemu_balloon_info(info) == 0) {
error_set(errp, QERR_DEVICE_NOT_ACTIVE, "balloon");
qapi_free_BalloonInfo(info);
return NULL;
diff --git a/balloon.h b/balloon.h
index 17fe300..a539354 100644
--- a/balloon.h
+++ b/balloon.h
@@ -17,10 +17,10 @@
#include "qapi-types.h"
typedef void (QEMUBalloonEvent)(void *opaque, ram_addr_t target);
-typedef void (QEMUBalloonStatus)(void *opaque, BalloonInfo *info);
+typedef void (QEMUBalloonInfo)(void *opaque, BalloonInfo *info);
int qemu_add_balloon_handler(QEMUBalloonEvent *event_func,
- QEMUBalloonStatus *stat_func, void *opaque);
+ QEMUBalloonInfo *info_func, void *opaque);
void qemu_remove_balloon_handler(void *opaque);
#endif
diff --git a/hw/virtio-balloon.c b/hw/virtio-balloon.c
index ce9d2c9..4307f4c 100644
--- a/hw/virtio-balloon.c
+++ b/hw/virtio-balloon.c
@@ -156,7 +156,7 @@ static uint32_t virtio_balloon_get_features(VirtIODevice *vdev, uint32_t f)
return f;
}
-static void virtio_balloon_stat(void *opaque, BalloonInfo *info)
+static void virtio_balloon_info(void *opaque, BalloonInfo *info)
{
VirtIOBalloon *dev = opaque;
@@ -236,7 +236,7 @@ VirtIODevice *virtio_balloon_init(DeviceState *dev)
s->vdev.get_features = virtio_balloon_get_features;
ret = qemu_add_balloon_handler(virtio_balloon_to_target,
- virtio_balloon_stat, s);
+ virtio_balloon_info, s);
if (ret < 0) {
virtio_cleanup(&s->vdev);
return NULL;
--
1.7.9.rc0.dirty
next prev parent reply other threads:[~2012-01-19 16:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-19 15:56 [Qemu-devel] [RFC 0/5]: QMP: add balloon-get-memory-stats command Luiz Capitulino
2012-01-19 15:56 ` [Qemu-devel] [PATCH 1/5] balloon: qmp_balloon(): Use error_set() Luiz Capitulino
2012-01-19 15:56 ` [Qemu-devel] [PATCH 2/5] balloon: Drop unused include Luiz Capitulino
2012-01-19 15:56 ` [Qemu-devel] [PATCH 3/5] balloon: Drop old stats interface Luiz Capitulino
2012-01-19 15:56 ` Luiz Capitulino [this message]
2012-01-19 15:56 ` [Qemu-devel] [PATCH 5/5] qmp: add balloon-get-memory-stats & event Luiz Capitulino
2012-01-19 16:43 ` [Qemu-devel] [RFC 0/5]: QMP: add balloon-get-memory-stats command Michael Roth
2012-01-19 16:58 ` Luiz Capitulino
2012-01-19 17:15 ` Eric Blake
2012-01-20 12:02 ` Luiz Capitulino
2012-01-19 21:50 ` Adam Litke
2012-01-20 12:06 ` Luiz Capitulino
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=1326988591-27241-5-git-send-email-lcapitulino@redhat.com \
--to=lcapitulino@redhat.com \
--cc=agl@us.ibm.com \
--cc=aliguori@us.ibm.com \
--cc=amit.shah@redhat.com \
--cc=armbru@redhat.com \
--cc=eblake@redhat.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 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).