]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fri Feb 20 19:07:12 IST 2007 Mark McLoughlin <markmc@redhat.com>
authorMark McLoughlin <markmc@redhat.com>
Tue, 20 Feb 2007 19:08:09 +0000 (19:08 +0000)
committerMark McLoughlin <markmc@redhat.com>
Tue, 20 Feb 2007 19:08:09 +0000 (19:08 +0000)
        * qemud/conf.c: don't free active networks/vms if we
        fail to save the new config

ChangeLog
qemud/conf.c

index 26980c3df0029d2e6aff191f263c1bc133cfc817..1f18845d9f6c2d395fd591180480a8258ab4c994 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index 71474302d4fa1e523aa7e05b1dd7ca2cce677cf4..310259afb42389d764dab0afc499692df73a2b18 100644 (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 {