mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-03 17:47:15 +03:00
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:
parent
07601749e8
commit
edbbb3aa12
@ -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
|
||||
|
@ -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.
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user