]> xenbits.xensource.com Git - libvirt.git/commit
nwfilter: Save config to disk if we generated a UUID
authorCole Robinson <crobinso@redhat.com>
Sun, 24 Apr 2016 23:04:10 +0000 (19:04 -0400)
committerCole Robinson <crobinso@redhat.com>
Mon, 2 May 2016 14:06:04 +0000 (10:06 -0400)
commit441e881e9a2382a965eb540fe45df85b3acb4058
treec5f08643d3f55985aaa79cb7f014d499273b2f8d
parent0feb1c6c249e791405297c8a6c25fd81c00b424d
nwfilter: Save config to disk if we generated a UUID

libvirt-daemon-config-nwfilter will put a bunch of xml configs
into /etc/libvirt/nwfilter. These configs don't hardcode a UUID
and depends on libvirt to generate one. However the generated UUID
is never saved to disk, unless the user manually calls Define.

This makes daemon reload quite noisy with many errors like:

error : virNWFilterObjAssignDef:3101 : operation failed: filter 'allow-incoming-ipv4' already exists with uuid 50def3b5-48d6-46a3-b005-cc22df4e5c5c

Because a new UUID is generated every time the config is read from
disk, so libvirt constantly thinks it's finding a new nwfilter.

Detect if we generated a UUID when the config file is loaded; if so,
resave the new contents to disk to ensure the UUID is persisteny.

This is similar to what was done in commit a47ae7c0 with virtual
networks and generated MAC addresses
src/conf/nwfilter_conf.c
src/conf/nwfilter_conf.h