Revision 28c28973 vl.c

b/vl.c
146 146
#include "audio/audio.h"
147 147
#include "migration.h"
148 148
#include "kvm.h"
149
#include "balloon.h"
150 149
#include "qemu-option.h"
151 150
#include "qemu-config.h"
152 151
#include "qemu-objects.h"
......
307 306
#endif    	
308 307
}
309 308
 
310
/***************/
311
/* ballooning */
312

  
313
static QEMUBalloonEvent *qemu_balloon_event;
314
void *qemu_balloon_event_opaque;
315

  
316
void qemu_add_balloon_handler(QEMUBalloonEvent *func, void *opaque)
317
{
318
    qemu_balloon_event = func;
319
    qemu_balloon_event_opaque = opaque;
320
}
321

  
322
int qemu_balloon(ram_addr_t target, MonitorCompletion cb, void *opaque)
323
{
324
    if (qemu_balloon_event) {
325
        qemu_balloon_event(qemu_balloon_event_opaque, target, cb, opaque);
326
        return 1;
327
    } else {
328
        return 0;
329
    }
330
}
331

  
332
int qemu_balloon_status(MonitorCompletion cb, void *opaque)
333
{
334
    if (qemu_balloon_event) {
335
        qemu_balloon_event(qemu_balloon_event_opaque, 0, cb, opaque);
336
        return 1;
337
    } else {
338
        return 0;
339
    }
340
}
341

  
342

  
343 309
/***********************************************************/
344 310
/* real time host monotonic timer */
345 311

  

Also available in: Unified diff