[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libvir] [RFC] Life-cycle Management of the domain take2


I'm making a patch to provide a changing allocation dynamically and statically
without keeping state at the library.
And this is still uncompleted works, but I would like to hear your comments.

Attached patch shows below:
# virsh --help setmem
    setmem - change memory allocation

    virsh setmem <domain> <kilobytes> [ --static | --dynamic ]

    Change the current memory allocation in the guest domain.

    <domain>         domain name, id or uuid
    <kilobytes>      number of kilobytes of memory
    --static         static change
    --dynamic        dynamic change

First, I made upper interface.
    virsh.c ( attached file "add_option2virsh.patch )
        - add 2 options as follows:
            --dynamic, --static
        - call new APIs:
            virDomainSetMaxMemory -> virDomainSetMaxMemoryScope
            virDomainSetMemory -> virDomainSetMemoryScope
            virDomainSetVcpus -> virDomainSetVcpusScope
    libvirt.c ( attached file "add_option2libvirt.patch )
        - add 3 APIs:
and I will add lower driver as follows in the case of setmem.
    drivers ( attached file "add_option2driver.patch )
        - xen_unified.c   : add xenUnifiedDomainSetMemoryScope
        - xend_internal.c : add xenDaemonDomainSetMemoryScope
        - other           : set NULL to domainSetMemoryScope

I plan to achieve allocation dynamically and statically by such a way 
at xenDaemonDomainSetMemoryScope.
    1. get configuration from the Xen Daemon using sexpr_get.
    2. change the value 
       when static option is specified, change the node of configuration using
       new API that I will make.
       when dynamic option is specified, change the allocation using xend_op
    3. set configuration to the Xen Daemon using xend_op

Why I did not use virDomainGetXMLDesc and virDomainDefineXML was some elements
ware lost in current XML.
For example, there is no "vncpasswd", "cpus", "localtime" in XML configuration
with virDomainGetXMLDesc. So when I set the "vncpasswd" the "vncpasswd" will
disappear after I define the XML configuration.

How does this sound ?

Saori Fukuta.

Attachment: add_scope_enum.patch
Description: Binary data

Attachment: add_option2virsh.patch
Description: Binary data

Attachment: add_option2libvirt.patch
Description: Binary data

Attachment: add_option2driver.patch
Description: Binary data

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]