Hi, all

when I use (python API) setMemoryParameters with flags= 
VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE ,
an error occurs as follow: (libvirt 1.2.4)

libvirt:  error : flags 'affect live' and 'affect config' in 
virDomainGetMemoryParameters are mutually exclusive

I check the function libvirt_virDomainSetMemoryParameters in libvirt-override.c 
and find the code below:

Line 1204-1206:
     LIBVIRT_BEGIN_ALLOW_THREADS;
     i_retval = virDomainGetMemoryParameters(domain, NULL, &nparams, flags);
     LIBVIRT_END_ALLOW_THREADS;

Line 1220-1222:
    LIBVIRT_BEGIN_ALLOW_THREADS;
    i_retval = virDomainGetMemoryParameters(domain, params, &nparams, flags); 
    LIBVIRT_END_ALLOW_THREADS;

Function virDomainGetMemoryParameters doesn't support flags 
VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE.
So the error above occurs.

The first call of virDomainGetMemoryParameters is to "cause @nparams on output 
to contain the number of parameters
supported by the hypervisor". And what's the role of the second call?

Maybe, so do other functions such as *libvirt_virDomainSetSchedulerParameters, 
*libvirt_virDomainSetBlkioParameters
In commit 56cec18d761a1f99862c43811de60380c65881e6.

IMHO, an example flag (such as VIR_DOMAIN_AFFECT_CONFIG) can be used in 
virDomainGetMemoryParameters  
just to get something from hypervisor rather than @flags which is a parameter 
of setMemoryParameters .

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to