On 4/16/2013 2:29 PM, Nicholas A. Bellinger wrote:
On Tue, 2013-04-16 at 10:41 -0700, Badari Pulavarty wrote:
Hi,
I would like to test tcm_vhost to verify how SCSI PR works and some of
the passthru commands for our tape device.
Hi Badari,
Just FYI, last time I checked with pSCSI + tcm_vhost there was an issue
triggering abort timeouts with virtio-scsi..
I've not gotten a chance to track this down yet, but is still on my
TODO list..
I got the kernel compiled and working. I see tcm_vhost module and
/dev/vhost-scsi entry.
Now, I am trying to use qemu from
git://git.kernel.org/pub/scm/virt/kvm/nab/qemu-kvm.git
branch vhost-scsi-for-1.4
Here is what I am using for qemu command line.
$QEMU -smp 4 -cpu qemu64 --enable-kvm -m 4096 -drive
file=/var/lib/libvirt/images/myvm.img,if=ide,cache=writethrough -drive
if=none,id=test,file=/dev/sda1 -device
vhost-scsi-pci,id=test,wwpn=naa.6001405bd4e8476d,event_idx=off -vnc :10
-boot d
Using the following opts should be sufficient:
-device vhost-scsi-pci,wwpn=naa.6001405bd4e8476d
However, I quickly run into seg-fault:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff151c700 (LWP 14332)]
0x0000555555691330 in scsi_device_find (bus=0x5555565baf98, channel=0,
id=0, lun=0) at hw/scsi-bus.c:1739
1739 QTAILQ_FOREACH_REVERSE(kid, &bus->qbus.children, ChildrenHead, sibling) {
<SNIP>
(gdb) bt
#0 0x0000555555691330 in scsi_device_find (bus=0x5555565baf98,
channel=0, id=0, lun=0) at hw/scsi-bus.c:1739
#1 0x0000555555788e50 in virtio_scsi_device_find (vdev=0x5555565bae40, vq=0x5555565c6520)
at /root/qemu-kvm/hw/virtio-scsi.c:55
#2 virtio_scsi_handle_cmd (vdev=0x5555565bae40, vq=0x5555565c6520) at /root/qemu-kvm/hw/virtio-scsi.c:369
#3 0x0000555555792530 in access_with_adjusted_size (addr=16, value=0x7ffff151bb88, size=2,
access_size_min=<value optimized out>, access_size_max=<value optimized out>, access=
0x555555793ca0 <memory_region_write_accessor>, opaque=0x5555565bf1d8) at /root/qemu-kvm/memory.c:364
#4 0x0000555555792b5b in memory_region_iorange_write (iorange=<value optimized out>, offset=<value optimized out>,
width=<value optimized out>, data=2) at /root/qemu-kvm/memory.c:439
#5 0x0000555555791ac5 in kvm_handle_io (env=0x5555564d6b50) at /root/qemu-kvm/kvm-all.c:1427
#6 kvm_cpu_exec (env=0x5555564d6b50) at /root/qemu-kvm/kvm-all.c:1579
#7 0x0000555555742441 in qemu_kvm_cpu_thread_fn (arg=0x5555564d6b50) at /root/qemu-kvm/cpus.c:759
#8 0x00007ffff6059851 in start_thread () from /lib64/libpthread.so.0
#9 0x00007ffff5da790d in clone () from /lib64/libc.so.6
BTW - I did build new seabios as recommended.
What am I missing ?
Mmm, it appears from the above backtrace that your hitting the
QEMU SCSI path (virtio_scsi_handle_cmd), instead of the
vhost backend that never calls any of this logic..
Perhaps the extra 'id=test' option is triggering this..? (Paolo CC'ed)
Tried without "id=test" but no luck. looking at the stack, I see something
not quite set on vdev to switch over to vhost backend.
(gdb) frame 2
#2 virtio_scsi_handle_cmd (vdev=0x5555565a5520, vq=0x5555565cfa60)
at /root/qemu-kvm/hw/virtio-scsi.c:369
369 d = virtio_scsi_device_find(s, req->req.cmd->lun);
(gdb) print *vdev
$2 = {parent_obj = {parent_obj = {class = 0x0, free = 0, properties = {
tqh_first = 0x0, tqh_last = 0x0}, ref = 0, parent = 0x0}, id = 0x0,
realized = false, opts = 0x0, hotplugged = 0, parent_bus = 0x0,
num_gpio_out = 0, gpio_out = 0x0, num_gpio_in = 0, gpio_in = 0x0,
child_bus = {lh_first = 0x0}, num_child_bus = 0, instance_id_alias = 0,
alias_required_for_version = 0}, name = 0x555555892f2f "virtio-scsi",
status = 3 '\003', isr = 0 '\000', queue_sel = 2, guest_features = 0,
config_len = 36, config = 0x5555565c6540, config_vector = 65535,
nvectors =
4, get_features = 0x55555577f550 <vhost_scsi_get_features>,
bad_features =
0, set_features = 0, get_config = 0x555555788a90
<virtio_scsi_get_config>,
set_config = 0x55555577fbf0 <vhost_scsi_set_config>, reset = 0,
set_status =
0x55555577f890 <vhost_scsi_set_status>, guest_notifier_pending =
0x55555577f780 <vhost_scsi_guest_notifier_pending>,
guest_notifier_mask =
0x55555577f7c0 <vhost_scsi_guest_notifier_mask>, vq = 0x5555565cf9b0,
binding = 0x555555bd3320, binding_opaque = 0x5555565c3500, device_id = 8,
vm_running = true, vmstate = 0x5555565c9840}
(gdb) print *vq
$3 = {vring = {num = 128, desc = 974848, avail = 976896, used = 978944},
pa =
974848, last_avail_idx = 1, signalled_used = 0, signalled_used_valid =
false, notification = true, queue_index = 2, inuse = 1, vector = 65535,
handle_output = 0x555555788d40 <virtio_scsi_handle_cmd>, vdev =
0x5555565a5520, guest_notifier = {rfd = 0, wfd = 0}, host_notifier = {
rfd = 0, wfd = 0}}
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html