+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.
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 {
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 {