]> xenbits.xensource.com Git - libvirt.git/commitdiff
esx: Update ID after starting a domain
authorMatthias Bolte <matthias.bolte@googlemail.com>
Fri, 30 Jul 2010 15:06:20 +0000 (17:06 +0200)
committerMatthias Bolte <matthias.bolte@googlemail.com>
Fri, 30 Jul 2010 15:14:02 +0000 (17:14 +0200)
src/esx/esx_driver.c

index eb645561a7a113dd6ee2fc3fbbbdfec078c3c774..964a3a5b26dec191e45e4c6f15da3e68885ef293 100644 (file)
@@ -2483,6 +2483,7 @@ esxDomainCreateWithFlags(virDomainPtr domain, unsigned int flags)
     esxVI_ObjectContent *virtualMachine = NULL;
     esxVI_String *propertyNameList = NULL;
     esxVI_VirtualMachinePowerState powerState;
+    int id = -1;
     esxVI_ManagedObjectReference *task = NULL;
     esxVI_TaskInfoState taskInfoState;
 
@@ -2497,8 +2498,8 @@ esxDomainCreateWithFlags(virDomainPtr domain, unsigned int flags)
         esxVI_LookupVirtualMachineByUuidAndPrepareForTask
           (priv->primary, domain->uuid, propertyNameList, &virtualMachine,
            priv->autoAnswer) < 0 ||
-        esxVI_GetVirtualMachinePowerState(virtualMachine,
-                                          &powerState) < 0) {
+        esxVI_GetVirtualMachinePowerState(virtualMachine, &powerState) < 0 ||
+        esxVI_GetVirtualMachineIdentity(virtualMachine, &id, NULL, NULL) < 0) {
         goto cleanup;
     }
 
@@ -2521,6 +2522,7 @@ esxDomainCreateWithFlags(virDomainPtr domain, unsigned int flags)
         goto cleanup;
     }
 
+    domain->id = id;
     result = 0;
 
   cleanup: