]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: Check for storage conflicts across pool types
authorJohn Ferlan <jferlan@redhat.com>
Wed, 5 Apr 2017 13:04:54 +0000 (09:04 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 13 Apr 2017 14:10:39 +0000 (10:10 -0400)
commit4143b194ce29867929b05517c178ef9371ebb8b4
tree0490a5ffb9cf4dac358a639e2e318b74523dd076
parentf84b89fb1993cc9709624d0e1b21e5faa8f53b4e
conf: Check for storage conflicts across pool types

https://bugzilla.redhat.com/show_bug.cgi?id=1233129

The virStoragePoolObjSourceFindDuplicate logic used by PoolCreateXML
and PoolDefineXML avoids comparing the new definition against "other"
pool types. This can cause unexpected corruption if two different pool
source types used the same source device path. For example, a 'disk'
pool using source type device=/dev/sdc could be unwittingly overwritten
by using /dev/sdc for a 'logical' pool which also uses the source
device path.

So rather than blindly ignoring those checks when def->type !=
pool->def->type - have the pool->def->type switch logic handle the
check for which def->type's should be checked.
src/conf/virstorageobj.c