mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06: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
|
int
|
||||||
qemuMonitorSetBalloon(qemuMonitorPtr mon,
|
qemuMonitorSetBalloon(qemuMonitorPtr mon,
|
||||||
unsigned long newmem)
|
unsigned long long newmem)
|
||||||
{
|
{
|
||||||
VIR_DEBUG("newmem=%lu", newmem);
|
VIR_DEBUG("newmem=%llu", newmem);
|
||||||
|
|
||||||
QEMU_CHECK_MONITOR(mon);
|
QEMU_CHECK_MONITOR(mon);
|
||||||
|
|
||||||
|
@ -401,7 +401,7 @@ int qemuMonitorExpirePassword(qemuMonitorPtr mon,
|
|||||||
int type,
|
int type,
|
||||||
const char *expire_time);
|
const char *expire_time);
|
||||||
int qemuMonitorSetBalloon(qemuMonitorPtr mon,
|
int qemuMonitorSetBalloon(qemuMonitorPtr mon,
|
||||||
unsigned long newmem);
|
unsigned long long newmem);
|
||||||
int qemuMonitorSetCPU(qemuMonitorPtr mon, int cpu, bool online);
|
int qemuMonitorSetCPU(qemuMonitorPtr mon, int cpu, bool online);
|
||||||
|
|
||||||
|
|
||||||
|
@ -2175,16 +2175,14 @@ int qemuMonitorJSONExpirePassword(qemuMonitorPtr mon,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Returns: 0 if balloon not supported, +1 if balloon adjust worked
|
int
|
||||||
* or -1 on failure
|
qemuMonitorJSONSetBalloon(qemuMonitorPtr mon,
|
||||||
*/
|
unsigned long long newmem)
|
||||||
int qemuMonitorJSONSetBalloon(qemuMonitorPtr mon,
|
|
||||||
unsigned long newmem)
|
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("balloon",
|
virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("balloon",
|
||||||
"U:value", ((unsigned long long)newmem)*1024,
|
"U:value", newmem * 1024,
|
||||||
NULL);
|
NULL);
|
||||||
virJSONValuePtr reply = NULL;
|
virJSONValuePtr reply = NULL;
|
||||||
if (!cmd)
|
if (!cmd)
|
||||||
|
@ -94,7 +94,7 @@ int qemuMonitorJSONExpirePassword(qemuMonitorPtr mon,
|
|||||||
const char *protocol,
|
const char *protocol,
|
||||||
const char *expire_time);
|
const char *expire_time);
|
||||||
int qemuMonitorJSONSetBalloon(qemuMonitorPtr mon,
|
int qemuMonitorJSONSetBalloon(qemuMonitorPtr mon,
|
||||||
unsigned long newmem);
|
unsigned long long newmem);
|
||||||
int qemuMonitorJSONSetCPU(qemuMonitorPtr mon, int cpu, bool online);
|
int qemuMonitorJSONSetCPU(qemuMonitorPtr mon, int cpu, bool online);
|
||||||
|
|
||||||
int qemuMonitorJSONEjectMedia(qemuMonitorPtr mon,
|
int qemuMonitorJSONEjectMedia(qemuMonitorPtr mon,
|
||||||
|
@ -1110,12 +1110,10 @@ int qemuMonitorTextExpirePassword(qemuMonitorPtr mon,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Returns: 0 if balloon not supported, +1 if balloon adjust worked
|
int
|
||||||
* or -1 on failure
|
qemuMonitorTextSetBalloon(qemuMonitorPtr mon,
|
||||||
*/
|
unsigned long long newmem)
|
||||||
int qemuMonitorTextSetBalloon(qemuMonitorPtr mon,
|
|
||||||
unsigned long newmem)
|
|
||||||
{
|
{
|
||||||
char *cmd;
|
char *cmd;
|
||||||
char *reply = NULL;
|
char *reply = NULL;
|
||||||
@ -1125,7 +1123,7 @@ int qemuMonitorTextSetBalloon(qemuMonitorPtr mon,
|
|||||||
* 'newmem' is in KB, QEMU monitor works in MB, and we all wish
|
* 'newmem' is in KB, QEMU monitor works in MB, and we all wish
|
||||||
* we just worked in bytes with unsigned long long everywhere.
|
* 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;
|
return -1;
|
||||||
|
|
||||||
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
|
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
|
||||||
|
@ -79,7 +79,7 @@ int qemuMonitorTextExpirePassword(qemuMonitorPtr mon,
|
|||||||
const char *protocol,
|
const char *protocol,
|
||||||
const char *expire_time);
|
const char *expire_time);
|
||||||
int qemuMonitorTextSetBalloon(qemuMonitorPtr mon,
|
int qemuMonitorTextSetBalloon(qemuMonitorPtr mon,
|
||||||
unsigned long newmem);
|
unsigned long long newmem);
|
||||||
int qemuMonitorTextSetCPU(qemuMonitorPtr mon, int cpu, bool online);
|
int qemuMonitorTextSetCPU(qemuMonitorPtr mon, int cpu, bool online);
|
||||||
|
|
||||||
int qemuMonitorTextEjectMedia(qemuMonitorPtr mon,
|
int qemuMonitorTextEjectMedia(qemuMonitorPtr mon,
|
||||||
|
Loading…
Reference in New Issue
Block a user