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

Saori Fukuta fukuta.saori at jp.fujitsu.com
Fri Apr 27 10:57:09 UTC 2007


Hi,

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
  NAME
    setmem - change memory allocation

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

  DESCRIPTION
    Change the current memory allocation in the guest domain.

  OPTIONS
    <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:
            virDomainSetMaxMemoryScope
            virDomainSetMemoryScope
            virDomainSetVcpusScope
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 ?

Thanks,
Saori Fukuta.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add_scope_enum.patch
Type: application/octet-stream
Size: 1734 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20070427/b67b0485/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add_option2virsh.patch
Type: application/octet-stream
Size: 5312 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20070427/b67b0485/attachment-0005.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add_option2libvirt.patch
Type: application/octet-stream
Size: 4027 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20070427/b67b0485/attachment-0006.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add_option2driver.patch
Type: application/octet-stream
Size: 11996 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20070427/b67b0485/attachment-0007.obj>


More information about the libvir-list mailing list