[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH V5 25/28] qapi event: convert BALLOON_CHANGE
From: |
Wenchao Xia |
Subject: |
[Qemu-devel] [PATCH V5 25/28] qapi event: convert BALLOON_CHANGE |
Date: |
Wed, 30 Apr 2014 21:26:59 -0700 |
Signed-off-by: Wenchao Xia <address@hidden>
---
balloon.c | 13 -------------
hw/virtio/virtio-balloon.c | 6 ++++--
include/sysemu/balloon.h | 2 --
3 files changed, 4 insertions(+), 17 deletions(-)
diff --git a/balloon.c b/balloon.c
index e321f2c..b70da4f 100644
--- a/balloon.c
+++ b/balloon.c
@@ -81,19 +81,6 @@ static int qemu_balloon_status(BalloonInfo *info)
return 1;
}
-void qemu_balloon_changed(int64_t actual)
-{
- QObject *data;
-
- data = qobject_from_jsonf("{ 'actual': %" PRId64 " }",
- actual);
-
- monitor_protocol_event(QEVENT_BALLOON_CHANGE, data);
-
- qobject_decref(data);
-}
-
-
BalloonInfo *qmp_query_balloon(Error **errp)
{
BalloonInfo *info;
diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index a470a0b..6af21a7 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -24,6 +24,7 @@
#include "sysemu/kvm.h"
#include "exec/address-spaces.h"
#include "qapi/visitor.h"
+#include "qapi-event.h"
#if defined(__linux__)
#include <sys/mman.h>
@@ -275,8 +276,9 @@ static void virtio_balloon_set_config(VirtIODevice *vdev,
memcpy(&config, config_data, sizeof(struct virtio_balloon_config));
dev->actual = le32_to_cpu(config.actual);
if (dev->actual != oldactual) {
- qemu_balloon_changed(ram_size -
- ((ram_addr_t) dev->actual << VIRTIO_BALLOON_PFN_SHIFT));
+ qapi_event_send_balloon_change(ram_size -
+ ((ram_addr_t) dev->actual << VIRTIO_BALLOON_PFN_SHIFT),
+ NULL);
}
}
diff --git a/include/sysemu/balloon.h b/include/sysemu/balloon.h
index bd9d395..0345e01 100644
--- a/include/sysemu/balloon.h
+++ b/include/sysemu/balloon.h
@@ -24,6 +24,4 @@ int qemu_add_balloon_handler(QEMUBalloonEvent *event_func,
QEMUBalloonStatus *stat_func, void *opaque);
void qemu_remove_balloon_handler(void *opaque);
-void qemu_balloon_changed(int64_t actual);
-
#endif
--
1.7.1
- [Qemu-devel] [PATCH V5 15/28] qapi event: convert RTC_CHANGE, (continued)
- [Qemu-devel] [PATCH V5 15/28] qapi event: convert RTC_CHANGE, Wenchao Xia, 2014/05/01
- [Qemu-devel] [PATCH V5 16/28] qapi event: convert WATCHDOG, Wenchao Xia, 2014/05/01
- [Qemu-devel] [PATCH V5 17/28] qapi event: convert DEVICE_DELETED, Wenchao Xia, 2014/05/01
- [Qemu-devel] [PATCH V5 18/28] qapi event: convert DEVICE_TRAY_MOVED, Wenchao Xia, 2014/05/01
- [Qemu-devel] [PATCH V5 19/28] qapi event: convert BLOCK_IO_ERROR and BLOCK_JOB_ERROR, Wenchao Xia, 2014/05/01
- [Qemu-devel] [PATCH V5 20/28] qapi event: convert BLOCK_IMAGE_CORRUPTED, Wenchao Xia, 2014/05/01
- [Qemu-devel] [PATCH V5 21/28] qapi event: convert other BLOCK_JOB events, Wenchao Xia, 2014/05/01
- [Qemu-devel] [PATCH V5 22/28] qapi event: convert NIC_RX_FILTER_CHANGED, Wenchao Xia, 2014/05/01
- [Qemu-devel] [PATCH V5 23/28] qapi event: convert VNC events, Wenchao Xia, 2014/05/01
- [Qemu-devel] [PATCH V5 24/28] qapi event: convert SPICE events, Wenchao Xia, 2014/05/01
- [Qemu-devel] [PATCH V5 25/28] qapi event: convert BALLOON_CHANGE,
Wenchao Xia <=
- [Qemu-devel] [PATCH V5 26/28] qapi event: convert GUEST_PANICKED, Wenchao Xia, 2014/05/01
- [Qemu-devel] [PATCH V5 27/28] qapi event: convert QUORUM events, Wenchao Xia, 2014/05/01
- [Qemu-devel] [PATCH V5 28/28] qapi event: clean up, Wenchao Xia, 2014/05/01