Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1078122

Summary: ACPI with libiscsi will core dumped with qemu-kvm: Failed to sync10 data on iSCSI lun. RESERVATION CONFLICT
Product: Red Hat Enterprise Linux 7 Reporter: Sibiao Luo <sluo>
Component: qemu-kvmAssignee: Paolo Bonzini <pbonzini>
Status: CLOSED WONTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: medium    
Version: 7.0CC: chayang, hhuang, juzhang, knoel, michen, pbonzini, qzhang, rbalakri, virt-maint, xfu
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-01 20:32:59 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 Sibiao Luo 2014-03-19 08:15:58 UTC
Description of problem:
boot up a guest with a libiscsi then do S3, it will meet "qemu-kvm: Failed to sync10 data on iSCSI lun. RESERVATION CONFLICT", then do continue to resume the VM will trigger qemu core dumped.

Version-Release number of selected component (if applicable):
host info:
# uname -r && rpm -q qemu-kvm
3.10.0-113.el7.x86_64
qemu-kvm-1.5.3-53.el7.x86_64
guest info:
# uname -r
3.10.0-113.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.boot up a guest with a libiscsi.
e.g:-drive file=iscsi://10.66.90.100:3260/iqn.2001-05.com.equallogic:0-8a0906-4fb1f7d03-455f49b421252a57-s2-sluo-270305-2/0,if=none,id=drive-data-disk,cache=none,format=raw,aio=native,werror=stop,rerror=stop -iscsi id=iqn1 -device virtio-scsi-pci,id=scsi1,bus=pci.0,addr=0x7 -device scsi-hd,drive=drive-data-disk,bus=scsi1.0,id=libiscsi-data-disk
2.do ACPI in guest.
e.g.# echo mem > /sys/power/state

Actual results:
after step 2, it will meet "qemu-kvm: Failed to sync10 data on iSCSI lun. RESERVATION CONFLICT", then do continue to resume the VM will trigger qemu core dumped.
(qemu) qemu-kvm: Failed to sync10 data on iSCSI lun. RESERVATION CONFLICT
block I/O error in device 'drive-data-disk': Input/output error (5)
qemu-kvm: Failed to sync10 data on iSCSI lun. RESERVATION CONFLICT

