virtio-scsi: use scsi_device_get
commit07a47d4a1879370009baab44f1f387610d88a299
authorMaxim Levitsky <mlevitsk@redhat.com>
Tue, 6 Oct 2020 12:39:03 +0000 (6 15:39 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 12 Oct 2020 15:50:51 +0000 (12 11:50 -0400)
tree3e27519818491a95858ca71950f042f4c0ada21b
parent8ff34495601067d02edb54b4346cace84ec4e1df
virtio-scsi: use scsi_device_get

This will help us to avoid the scsi device disappearing
after we took a reference to it.

It doesn't by itself forbid case when we try to access
an unrealized device

Suggested-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20200913160259.32145-9-mlevitsk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20201006123904.610658-13-mlevitsk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/scsi/virtio-scsi.c