[libvirt] [PATCH 3/5] setmem: implement the code to address the new API in the qemu driver
Eric Blake
eblake at redhat.com
Wed Mar 9 16:05:54 UTC 2011
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 at redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110309/89db4146/attachment-0001.sig>
More information about the libvir-list
mailing list