mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 19:32:19 +00:00
qemu: monitor: Make qemuMonitorSetBalloon operate on unsinged long long
This commit is contained in:
parent
efe8b44a84
commit
987b70777a
@ -2022,11 +2022,15 @@ qemuMonitorExpirePassword(qemuMonitorPtr mon,
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 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);
|
||||
|
||||
|
@ -401,7 +401,7 @@ int qemuMonitorExpirePassword(qemuMonitorPtr 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);
|
||||
|
||||
|
||||
|
@ -2175,16 +2175,14 @@ int qemuMonitorJSONExpirePassword(qemuMonitorPtr mon,
|
||||
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)
|
||||
|
@ -94,7 +94,7 @@ int qemuMonitorJSONExpirePassword(qemuMonitorPtr mon,
|
||||
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,
|
||||
|
@ -1110,12 +1110,10 @@ int qemuMonitorTextExpirePassword(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;
|
||||
@ -1125,7 +1123,7 @@ int qemuMonitorTextSetBalloon(qemuMonitorPtr mon,
|
||||
* '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) {
|
||||
|
@ -79,7 +79,7 @@ int qemuMonitorTextExpirePassword(qemuMonitorPtr mon,
|
||||
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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user