Bug 1518482
Summary: | "share-rw" property is unavailable on scsi passthrough devices | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Dan Zheng <dzheng> |
Component: | qemu-kvm-rhev | Assignee: | Fam Zheng <famz> |
Status: | CLOSED ERRATA | QA Contact: | Xueqiang Wei <xuwei> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 7.5 | CC: | chayang, coli, famz, gsun, haizhao, hhan, jiyan, junli, juzhang, knoel, lmen, lmiksik, meili, michen, mrezanin, mtessun, qzhang, virt-maint, xuzhang, yafu, yhong, yisun |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | qemu-kvm-rhev-2.10.0-18.el7 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2018-04-11 00:49:36 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Dan Zheng
2017-11-29 03:48:48 UTC
Working on upstream to add the property, sent patch: [PATCH] scsi-block: Add share-rw option Hi Fam, "share-rw" property is also unavailable on scsi-generic (qemu) qemu-kvm: -device scsi-generic,bus=bus1.0,drive=scsi-disk1,id=disk1,share-rw=off: Property '.share-rw' not found Good catch, for that I posted: https://lists.gnu.org/archive/html/qemu-devel/2017-12/msg00695.html [Qemu-devel] [PATCH] scsi-generic: Add share-rw option Hi, Fam, I found an issue thst scsi hostdev can use same source device with virtual disk at the same time, could you please help check whether it is expected? Thanks in advance. Version: libvirt-3.9.0-8.el7.x86_64 qemu-kvm-rhev-2.10.0-17.el7.x86_64 kernel-3.10.0-830.el7.x86_64 Preparation: # virsh nodedev-list --tree |grep "scsi_host7" -A7 +- scsi_host7 | +- scsi_target7_0_0 | +- scsi_7_0_0_0 | +- block_sdb_360014052187b9f501b64797aa12ccc1a +- scsi_generic_sg1 # lsscsi [7:0:0:0] disk LIO-ORG lun1 4.0 /dev/sdb Test scenario: Scenario-1: virtual disk can not be shared # virsh start test ; virsh domstate test Domain test started running # virsh dumpxml test |grep "<disk" -A7 <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/var/lib/libvirt/images/RHEL-7.5-x86_64-latest.qcow2'/> <backingStore/> <target dev='vda' bus='virtio'/> <alias name='virtio-disk0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/> </disk> # cat disk1.xml <disk type='block' device='disk'> <driver name='qemu' type='qcow2'/> <source dev='/dev/sdb'/> <backingStore/> <target dev='vdb' bus='virtio'/> </disk> # cat disk2.xml <disk type='block' device='disk'> <driver name='qemu' type='qcow2'/> <source dev='/dev/sdb'/> <backingStore/> <target dev='vdc' bus='virtio'/> </disk> # virsh attach-device test disk1.xml Device attached successfully # virsh attach-device test disk2.xml <== Bug 1526313 here error: Failed to attach device from disk2.xml error: internal error: unable to execute QEMU command '__com.redhat_drive_add': Device 'drive-virtio-disk2' could not be initialized Scenario-2: scsi hostdev can not be shared # virsh start test ; virsh domstate test Domain test started running # cat hostdev.xml <hostdev mode='subsystem' type='scsi' sgio='filtered' rawio='yes'> <source> <adapter name='scsi_host7'/> <address bus='0' target='0' unit='0'/> </source> </hostdev> # virsh attach-device test hostdev.xml Device attached successfully # virsh attach-device test hostdev.xml error: Failed to attach device from hostdev.xml error: Requested operation is not valid: SCSI device 7:0:0:0 is already in use by other domain(s) as 'non-shareable' Scenario-3: scsi hostdev whith shareable can be shared # virsh start test ; virsh domstate test Domain test started running # cat hostdev.xml <hostdev mode='subsystem' type='scsi' sgio='filtered' rawio='yes'> <source> <adapter name='scsi_host7'/> <address bus='0' target='0' unit='0'/> </source> <shareable/> </hostdev> # virsh attach-device test hostdev.xml Device attached successfully # virsh attach-device test hostdev.xml Device attached successfully # virsh dumpxml test |grep "<hostdev" -A8 <hostdev mode='subsystem' type='scsi' managed='no' sgio='filtered' rawio='yes'> <source> <adapter name='scsi_host7'/> <address bus='0' target='0' unit='0'/> </source> <shareable/> <alias name='hostdev0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </hostdev> <hostdev mode='subsystem' type='scsi' managed='no' sgio='filtered' rawio='yes'> <source> <adapter name='scsi_host7'/> <address bus='0' target='0' unit='0'/> </source> <shareable/> <alias name='hostdev1'/> <address type='drive' controller='0' bus='0' target='0' unit='1'/> </hostdev> Scenairo-4: Scsi hostdev can use same source device with virtual disk at the same time can be shared # virsh start test;virsh domstate test Domain test started running # cat disk1.xml <disk type='block' device='disk'> <driver name='qemu' type='qcow2'/> <source dev='/dev/sdb'/> <backingStore/> <target dev='vdb' bus='virtio'/> </disk> # cat hostdev.xml <hostdev mode='subsystem' type='scsi' sgio='filtered' rawio='yes'> <source> <adapter name='scsi_host7'/> <address bus='0' target='0' unit='0'/> </source> </hostdev> # virsh attach-device test disk1.xml Device attached successfully # virsh attach-device test hostdev.xml Device attached successfully # virsh dumpxml test |grep "<disk" -A7 <disk type='block' device='disk'> <driver name='qemu' type='qcow2'/> <source dev='/dev/sdb'/> <backingStore/> <target dev='vdb' bus='virtio'/> <alias name='virtio-disk1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/> </disk> # virsh dumpxml test |grep "<hostdev" -A7 <hostdev mode='subsystem' type='scsi' managed='no' sgio='filtered' rawio='yes'> <source> <adapter name='scsi_host7'/> <address bus='0' target='0' unit='0'/> </source> <alias name='hostdev0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </hostdev> It's very hard to understand the snippets you pasted, could you explain the problem? Hi, Fam, Sry for the that. I am trying to check this issue shows in Scenario-4, hostdev with scsi_host7 as source, virtual disk with dev/sdb as source, while in the info returned by 'virsh nodedev-list --tree' command, those two source means same. So I want to check whether the result in Scenario-4 is expected. The scsi_host7 goes through /dev/sgX, so it uses a different lock from /dev/sdb. You are right they are essentially the same device so it is a "shared" case, but it's hard to detect this from QEMU. I wonder if virtlockd can handle this as well. Fix included in qemu-kvm-rhev-2.10.0-18.el7 Tested on qemu-kvm-rhev-2.10.0-18.el7, the results are all passed. Details: Host: kernel-3.10.0-836.el7.x86_64 qemu-kvm-rhev-2.10.0-18.el7 Guest: kernel-3.10.0-830.el7.x86_64 (1) scsi-block, share-rw=off -drive file=/dev/sdb,if=none,format=raw,snapshot=off,aio=threads,cache=writethrough,id=scsi-disk1 \ -device virtio-scsi-pci,id=bus1,bus=pci.0 \ -device scsi-block,bus=bus1.0,drive=scsi-disk1,id=disk1,share-rw=off \ -drive file=/dev/sdb,if=none,format=raw,snapshot=off,aio=threads,cache=writethrough,id=scsi-disk2 \ -device virtio-scsi-pci,id=bus2,bus=pci.0 \ -device scsi-block,bus=bus2.0,drive=scsi-disk2,id=disk2,share-rw=off \ # sh share-rw-block.sh QEMU 2.10.0 monitor - type 'help' for more information (qemu) qemu-kvm: -device scsi-block,bus=bus2.0,drive=scsi-disk2,id=disk2,share-rw=off: Failed to get "write" lock Is another process using the image? (2) scsi-block, share-rw=on -drive file=/dev/sdb,if=none,format=raw,snapshot=off,aio=threads,cache=writethrough,id=scsi-disk1 \ -device virtio-scsi-pci,id=bus1,bus=pci.0 \ -device scsi-block,bus=bus1.0,drive=scsi-disk1,id=disk1,share-rw=on \ -drive file=/dev/sdb,if=none,format=raw,snapshot=off,aio=threads,cache=writethrough,id=scsi-disk2 \ -device virtio-scsi-pci,id=bus2,bus=pci.0 \ -device scsi-block,bus=bus2.0,drive=scsi-disk2,id=disk2,share-rw=on \ # sh share-rw-block.sh QEMU 2.10.0 monitor - type 'help' for more information (qemu) (3) scsi-generic, share-rw=off -drive file=/dev/sg3,if=none,format=raw,snapshot=off,aio=threads,cache=writethrough,id=scsi-disk1 \ -device virtio-scsi-pci,id=bus1,bus=pci.0 \ -device scsi-generic,bus=bus1.0,drive=scsi-disk1,id=disk1,share-rw=off \ -drive file=/dev/sg3,if=none,format=raw,snapshot=off,aio=threads,cache=writethrough,id=scsi-disk2 \ -device virtio-scsi-pci,id=bus2,bus=pci.0 \ -device scsi-generic,bus=bus2.0,drive=scsi-disk2,id=disk2,share-rw=off \ # sh share-rw-generic.sh QEMU 2.10.0 monitor - type 'help' for more information (qemu) qemu-kvm: -device scsi-generic,bus=bus2.0,drive=scsi-disk2,id=disk2,share-rw=off: Failed to get "write" lock Is another process using the image? (4) scsi-generic, share-rw=on -drive file=/dev/sg3,if=none,format=raw,snapshot=off,aio=threads,cache=writethrough,id=scsi-disk1 \ -device virtio-scsi-pci,id=bus1,bus=pci.0 \ -device scsi-generic,bus=bus1.0,drive=scsi-disk1,id=disk1,share-rw=on \ -drive file=/dev/sg3,if=none,format=raw,snapshot=off,aio=threads,cache=writethrough,id=scsi-disk2 \ -device virtio-scsi-pci,id=bus2,bus=pci.0 \ -device scsi-generic,bus=bus2.0,drive=scsi-disk2,id=disk2,share-rw=on \ # sh share-rw-generic.sh QEMU 2.10.0 monitor - type 'help' for more information (qemu) So verify this bug. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2018:1104 |