libvirt/src/conf
Laine Stump 78fab2770b network: free/null newDef if network fails to start
https://bugzilla.redhat.com/show_bug.cgi?id=866364

pointed out a crash due to virNetworkObjAssignDef free'ing
network->newDef without NULLing it afterward. A fix for this is in
upstream commit b7e9202401. While the
NULLing of newDef was a legitimate fix, newDef should have already
been empty (NULL) anyway (as indicated in the comment that was deleted
by that commit).

The reason that newDef had a non-NULL value (i.e. the root cause) was
that networkStartNetwork() had failed after populating
network->newDef, but then neglected to free/NULL newDef in the
cleanup.

(A bit of background here: network->newDef should contain the
persistent config of a network when a network is active (and of course
only when it is persisten), and NULL at all other times. There is also
a network->def which should contain the persistent definition of the
network when it is inactive, and the current live state at all other
times. The idea is that you can make changes to network->newDef which
will take effect the next time the network is restarted, but won't
mess with the current state of the network (virDomainObj has a similar
pair of virDomainDefs that behave in the same fashion). Personally I
think there should be a network->live and network->config, and the
location of the persistent config should *always* be in
network->config, but that's for a later cleanup).

Since I love things to be symmetric, I created a new function called
virNetworkObjUnsetDefTransient(), which reverses the effects of
virNetworkObjSetDefTransient(). I don't really like the name of the
new function, but then I also didn't really like the name of the old
one either (it's just named that way to match a similar function in
the domain conf code).
2012-10-20 02:43:16 -04:00
..
capabilities.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
capabilities.h storage: use enum for default driver type 2012-10-19 17:35:09 -06:00
cpu_conf.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
cpu_conf.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
device_conf.c conf: fix virDevicePCIAddressEqual args 2012-10-15 04:03:06 -04:00
device_conf.h conf: fix virDevicePCIAddressEqual args 2012-10-15 04:03:06 -04:00
domain_audit.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
domain_audit.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
domain_conf.c storage: use cache to walk backing chain 2012-10-19 17:35:11 -06:00
domain_conf.h storage: use cache to walk backing chain 2012-10-19 17:35:11 -06:00
domain_event.c Add support for SUSPEND_DISK event 2012-10-15 12:09:10 +02:00
domain_event.h Add support for SUSPEND_DISK event 2012-10-15 12:09:10 +02:00
domain_nwfilter.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
domain_nwfilter.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
interface_conf.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
interface_conf.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
netdev_bandwidth_conf.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
netdev_bandwidth_conf.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
netdev_vlan_conf.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
netdev_vlan_conf.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
netdev_vport_profile_conf.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
netdev_vport_profile_conf.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
network_conf.c network: free/null newDef if network fails to start 2012-10-20 02:43:16 -04:00
network_conf.h network: free/null newDef if network fails to start 2012-10-20 02:43:16 -04:00
node_device_conf.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
node_device_conf.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
nwfilter_conf.c Various typos and misspellings 2012-10-12 00:03:43 +02:00
nwfilter_conf.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
nwfilter_ipaddrmap.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
nwfilter_ipaddrmap.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
nwfilter_params.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
nwfilter_params.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
secret_conf.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
secret_conf.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
snapshot_conf.c storage: use enum for snapshot driver type 2012-10-19 17:35:10 -06:00
snapshot_conf.h storage: use enum for snapshot driver type 2012-10-19 17:35:10 -06:00
storage_conf.c storage: list more file types 2012-10-19 17:35:09 -06:00
storage_conf.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
storage_encryption_conf.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
storage_encryption_conf.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virconsole.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virconsole.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00