mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
move balloon handling to balloon.c
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit is contained in:
parent
00a1555e0c
commit
28c2897373
5 changed files with 154 additions and 120 deletions
34
vl.c
34
vl.c
|
@ -146,7 +146,6 @@ int main(int argc, char **argv)
|
|||
#include "audio/audio.h"
|
||||
#include "migration.h"
|
||||
#include "kvm.h"
|
||||
#include "balloon.h"
|
||||
#include "qemu-option.h"
|
||||
#include "qemu-config.h"
|
||||
#include "qemu-objects.h"
|
||||
|
@ -307,39 +306,6 @@ static void set_proc_name(const char *s)
|
|||
#endif
|
||||
}
|
||||
|
||||
/***************/
|
||||
/* ballooning */
|
||||
|
||||
static QEMUBalloonEvent *qemu_balloon_event;
|
||||
void *qemu_balloon_event_opaque;
|
||||
|
||||
void qemu_add_balloon_handler(QEMUBalloonEvent *func, void *opaque)
|
||||
{
|
||||
qemu_balloon_event = func;
|
||||
qemu_balloon_event_opaque = opaque;
|
||||
}
|
||||
|
||||
int qemu_balloon(ram_addr_t target, MonitorCompletion cb, void *opaque)
|
||||
{
|
||||
if (qemu_balloon_event) {
|
||||
qemu_balloon_event(qemu_balloon_event_opaque, target, cb, opaque);
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int qemu_balloon_status(MonitorCompletion cb, void *opaque)
|
||||
{
|
||||
if (qemu_balloon_event) {
|
||||
qemu_balloon_event(qemu_balloon_event_opaque, 0, cb, opaque);
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************/
|
||||
/* real time host monotonic timer */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue