From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH OSSTEST v2 18/18] WIP: libvirt: migration + save/restore support. Date: Tue, 2 Dec 2014 16:04:59 +0000 Message-ID: <1417536299-1810-18-git-send-email-ian.campbell@citrix.com> References: <1417536141.29004.6.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1417536141.29004.6.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: ian.jackson@eu.citrix.com Cc: Jim Fehlig , Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Note that this remains stubbed out, since making it actually work requires more work (i.e. I need to figure out what is involved, seem to need TLS and a CA etc...) Appears to need gnutls enabling for migration, even to localhost. NB haven't managed to get this actually working. With GNUtls enabled it wants a CA certificate installed: error: Cannot read CA certificate '/etc/pki/CA/cacert.pem': No such file or directory Other attempts give: # virsh migrate --live debian.guest.osstest xen:// error: Requested operation is not valid: domain 'debian.guest.osstest' is already active Also need to try tcp:// based, by bodging libvirtd.conf to turn on tcp. TODO: Ask Jim for advice... Signed-off-by: Ian Campbell --- Osstest/Toolstack/libvirt.pm | 17 +++++++++++++++++ ts-libvirt-build | 3 +++ ts-xen-build-prep | 1 + 3 files changed, 21 insertions(+) diff --git a/Osstest/Toolstack/libvirt.pm b/Osstest/Toolstack/libvirt.pm index 8030aeb..e427f63 100644 --- a/Osstest/Toolstack/libvirt.pm +++ b/Osstest/Toolstack/libvirt.pm @@ -65,12 +65,29 @@ sub shutdown_wait ($$) { sub migrate_check ($) { my ($self) = @_; + + # Localhost migration currently requires more setup on our side + # than we currently do. Once that is sorted out the code below + # will correctly determine whether the version of libvirt under + # test even supports the possibility. die "Migration check is not yet supported on libvirt."; + + my $ho = $self->{Host}; + my $caps = target_cmd_output_root($ho, "virsh capabilities"); + my $rc = ($caps =~ m//) ? 0 : 1; + logm("rc=$rc"); + return $rc; } sub migrate ($) { my ($self,$gho,$dst,$to) = @_; die "Migration is not yet supported on libvirt."; + + my $ho = $self->{Host}; + my $gn = $gho->{Name}; + target_cmd_root($ho, + "virsh migrate $gn $dst", + $to); } sub save ($$$$) { diff --git a/ts-libvirt-build b/ts-libvirt-build index 878d4e2..c160533 100755 --- a/ts-libvirt-build +++ b/ts-libvirt-build @@ -55,6 +55,7 @@ sub config() { ./autogen.sh --no-git \\ --with-libxl --without-xen --without-xenapi --without-selinux \\ --without-lxc --without-vbox --without-uml \\ + --with-gnutls \\ --sysconfdir=/etc --localstatedir=/var #/ END } @@ -80,6 +81,8 @@ END $builddir.'/dist/etc/init.d/libvirtd'); target_cmd_build($ho, 60, $builddir, <