[libvirt] [PATCH V2 1/1] libvirtd crash when defining scsi storage pool

John Ferlan jferlan at redhat.com
Fri Sep 5 19:39:52 UTC 2014



On 09/05/2014 01:47 AM, Pradipta Kr. Banerjee wrote:
> libvirtd crash when defining scsi storage pool
> 
> libvirtd crashes  when  there is an existing SCSI pool defined
> with adapter type as 'scsi_host' and defining a new SCSI pool with adapter
> type as 'fc_host' and parent attribute missing or vice versa.
> 
> For eg If there is an existing SCSI pool with adapter type as 'scsi_host'
> defined using the following XML
> 
> <pool type='scsi'>
>   <name>TEST_SCSI_POOL</name>
>     <source>
>        <adapter type='scsi_host' name='scsi_host1'/>
>     </source>
>     <target>
>         <path>/dev/disk/by-path</path>
>     </target>
> </pool>
> 
> When defining another SCSI pool with adapter type as 'fc_host' using the
> following XML will crash libvirtd
> 
> <pool type='scsi'>
>   <name>TEST_SCSI_FC_POOL</name>
>   <source>
>      <adapter type='fc_host' wwnn='1234567890abcdef' wwpn='abcdef1234567890'/>
>   </source>
>   <target>
>      <path>/dev/disk/by-path</path>
>   </target>
> </pool>
> 
> Same is true for the reverse case as well where there exists a SCSI pool with
> adapter type as 'fc_host' and another SCSI pool is defined with adapter type as
> 'scsi_host'
> 
> This happens because for fc_host 'name' is optional attribute whereas for
> scsi_host its mandatory. However the check in libvirt for finding duplicate
> storage pools doesn't take that into account while comparing, resulting into
> libvirt crashing
> 
> This patch fixes the issue. This patch is based on the suggestion from John
> Ferlan
> 
> Signed-off-by: Pradipta Kr. Banerjee <bpradip at in.ibm.com>
> ---
>  V2: Incorporate suggestions from John Ferlan
> 
>  src/conf/storage_conf.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 

I adjusted the commit message slightly and pushed.

Thanks -

John




More information about the libvir-list mailing list