Heath Petersen <HeathPetersen@Kandre.com>
Neil Wilson <neil@aldur.co.uk>
Ohad Levy <ohadlevy@gmail.com>
+ Michael Chapman <mike@very.puzzling.org>
[....send patches to get your name here....]
VIR_DOMAIN_XML_INACTIVE)))
goto error;
- /* if the domain is already in our hashtable, we don't need to do
- * anything further
+ if ((autostartLink = virDomainConfigFile(autostartDir, name)) == NULL)
+ goto error;
+
+ if ((autostart = virFileLinkPointsTo(autostartLink, configFile)) < 0)
+ goto error;
+
+ /* if the domain is already in our hashtable, we only need to
+ * update the autostart flag
*/
if ((dom = virDomainFindByUUID(doms, def->uuid))) {
+ dom->autostart = autostart;
+
VIR_FREE(configFile);
+ VIR_FREE(autostartLink);
virDomainDefFree(def);
return dom;
}
- if ((autostartLink = virDomainConfigFile(autostartDir, name)) == NULL)
- goto error;
-
- if ((autostart = virFileLinkPointsTo(autostartLink, configFile)) < 0)
- goto error;
-
if (!(dom = virDomainAssignDef(caps, doms, def, false)))
goto error;