From: Mark McLoughlin Date: Tue, 20 Feb 2007 19:08:09 +0000 (+0000) Subject: Fri Feb 20 19:07:12 IST 2007 Mark McLoughlin X-Git-Tag: LIBVIRT_0_2_1~83 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=457946778356f541e43c882fddcca86bc713a6c4;p=thirdparty%2Flibvirt.git Fri Feb 20 19:07:12 IST 2007 Mark McLoughlin * qemud/conf.c: don't free active networks/vms if we fail to save the new config --- diff --git a/ChangeLog b/ChangeLog index 26980c3df0..1f18845d9f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Feb 20 19:07:12 IST 2007 Mark McLoughlin + + * 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 * virsh.c: cmdNetworkList() re-indent this. diff --git a/qemud/conf.c b/qemud/conf.c index 71474302d4..310259afb4 100644 --- a/qemud/conf.c +++ b/qemud/conf.c @@ -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 {