Add qemudAutostartConfigs() to autostart guests and networks. Signed-off-by: Mark McLoughlin <markmc@xxxxxxxxxx> Index: libvirt/qemud/conf.c =================================================================== --- libvirt.orig/qemud/conf.c +++ libvirt/qemud/conf.c @@ -1705,6 +1705,37 @@ int qemudScanConfigDir(struct qemud_serv return 0; } +static +void qemudAutostartConfigs(struct qemud_server *server) { + struct qemud_network *network; + struct qemud_vm *vm; + + network = server->networks; + while (network != NULL) { + struct qemud_network *next = network->next; + if (network->autostart && + !network->active && + qemudNetworkStart(server, network) < 0) + qemudLog(QEMUD_ERR, "Failed to autostart network '%s'", + network->def->name); + + network = next; + } + + vm = server->vms; + while (vm != NULL) { + struct qemud_vm *next = vm->next; + + if (vm->autostart && + !vm->active && + qemudDomainStart(server, vm) < 0) + qemudLog(QEMUD_ERR, "Failed to autostart VM '%s'", + vm->def->name); + + vm = next; + } +} + /* Scan for all guest and network config files */ int qemudScanConfigs(struct qemud_server *server) { int i; @@ -1721,6 +1752,8 @@ int qemudScanConfigs(struct qemud_server return -1; } + qemudAutostartConfigs(server); + return 0; } --