]> xenbits.xensource.com Git - libvirt.git/commitdiff
openvzDomainCreateWithFlags: set domain id to the correct value
authorJean-Baptiste Rouault <jean-baptiste.rouault@diateam.net>
Fri, 30 Jul 2010 08:36:06 +0000 (10:36 +0200)
committerMatthias Bolte <matthias.bolte@googlemail.com>
Fri, 30 Jul 2010 20:25:32 +0000 (22:25 +0200)
When an openvz domain is defined with virDomainDefineXML,
domain id is set to -1. A call to virDomainGetInfo after
starting the domain would then fail because this invalid
id is passed to openvzGetProcessInfo.

src/openvz/openvz_driver.c

index 98381fbad86529d62575677db74654b852f4ff9d..e5bbdd0d541b7814e2f731b3565f00076321511c 100644 (file)
@@ -992,6 +992,7 @@ openvzDomainCreateWithFlags(virDomainPtr dom, unsigned int flags)
 
     vm->pid = strtoI(vm->def->name);
     vm->def->id = vm->pid;
+    dom->id = vm->pid;
     vm->state = VIR_DOMAIN_RUNNING;
     ret = 0;