[libvirt-users] [libvirt] [LXC] Tyring to locate livbvirt operations for LXC relocation

Avi Weit WEIT at il.ibm.com
Wed Feb 3 14:03:10 UTC 2010


Hello,

I am searching for the libvirt operations for relocating LXC (system or
application) containers. LXC relocation mechanism is done by checkpoint /
restart. I went over libvirt API documentation and found the following
methods:

virDomainSave that receives a domain and path to state file. The method
saves domain's memory contents into a disk file.
virDomainRestore that receives a domain and path to state file. The method
restores the domain from the state file created by save operation.

Are these the proper methods to use for LXC relocation? I assume I can also
use the corresponding operations via virsh (save / restore)..

>From looking into lxcDriver object (defined under /src/lxc/xlc_driver.c in
libvirt server source) I can see that NULLs are set in save and restore
methods. Does that mean that there is no support for saving and restoring
Linux containers? Is there a libvirt patch beyond the kernel patch that
needs to be applied?

I am using libvirt 0.7.5 and kernel 2.6.31

/* Function Tables */
static virDriver lxcDriver = {
    VIR_DRV_LXC, /* the number virDrvNo */
    "LXC", /* the name of the driver */
    lxcOpen, /* open */
    lxcClose, /* close */
    NULL, /* supports_feature */
    NULL, /* type */
    lxcVersion, /* version */
    NULL, /* libvirtVersion (impl. in libvirt.c) */
    virGetHostname, /* getHostname */
    NULL, /* getMaxVcpus */
    nodeGetInfo, /* nodeGetInfo */
    lxcGetCapabilities, /* getCapabilities */
    lxcListDomains, /* listDomains */
    lxcNumDomains, /* numOfDomains */
    lxcDomainCreateAndStart, /* domainCreateXML */
    lxcDomainLookupByID, /* domainLookupByID */
    lxcDomainLookupByUUID, /* domainLookupByUUID */
    lxcDomainLookupByName, /* domainLookupByName */
    lxcDomainSuspend, /* domainSuspend */
    lxcDomainResume, /* domainResume */
    lxcDomainShutdown, /* domainShutdown */
    NULL, /* domainSave */
   NULL, /* domainRestore */
   NULL, /* domainMigratePrepare */
   NULL, /* domainMigratePerform */
   NULL, /* domainMigrateFinish */
...
...

Thanks,
- Avi




More information about the libvirt-users mailing list