Fri Feb 20 19:07:12 IST 2007 Mark McLoughlin <markmc@redhat.com>

* qemud/conf.c: don't free active networks/vms if we
        fail to save the new config
This commit is contained in:
Mark McLoughlin 2007-02-20 19:08:09 +00:00
parent 458344c94e
commit 4579467783
2 changed files with 13 additions and 4 deletions

View File

@ -1,3 +1,8 @@
Fri Feb 20 19:07:12 IST 2007 Mark McLoughlin <markmc@redhat.com>
* qemud/conf.c: don't free active networks/vms if we
fail to save the new config
Fri Feb 20 18:25:42 IST 2007 Mark McLoughlin <markmc@redhat.com>
* virsh.c: cmdNetworkList() re-indent this.

View File

@ -1247,12 +1247,14 @@ struct qemud_vm *qemudLoadConfigXML(struct qemud_server *server,
if (qemudMakeConfigPath(server->configDir, vm->def->name, ".xml", vm->configFile, PATH_MAX) < 0) {
qemudReportError(server, VIR_ERR_INTERNAL_ERROR,
"cannot construct config file path");
qemudFreeVM(vm);
if (newVM)
qemudFreeVM(vm);
return NULL;
}
if (qemudSaveConfig(server, vm) < 0) {
qemudFreeVM(vm);
if (newVM)
qemudFreeVM(vm);
return NULL;
}
} else {
@ -1587,12 +1589,14 @@ struct qemud_network *qemudLoadNetworkConfigXML(struct qemud_server *server,
if (save) {
if (qemudMakeConfigPath(server->networkConfigDir, network->def->name, ".xml", network->configFile, PATH_MAX) < 0) {
qemudReportError(server, VIR_ERR_INTERNAL_ERROR, "cannot construct config file path");
qemudFreeNetwork(network);
if (newNetwork)
qemudFreeNetwork(network);
return NULL;
}
if (qemudSaveNetworkConfig(server, network) < 0) {
qemudFreeNetwork(network);
if (newNetwork)
qemudFreeNetwork(network);
return NULL;
}
} else {