]> xenbits.xensource.com Git - libvirt.git/commitdiff
ID domain lookup fixup
authorDaniel Veillard <veillard@redhat.com>
Wed, 16 Jul 2008 20:42:38 +0000 (20:42 +0000)
committerDaniel Veillard <veillard@redhat.com>
Wed, 16 Jul 2008 20:42:38 +0000 (20:42 +0000)
* src/libvirt.c src/openvz_driver.c: fix the description of the ID
  domain lookup and fix the OpenVZ routine
Daniel

ChangeLog
src/libvirt.c
src/openvz_driver.c

index e35a1ad0027afb74e3654f2cf2ceb9478297367f..734a721cf650f901dd98974f8bbb0bcb99102dde 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Jul 16 22:36:43 CEST 2008 Daniel Veillard <veillard@redhat.com>
+
+       * src/libvirt.c src/openvz_driver.c: fix the description of the ID 
+         domain lookup and fix the OpenVZ routine
+
 Wed Jul 16 17:25:02 CEST 2008 Daniel Veillard <veillard@redhat.com>
 
        * src/openvz_driver.c: fix the lookup by ID function and error
index 0ce90cf633115110fb26149c736360cf5f1dc538..434ab69a050d47686ec8699d8c3b2a0793e312e4 100644 (file)
@@ -1253,6 +1253,8 @@ virDomainCreateLinux(virConnectPtr conn, const char *xmlDesc,
  * @id: the domain ID number
  *
  * Try to find a domain based on the hypervisor ID number
+ * Note that this won't work for inactive domains which have an ID of -1,
+ * in that case a lookup based on the Name or UUId need to be done instead.
  *
  * Returns a new domain object or NULL in case of failure.  If the
  * domain cannot be found, then VIR_ERR_NO_DOMAIN error is raised.
index d1aa87b8ea30b2f7b70c4ea0221b341d24e20d3e..61ba6ff41ca60117348dcc02fe20ea5d430cfce9 100644 (file)
@@ -202,15 +202,6 @@ static virDomainPtr openvzDomainLookupByID(virConnectPtr conn,
 
     vm = openvzFindVMByID(driver, id);
 
-    if (!vm) { /*try to find by name*/
-        char name[OPENVZ_NAME_MAX];
-        if (snprintf(name, OPENVZ_NAME_MAX, "%d",id) >= OPENVZ_NAME_MAX) {
-            openvzError(conn, VIR_ERR_INTERNAL_ERROR, _("Too long domain name"));
-            return NULL;
-        }
-        vm = openvzFindVMByName(driver, name);
-    }
-
     if (!vm) {
         openvzError(conn, VIR_ERR_NO_DOMAIN, NULL);
         return NULL;