}
+/*
+ * Returns: 0 if balloon not supported, +1 if balloon adjust worked
+ * or -1 on failure
+ */
int
qemuMonitorSetBalloon(qemuMonitorPtr mon,
- unsigned long newmem)
+ unsigned long long newmem)
{
- VIR_DEBUG("newmem=%lu", newmem);
+ VIR_DEBUG("newmem=%llu", newmem);
QEMU_CHECK_MONITOR(mon);
int type,
const char *expire_time);
int qemuMonitorSetBalloon(qemuMonitorPtr mon,
- unsigned long newmem);
+ unsigned long long newmem);
int qemuMonitorSetCPU(qemuMonitorPtr mon, int cpu, bool online);
return ret;
}
-/*
- * Returns: 0 if balloon not supported, +1 if balloon adjust worked
- * or -1 on failure
- */
-int qemuMonitorJSONSetBalloon(qemuMonitorPtr mon,
- unsigned long newmem)
+
+int
+qemuMonitorJSONSetBalloon(qemuMonitorPtr mon,
+ unsigned long long newmem)
{
int ret;
virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("balloon",
- "U:value", ((unsigned long long)newmem)*1024,
+ "U:value", newmem * 1024,
NULL);
virJSONValuePtr reply = NULL;
if (!cmd)
const char *protocol,
const char *expire_time);
int qemuMonitorJSONSetBalloon(qemuMonitorPtr mon,
- unsigned long newmem);
+ unsigned long long newmem);
int qemuMonitorJSONSetCPU(qemuMonitorPtr mon, int cpu, bool online);
int qemuMonitorJSONEjectMedia(qemuMonitorPtr mon,
return ret;
}
-/*
- * Returns: 0 if balloon not supported, +1 if balloon adjust worked
- * or -1 on failure
- */
-int qemuMonitorTextSetBalloon(qemuMonitorPtr mon,
- unsigned long newmem)
+
+int
+qemuMonitorTextSetBalloon(qemuMonitorPtr mon,
+ unsigned long long newmem)
{
char *cmd;
char *reply = NULL;
* 'newmem' is in KB, QEMU monitor works in MB, and we all wish
* we just worked in bytes with unsigned long long everywhere.
*/
- if (virAsprintf(&cmd, "balloon %lu", VIR_DIV_UP(newmem, 1024)) < 0)
+ if (virAsprintf(&cmd, "balloon %llu", VIR_DIV_UP(newmem, 1024)) < 0)
return -1;
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
const char *protocol,
const char *expire_time);
int qemuMonitorTextSetBalloon(qemuMonitorPtr mon,
- unsigned long newmem);
+ unsigned long long newmem);
int qemuMonitorTextSetCPU(qemuMonitorPtr mon, int cpu, bool online);
int qemuMonitorTextEjectMedia(qemuMonitorPtr mon,