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

[Xen-devel] [PATCH V8 1/2] libxl: introduce libxlDomainDefCheckABIStability



Introduce a simple libxlDomainDefCheckABIStability() function that
can be used check ABI stability between two virDomainDef objects.

Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxx>
---
 src/libxl/libxl_domain.c | 23 +++++++++++++++++++++++
 src/libxl/libxl_domain.h |  5 +++++
 2 files changed, 28 insertions(+)

diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index eab789a..73242ac 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -1256,3 +1256,26 @@ libxlDomainStart(libxlDriverPrivatePtr driver, 
virDomainObjPtr vm,
     virObjectUnref(cfg);
     return ret;
 }
+
+bool
+libxlDomainDefCheckABIStability(libxlDriverPrivatePtr driver,
+                                virDomainDefPtr src,
+                                virDomainDefPtr dst)
+{
+    virDomainDefPtr migratableDefSrc = NULL;
+    virDomainDefPtr migratableDefDst = NULL;
+    libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver);
+    bool ret = false;
+
+    if (!(migratableDefSrc = virDomainDefCopy(src, cfg->caps, driver->xmlopt, 
true)) ||
+        !(migratableDefDst = virDomainDefCopy(dst, cfg->caps, driver->xmlopt, 
true)))
+        goto cleanup;
+
+    ret = virDomainDefCheckABIStability(migratableDefSrc, migratableDefDst);
+
+ cleanup:
+    virDomainDefFree(migratableDefSrc);
+    virDomainDefFree(migratableDefDst);
+    virObjectUnref(cfg);
+    return ret;
+}
diff --git a/src/libxl/libxl_domain.h b/src/libxl/libxl_domain.h
index 979ce2a..6939008 100644
--- a/src/libxl/libxl_domain.h
+++ b/src/libxl/libxl_domain.h
@@ -139,4 +139,9 @@ libxlDomainStart(libxlDriverPrivatePtr driver,
                  bool start_paused,
                  int restore_fd);
 
+bool
+libxlDomainDefCheckABIStability(libxlDriverPrivatePtr driver,
+                                virDomainDefPtr src,
+                                virDomainDefPtr dst);
+
 #endif /* LIBXL_DOMAIN_H */
-- 
1.8.4.5


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.