[Pkg-libvirt-commits] [libguestfs] 06/12: v2v: Allow domain UUID to be used in place of libvirt guest name (RHBZ#1141680).

Hilko Bengen bengen at moszumanska.debian.org
Fri Oct 3 14:45:59 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag debian/1%1.27.46-1
in repository libguestfs.

commit 47251a3599b1477d7c3749912b404c756e613be6
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Mon Sep 15 10:15:10 2014 +0100

    v2v: Allow domain UUID to be used in place of libvirt guest name (RHBZ#1141680).
    
    Thanks: Zhou Junqin.
---
 v2v/domainxml-c.c | 6 +++++-
 v2v/domainxml.mli | 3 ++-
 v2v/virt-v2v.pod  | 5 +++--
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/v2v/domainxml-c.c b/v2v/domainxml-c.c
index 2d26c9e..948555a 100644
--- a/v2v/domainxml-c.c
+++ b/v2v/domainxml-c.c
@@ -119,7 +119,11 @@ v2v_dumpxml (value connv, value domnamev)
   /* Look up the domain. */
   domname = String_val (domnamev);
 
-  dom = virDomainLookupByName (conn, domname);
+  dom = virDomainLookupByUUIDString (conn, domname);
+
+  if (!dom)
+    dom = virDomainLookupByName (conn, domname);
+
   if (!dom) {
     err = virGetLastError ();
     snprintf (errmsg, sizeof errmsg,
diff --git a/v2v/domainxml.mli b/v2v/domainxml.mli
index 88d2d41..ec4f8fa 100644
--- a/v2v/domainxml.mli
+++ b/v2v/domainxml.mli
@@ -25,7 +25,8 @@
 
 val dumpxml : ?conn:string -> string -> string
 (** [dumpxml ?conn dom] returns the libvirt XML of domain [dom].
-    The optional [?conn] parameter is the libvirt connection URI. *)
+    The optional [?conn] parameter is the libvirt connection URI.
+    [dom] may be a guest name or UUID. *)
 
 val pool_dumpxml : ?conn:string -> string -> string
 (** [pool_dumpxml ?conn pool] returns the libvirt XML of pool [pool].
diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod
index ceb9950..ba5172f 100644
--- a/v2v/virt-v2v.pod
+++ b/v2v/virt-v2v.pod
@@ -166,8 +166,9 @@ disk can be imported this way.
 
 Set the input method to I<libvirt>.  This is the default.
 
-In this mode you have to specify a libvirt guest name on the command
-line.  You may also specify a libvirt connection URI (see I<-ic>).
+In this mode you have to specify a libvirt guest name or UUID on the
+command line.  You may also specify a libvirt connection URI (see
+I<-ic>).
 
 =item B<-i libvirtxml>
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list