ID domain lookup fixup

* src/libvirt.c src/openvz_driver.c: fix the description of the ID
  domain lookup and fix the OpenVZ routine
Daniel
This commit is contained in:
Daniel Veillard 2008-07-16 20:42:38 +00:00
parent 07601749e8
commit edbbb3aa12
3 changed files with 7 additions and 9 deletions

View File

@ -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

View 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.

View 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;