[libvirt] [PATCH] libxl: detect support for save and restore

Eric Blake eblake at redhat.com
Wed Jun 25 19:10:20 UTC 2014


On 06/25/2014 12:13 PM, Jim Fehlig wrote:
> libxl does not support save, restore, or migrate on all architectures,
> notably ARM.  Detect whether libxl supports these operations using
> LIBXL_HAVE_NO_SUSPEND_RESUME.  If not supported, drop advertisement of
> <migration_features>.
> 
> Found by Ian Campbell while improving Xen's OSSTEST infrastructure
> 
> http://lists.xen.org/archives/html/xen-devel/2014-06/msg02171.html
> Signed-off-by: Jim Fehlig <jfehlig at suse.com>
> ---
> 
> Derived from a test patch I sent to Ian Campbell
> 
> http://lists.xen.org/archives/html/xen-devel/2014-06/msg03150.html
> 
> Includes fixups Ian provided later in the thread.
> 
>  src/libxl/libxl_conf.c   | 4 ++++
>  src/libxl/libxl_driver.c | 8 ++++++++
>  2 files changed, 12 insertions(+)

>  
> +#ifndef LIBXL_HAVE_NO_SUSPEND_RESUME

Double negative logic is hard to read. Oh well.


>  
>  static virDriver libxlDriver = {
> @@ -4594,10 +4598,12 @@ static virDriver libxlDriver = {
>      .domainSetMemoryFlags = libxlDomainSetMemoryFlags, /* 0.9.0 */
>      .domainGetInfo = libxlDomainGetInfo, /* 0.9.0 */
>      .domainGetState = libxlDomainGetState, /* 0.9.2 */
> +#ifndef LIBXL_HAVE_NO_SUSPEND_RESUME
>      .domainSave = libxlDomainSave, /* 0.9.2 */
>      .domainSaveFlags = libxlDomainSaveFlags, /* 0.9.4 */
>      .domainRestore = libxlDomainRestore, /* 0.9.2 */
>      .domainRestoreFlags = libxlDomainRestoreFlags, /* 0.9.4 */
> +#endif

Hmm - do we do conditional registration in any other driver based on
configure-time results?  I'd almost rather always provide the driver
registration, and then use #ifdefs in the body of that function to
either provide a sane result or else report that the compilation
environment was too old, rather than omit the support altogether.  Maybe
get Dan's opinion on this?

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140625/64fe938f/attachment-0001.sig>


More information about the libvir-list mailing list