
On 03/09/2011 08:57 AM, Daniel P. Berrange wrote:
+ switch (flags) { + case VIR_DOMAIN_MEM_CONFIG: + persistentDef->mem.cur_balloon = newmem; + ret = 0; + break; + + case VIR_DOMAIN_MEM_LIVE: + case VIR_DOMAIN_MEM_LIVE | VIR_DOMAIN_MEM_CONFIG:
I think it is a little wierd to use a 'switch' statement for processing this. I'd just have a pair of 'if' statements eg
if (flags & VIR_DOMAIN_MEM_LIVE) { .....do monitor stuff.... }
if (flags & VIR_DOMAIN_MEM_CONFIG) { persistentDef->mem.cur_balloon = newmem; ret = virDomainSaveConfig(driver->configDir, persistentDef); }
That's probably due to copy-and-paste from the persistent vcpu stuff; which admittedly is pretty convoluted stuff. I'm all for a simpler design, if it works. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org