[libvirt] [PATCH] setmem: provide dummy impls for remaining drivers

Eric Blake eblake at redhat.com
Tue Mar 15 14:12:45 UTC 2011


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 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/20110315/911d9bca/attachment-0001.sig>


More information about the libvir-list mailing list