(qemu) info status 
VM status: paused (io-error)
(qemu) cont
(qemu) qemu-kvm: hw/scsi/scsi-bus.c:104: scsi_dma_restart_bh: Assertion `!req->sg' failed.
Aborted (core dumped)

Expected results:
it should resume from ACPI correctly without any core dumped.

Additional info:
# /usr/libexec/qemu-kvm -M pc -cpu SandyBridge -enable-kvm -m 2048 -smp 4,sockets=2,cores=2,threads=1 -no-kvm-pit-reinjection -usb -device usb-tablet,id=input0 -device usb-mouse,id=mouse -name sluo-test -uuid 350e716b-5f98-4bf0-9a2a-c8e423295244 -rtc base=localtime,clock=host,driftfix=slew -drive file=/home/rhel7base.raw,if=none,id=drive-system-disk,format=raw,cache=none,aio=native,werror=stop,rerror=stop -device virtio-scsi-pci,id=scsi0,addr=0x4 -device scsi-hd,bus=scsi0.0,drive=drive-system-disk,id=system-disk,ver=abcdefgh,bootindex=1 -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -k en-us -boot menu=on -qmp tcp:0:4444,server,nowait -serial unix:/tmp/ttyS0,server,nowait -spice disable-ticketing,port=5931 -vga qxl -monitor stdio -drive file=iscsi://10.66.90.100:3260/iqn.2001-05.com.equallogic:0-8a0906-4fb1f7d03-455f49b421252a57-s2-sluo-270305-2/0,if=none,id=drive-data-disk,cache=none,format=raw,aio=native,werror=stop,rerror=stop -iscsi id=iqn1 -device virtio-scsi-pci,id=scsi1,bus=pci.0,addr=0x7 -device scsi-hd,drive=drive-data-disk,bus=scsi1.0,id=libiscsi-data-disk

Comment 1 Sibiao Luo 2014-03-19 08:16:28 UTC
Core was generated by `/usr/libexec/qemu-kvm -M pc -S -cpu SandyBridge -enable-kvm -m 2048 -smp 4,sock'.
Program terminated with signal 6, Aborted.
#0  0x00007f3eab9b6989 in raise () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install qemu-kvm-1.5.3-53.el7.x86_64
(gdb) bt
#0  0x00007f3eab9b6989 in raise () from /lib64/libc.so.6
#1  0x00007f3eab9b8098 in abort () from /lib64/libc.so.6
#2  0x00007f3eab9af8f6 in __assert_fail_base () from /lib64/libc.so.6
#3  0x00007f3eab9af9a2 in __assert_fail () from /lib64/libc.so.6
#4  0x00007f3eb0e7746a in scsi_dma_restart_bh ()
#5  0x00007f3eb0dcf437 in aio_bh_poll ()
#6  0x00007f3eb0dcf088 in aio_poll ()
#7  0x00007f3eb0dcf340 in aio_ctx_dispatch ()
#8  0x00007f3eb020bac6 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#9  0x00007f3eb0ea466a in main_loop_wait ()
#10 0x00007f3eb0dcadb0 in main ()
(gdb) bt full
#0  0x00007f3eab9b6989 in raise () from /lib64/libc.so.6
No symbol table info available.
#1  0x00007f3eab9b8098 in abort () from /lib64/libc.so.6
No symbol table info available.
#2  0x00007f3eab9af8f6 in __assert_fail_base () from /lib64/libc.so.6
No symbol table info available.
#3  0x00007f3eab9af9a2 in __assert_fail () from /lib64/libc.so.6
No symbol table info available.
#4  0x00007f3eb0e7746a in scsi_dma_restart_bh ()
No symbol table info available.
#5  0x00007f3eb0dcf437 in aio_bh_poll ()
No symbol table info available.
#6  0x00007f3eb0dcf088 in aio_poll ()
No symbol table info available.
#7  0x00007f3eb0dcf340 in aio_ctx_dispatch ()
No symbol table info available.
#8  0x00007f3eb020bac6 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
No symbol table info available.
#9  0x00007f3eb0ea466a in main_loop_wait ()
No symbol table info available.
#10 0x00007f3eb0dcadb0 in main ()
No symbol table info available.
(gdb)

Comment 2 Sibiao Luo 2014-03-19 08:18:34 UTC
(In reply to Sibiao Luo from comment #0)
> Version-Release number of selected component (if applicable):
> host info:
> # uname -r && rpm -q qemu-kvm
> 3.10.0-113.el7.x86_64
My host libiscsi version.
libiscsi-1.9.0-6.el7.x86_64
> qemu-kvm-1.5.3-53.el7.x86_64
> guest info:
> # uname -r
> 3.10.0-113.el7.x86_64
>

Comment 4 Paolo Bonzini 2014-03-19 13:00:01 UTC
What are you doing to cause the reservation conflict?

Comment 5 Sibiao Luo 2014-03-20 03:39:05 UTC
(In reply to Paolo Bonzini from comment #4)
> What are you doing to cause the reservation conflict?

Hmm, thanks for your kindly reminds which i did persistent Reservation test with libiscsi disk first.

Reproduce Steps:
1.boot a guest with a libiscsi disk pass-through(scsi-block) to guest.
e.g:# /usr/libexec/qemu-kvm -M pc -cpu SandyBridge -enable-kvm -m 2048 -smp 4,sockets=2,cores=2,threads=1...-global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0...-drive file=iscsi://10.66.90.100:3260/iqn.2001-05.com.equallogic:0-8a0906-4fb1f7d03-455f49b421252a57-s2-sluo-270305-2/0,if=none,id=drive-data-disk2,cache=none,format=raw,aio=native,werror=stop,rerror=stop -iscsi id=iqn2 -device virtio-scsi-pci,id=scsi2,bus=pci.0,addr=0x7 -device scsi-hd,drive=drive-data-disk2,bus=scsi2.0,id=libiscsi-data-disk2

2.Make the persistent reservation to the libiscsi disk in the guest, and check that the sg_persist -r output.
guest ]# sg_persist -r /dev/sdb
sg_persist -r /dev/sdb
  EQLOGIC   100E-00           5.0 
  Peripheral device type: disk
  PR generation=0x8, there is NO reservation held

guest ]# sg_persist --out --register --param-sark=123abc /dev/sdb
bg_persist --out --register --param-sark=123abc /dev/sd 
  EQLOGIC   100E-00           5.0 
  Peripheral device type: disk
