]> xenbits.xensource.com Git - libvirt.git/commit
storage_conf: Resolve libvirtd crash matching scsi_host
authorJohn Ferlan <jferlan@redhat.com>
Tue, 30 Sep 2014 19:28:20 +0000 (15:28 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 29 Oct 2014 01:25:33 +0000 (21:25 -0400)
commit3f99d64db8a64675eefed9485fad720c630a816e
treec000013d3c1123140398b18e667ff14b6bccab30
parentbeff5d4e1bc72d673f6f0e61afeaa637eddc8e4d
storage_conf: Resolve libvirtd crash matching scsi_host

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

Resolve a crash in libvirtd resulting from commit id 'a4bd62ad' (1.0.6)
which added parentaddr and unique_id to allow unique identification of
a scsi_host, but assumed that all the pool entries and the incoming
definition would be similarly defined. If the existing pool uses the
'name' attribute and an incoming pool is using the parentaddr/unique_id,
then the code will attempt to compare the existing name string against
the incoming name string which doesn't exist (is NULL) and results in
a core (STREQ).

Conversely, if the existing pool used the parentaddr/unique_id and the
to be defined pool used the name, then the comparison would be against
the parentaddr, but since the incoming pool doesn't have one - that would
leave the comparison against a parentaddr of all 0's and a unique_id of 0,
which will always comparison to fail. This means someone could define the
same source adapter for two pools

In order to resolve this, adjust the code to get the 'host#' to be used
by the storage scsi backend in order to check/start the pool and make sure
the incoming definition doesn't match any of the existing pool defs.
src/conf/storage_conf.c