On 03/14/2011 11:11 PM, Taku Izumi wrote:
> What we need is three flags instead of two:
>
> VIR_DOMAIN_MEM_LIVE
> VIR_DOMAIN_MEM_CONFIG
> VIR_DOMAIN_MEM_CURRENT - use LIVE or CONFIG according to domain state
Daniel's suggestion of letting virDomainSetMemoryFlags(,0) operate as
_CURRENT mode sounds best to me (right now, the qemu implementation
rejects flags==0, and none of the other hypervisors have flags support yet).
> where we document that virDomainSetMemory is hypervisor-defined
whether
> it implies CURRENT (xen) or LIVE (qemu), and where
> virDomainSetMemoryFlags properly honors all three flags for both
> hypervisors.
Insofar as possible (for example, Matthias pointed out that esx cannot
honor _LIVE in isolation - it only supports _LIVE|_CONFIG on running,
and _CONFIG on inactive).
Does this indicate that the new option "--current" is added to "virsh
setmem"
command?
Or does this indicate "virsh setmem" command with --live option invokes
xenUnifiedDomainSetMemoryFlags with VIR_DOMAIN_MEM_CURRENT in case of Xen?
I think what this means is that we do need three boolean flags in the
virsh command:
virsh setmem => virDomainSetMemory (which in turn might
be virDomainSetMemoryFlags(,0) or virDomainSetMemoryFlags(,_LIVE)
depending on hypervisor)
virsh setmem --live => virDomainSetMemoryFlags(,_LIVE)
virsh setmem --config => virDomainSetMemoryFlags(,_CONFIG)
virsh setmem --live --config => virDomainSetMemoryFlags(,_LIVE|_CONFIG)
virsh setmem --current => virDomainSetMemoryFlags(,0)
virsh setmem --current --live => virsh error
virsh setmem --current --config => virsh error
and since virDomainSetMemory no longer implies _LIVE for all
hypervisors, we also have to delete the current code base fallback of:
virsh setmem --live => virDomainSetMemory
That is, no flags gets the old API with its hypervisor-specific quirks,
and any flag at all requires the new API and has exact control over what
gets modified.
Is this something you are willing to tackle?
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library
http://libvirt.org