guest ]# sg_persist --out --reserve --param-rk=123abc  --prout-type=1 /dev/sdb
ype=1 /dev/sdbut --reserve --param-rk=123abc  --prout-t 
  EQLOGIC   100E-00           5.0 
  Peripheral device type: disk
guest ]# sg_persist -r /dev/sdb
sg_persist -r /dev/sdb
  EQLOGIC   100E-00           5.0 
  Peripheral device type: disk
  PR generation=0x9, Reservation follows:
    Key=0x123abc
    scope: LU_SCOPE,  type: Write Exclusive

3.do ACPI(e.g:S3) in guest.
e.g.# echo mem > /sys/power/state

4.resume VM via press keyboard.

5.shutdown the guest and re-start it again with the libscsi disk assigned(scsi-hd).
e.g:# /usr/libexec/qemu-kvm -M pc -cpu SandyBridge -enable-kvm -m 2048 -smp 4,sockets=2,cores=2,threads=1....-drive file=iscsi://10.66.90.100:3260/iqn.2001-05.com.equallogic:0-8a0906-4fb1f7d03-455f49b421252a57-s2-sluo-270305-2/0,if=none,id=drive-data-disk2,cache=none,format=raw,aio=native,werror=stop,rerror=stop -iscsi id=iqn2 -device virtio-scsi-pci,id=scsi2,bus=pci.0,addr=0x7 -device scsi-hd,drive=drive-data-disk2,bus=scsi2.0,id=libiscsi-data-disk2

6.do ACPI(S3) in the guest.
e.g.# echo mem > /sys/power/state

Results:
after step 4, resume VM successfully without any problem.
after step 6, it will meet "qemu-kvm: Failed to sync10 data on iSCSI lun. RESERVATION CONFLICT", then do continue to resume the VM will trigger qemu core dumped.
(qemu) qemu-kvm: Failed to sync10 data on iSCSI lun. RESERVATION CONFLICT
block I/O error in device 'drive-data-disk2': Input/output error (5)
qemu-kvm: Failed to sync10 data on iSCSI lun. RESERVATION CONFLICT

(qemu) info status 
VM status: paused (io-error)
(qemu) cont
(qemu) qemu-kvm: hw/scsi/scsi-bus.c:104: scsi_dma_restart_bh: Assertion `!req->sg' failed.
Aborted (core dumped)

Core was generated by `/usr/libexec/qemu-kvm -M pc -cpu SandyBridge -enable-kvm -m 2048 -smp 4,sockets'.
Program terminated with signal 6, Aborted.
#0  0x00007f353ed42989 in raise () from /lib64/libc.so.6

(gdb) bt
#0  0x00007f353ed42989 in raise () from /lib64/libc.so.6
#1  0x00007f353ed44098 in abort () from /lib64/libc.so.6
#2  0x00007f353ed3b8f6 in __assert_fail_base () from /lib64/libc.so.6
#3  0x00007f353ed3b9a2 in __assert_fail () from /lib64/libc.so.6
#4  0x00007f3544202c8a in scsi_dma_restart_bh (opaque=<optimized out>) at hw/scsi/scsi-bus.c:104
#5  0x00007f354415ae47 in aio_bh_poll (ctx=ctx@entry=0x7f3545234e20) at async.c:81
#6  0x00007f354415aa98 in aio_poll (ctx=0x7f3545234e20, blocking=blocking@entry=false) at aio-posix.c:185
#7  0x00007f354415ad50 in aio_ctx_dispatch (source=<optimized out>, callback=<optimized out>, user_data=<optimized out>)
    at async.c:194
#8  0x00007f3543597ac6 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#9  0x00007f354422fe8a in glib_pollfds_poll () at main-loop.c:187
#10 os_host_main_loop_wait (timeout=<optimized out>) at main-loop.c:232
#11 main_loop_wait (nonblocking=<optimized out>) at main-loop.c:464
#12 0x00007f35441567c0 in main_loop () at vl.c:1988
#13 main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at vl.c:4357
(gdb)

Comment 6 Paolo Bonzini 2014-04-02 13:06:13 UTC
The assert is bogus.  Thanks for the bug report!

It will be fixed by upstream commit d581eb7ca4b58649ade5fb7570ecf6b4b9a41879 (for now it is in scsi-next).