Skip to contentSkip to conversation

libxl: introduce libxlDomainDefCheckABIStability

PATCH New Jim Fehlig 2 participants 5 messages Jun 4, 2014 – Jun 5, 2014 4 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Jim Fehlig

author
#1 lore raw

PATCH v8 1/2 libxl: introduce libxlDomainDefCheckABIStability

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

---
 src/libxl/libxl_domain.c | 23 +++++++++++++++++++++++
 src/libxl/libxl_domain.h |  5 +++++
 2 files changed, 28 insertions(+)
src/libxl/libxl_domain.c +23 -0
index eab789a..73242ac 100644
@@ -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;
+}
src/libxl/libxl_domain.h +5 -0
index 979ce2a..6939008 100644
@@ -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 */
Signature · 1 line
1.8.4.5
author
#2 lore raw

PATCH v8 2/2 libxl: add migration support

In reply to a message not in the archive

This patch adds initial migration support to the libxl driver, using the VIR_DRV_FEATURE_MIGRATION_PARAMS family of migration functions.

---
 po/POTFILES.in              |   1 +
 src/Makefile.am             |   3 +-
 src/libxl/libxl_conf.h      |   6 +
 src/libxl/libxl_domain.h    |   1 +
 src/libxl/libxl_driver.c    | 235 ++++++++++++++++++
 src/libxl/libxl_migration.c | 585 ++++++++++++++++++++++++++++++++++++++++++++
 src/libxl/libxl_migration.h |  79 ++++++
 7 files changed, 909 insertions(+), 1 deletion(-)
po/POTFILES.in +1 -0
index cff92d9..2ee7225 100644
@@ -74,6 +74,7 @@ src/lxc/lxc_process.c
 src/libxl/libxl_domain.c
 src/libxl/libxl_driver.c
 src/libxl/libxl_conf.c
+src/libxl/libxl_migration.c
 src/network/bridge_driver.c
 src/network/bridge_driver_linux.c
 src/network/leaseshelper.c
src/Makefile.am +2 -1
index d82ca26..01af164 100644
@@ -707,7 +707,8 @@ XENAPI_DRIVER_SOURCES =						\
 LIBXL_DRIVER_SOURCES =						\
 		libxl/libxl_conf.c libxl/libxl_conf.h		\
 		libxl/libxl_domain.c libxl/libxl_domain.h       \
-		libxl/libxl_driver.c libxl/libxl_driver.h
+		libxl/libxl_driver.c libxl/libxl_driver.h       \
+		libxl/libxl_migration.c libxl/libxl_migration.h
 
 UML_DRIVER_SOURCES =						\
 		uml/uml_conf.c uml/uml_conf.h			\
src/libxl/libxl_conf.h +6 -0
index 433d6da..6aa36d2 100644
@@ -43,6 +43,9 @@
 # define LIBXL_VNC_PORT_MIN  5900
 # define LIBXL_VNC_PORT_MAX  65535
 
+# define LIBXL_MIGRATION_PORT_MIN  49152
+# define LIBXL_MIGRATION_PORT_MAX  49216
+
 # define LIBXL_CONFIG_DIR SYSCONFDIR "/libvirt/libxl"
 # define LIBXL_AUTOSTART_DIR LIBXL_CONFIG_DIR "/autostart"
 # define LIBXL_STATE_DIR LOCALSTATEDIR "/run/libvirt/libxl"
@@ -115,6 +118,9 @@ struct _libxlDriverPrivate {
     /* Immutable pointer, self-locking APIs */
     virPortAllocatorPtr reservedVNCPorts;
 
+    /* Immutable pointer, self-locking APIs */
+    virPortAllocatorPtr migrationPorts;
+
     /* Immutable pointer, lockless APIs*/
     virSysinfoDefPtr hostsysinfo;
 };
src/libxl/libxl_domain.h +1 -0
index 6939008..f459fdf 100644
@@ -69,6 +69,7 @@ struct _libxlDomainObjPrivate {
     virChrdevsPtr devs;
     libxl_evgen_domain_death *deathW;
     libxlDriverPrivatePtr driver;
+    unsigned short migrationPort;
 
     struct libxlDomainJobObj job;
 };
src/libxl/libxl_driver.c +235 -0

271 lines not on this page · raw message

src/libxl/libxl_migration.c new file +585 -0

585 lines not on this page · raw message

src/libxl/libxl_migration.h new file +79 -0

79 lines not on this page · raw message

Signature · 1 line
1.8.4.5

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 8 lines · Jim Fehlig

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

---
 src/libxl/libxl_domain.c | 23 +++++++++++++++++++++++
 src/libxl/libxl_domain.h |  5 +++++
 2 files changed, 28 insertions(+)

ACK

Regards,
Daniel

Signature · 4 lines
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw

Re: [libvirt] [PATCH V8 2/2] libxl: add migration support

Quoted 5 lines · Jim Fehlig

This patch adds initial migration support to the libxl driver, using the VIR_DRV_FEATURE_MIGRATION_PARAMS family of migration functions.

Quoted 9 lines
---
 po/POTFILES.in              |   1 +
 src/Makefile.am             |   3 +-
 src/libxl/libxl_conf.h      |   6 +
 src/libxl/libxl_domain.h    |   1 +
 src/libxl/libxl_driver.c    | 235 ++++++++++++++++++
 src/libxl/libxl_migration.c | 585 ++++++++++++++++++++++++++++++++++++++++++++
 src/libxl/libxl_migration.h |  79 ++++++
 7 files changed, 909 insertions(+), 1 deletion(-)

ACK

Regards,
Daniel

Signature · 4 lines
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#8 lore raw

Re: [libvirt] [PATCH V8 2/2] libxl: add migration support

Quoted 18 lines · Daniel P. Berrange
Quoted 5 lines · Jim Fehlig

This patch adds initial migration support to the libxl driver, using the VIR_DRV_FEATURE_MIGRATION_PARAMS family of migration functions.

Quoted 10 lines
---
 po/POTFILES.in              |   1 +
 src/Makefile.am             |   3 +-
 src/libxl/libxl_conf.h      |   6 +
 src/libxl/libxl_domain.h    |   1 +
 src/libxl/libxl_driver.c    | 235 ++++++++++++++++++
 src/libxl/libxl_migration.c | 585 ++++++++++++++++++++++++++++++++++++++++++++
 src/libxl/libxl_migration.h |  79 ++++++
 7 files changed, 909 insertions(+), 1 deletion(-)
Quoted 2 lines

ACK

Thanks, I pushed these patches now. The ABI stability check was a nice improvement. Verified it works when making simple changes like number of vcpus, max mem, etc.

Regards,
Jim