• J
    storage: Don't use a stack copy of the adapter · 5b226fcd
    John Ferlan 提交于
    https://bugzilla.redhat.com/show_bug.cgi?id=1160926
    
    Passing a copy of the storage pool adapter to a function just changes the
    copy of the fields in the particular function and then when returning to
    the caller those changes are discarded.  While not yet biting us in the
    storage clean-up case, it did cause an issue for the fchost storage pool
    startup case, createVport.  The issue was at startup, if no parent is found
    in the XML, the code will search for the 'best available' parent and then
    store that in the in memory copy of the adapter.  Of course, in this case
    it was a copy, so when returning to the virStorageBackendSCSIStartPool that
    change was discarded (or lost) from the pool->def->source.adapter which
    meant at shutdown (deleteVport), the code assumed no adapter was passed
    and skipped the deletion, leaving the vHBA created by libvirt still defined
    requiring an additional stop of a nodedev-destroy to remove.
    
    Adjusted the createVport to take virStoragePoolDefPtr instead of the
    adapter copy. Then use the virStoragePoolSourceAdapterPtr when processing.
    A future patch will need the 'def' anyway, so this just sets up for that.
    5b226fcd
storage_backend_scsi.c 23.0 KB