[libvirt] [PATCH 5/5] setmem: add the new options to "virsh setmem" command

Paolo Bonzini pbonzini at redhat.com
Thu Mar 10 07:44:52 UTC 2011


On 03/09/2011 04:59 PM, Daniel P. Berrange wrote:
>> >  +    if (!flags) {
>> >  +    	if (virDomainSetMemory(dom, kilobytes) != 0) {
>> >  +            ret = FALSE;
>> >  +    	}
>
> Indentation went a little bit wrong here. Also  '!flags' could
> in fact be '!flags || (flags == VIR_DOMAIN_MEM_LIVE)'  since if
> only the --live flag was set, we can still use the original API
> call for greater backcompatibility.

Perhaps this choice of APIs should be done in libvirt rather than virsh 
(with virsh always calling the new API).  This way all clients can talk 
to an older remote libvirt without having to care about 
virDomainSetMemory vs. virDomainSetMemoryFlags.

Paolo




More information about the libvir-list mailing list