diff --git a/AUTHORS b/AUTHORS index 63661b11ae4fbaa2fb9deb96e84190228de97e5f..dbc00c775f0aca6c2d670ffeed76d2d63c1fc6aa 100644 --- a/AUTHORS +++ b/AUTHORS @@ -175,6 +175,7 @@ Patches have also been contributed by: Heath Petersen Neil Wilson Ohad Levy + Michael Chapman [....send patches to get your name here....] diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 65d4f8957f66ec18fe1d464d86bfc69451036316..be5267bf2cce827e971155b71c66fc417291d907 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9862,21 +9862,24 @@ static virDomainObjPtr virDomainLoadConfig(virCapsPtr caps, 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;