diff --git a/ChangeLog b/ChangeLog index ca5f61e888e2a60e8792a3c5d0faf1473d2b8cc0..7e655622b76f91426b8437ff5a548bc5babb4260 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sun Sep 30 15:20:36 CEST 2007 Daniel Veillard + + * src/virsh.c: use virNodeGetFreeMemory() for freecell without + argument + * src/libvirt_sym.version: export virNodeGetFreeMemory() + Sun Sep 30 14:49:27 CEST 2007 Daniel Veillard * include/libvirt/libvirt.h include/libvirt/libvirt.h.in diff --git a/src/libvirt_sym.version b/src/libvirt_sym.version index fa7cda3225172fdb65d25e85356011d23110af6d..9b194e9eddb57495a708b9600b8f01b903e1435b 100644 --- a/src/libvirt_sym.version +++ b/src/libvirt_sym.version @@ -59,6 +59,7 @@ virNodeGetInfo; virConnectGetCapabilities; virNodeGetCellsFreeMemory; + virNodeGetFreeMemory; virDomainSetVcpus; virDomainPinVcpu; diff --git a/src/virsh.c b/src/virsh.c index 0e47da8f109fee8695041c7a7b2bed507dc1a875..5af821ce475b027d931ebcbdf5de1b41a13672b4 100644 --- a/src/virsh.c +++ b/src/virsh.c @@ -1588,13 +1588,13 @@ cmdFreecell(vshControl * ctl, vshCmd * cmd) cell = vshCommandOptInt(cmd, "cellno", &cell_given); if (!cell_given) { - cell = -1; + memory = virNodeGetFreeMemory(ctl->conn); + } else { + ret = virNodeGetCellsFreeMemory(ctl->conn, &memory, cell, 1); + if (ret != 1) + return FALSE; } - ret = virNodeGetCellsFreeMemory(ctl->conn, &memory, cell, 1); - if (ret != 1) - return FALSE; - if (cell == -1) vshPrint(ctl, "%s: %llu kB\n", _("Total"), memory); else