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 635537

Summary: Disable lseek(2) for virtio ports
Product: Red Hat Enterprise Linux 6 Reporter: Amit Shah <amit.shah>
Component: kernelAssignee: Amit Shah <amit.shah>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 6.1CC: amit.shah, juzhang, llim, mjenner, tburke, virt-maint
Target Milestone: rc   
Target Release: 6.1   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: kernel-2.6.32-85.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-23 20:52:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 580954    

Description Amit Shah 2010-09-20 06:09:07 UTC
Description of problem:

virtio ports are not capable of being seeked, being char devices.  Disable the lseek(2) call.

After applying this patch, the lseek(2) call should return -ESPIPE.

Comment 3 RHEL Program Management 2010-10-05 01:51:24 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux maintenance release. Product Management has 
requested further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed 
products. This request is not yet committed for inclusion in an Update release.

Comment 5 Amit Shah 2010-10-13 05:30:58 UTC
To test:

W/o the patch, lseek in the guest should return a non-error code without having any effect on the chardev.

With this patch, lseek will return -ESPIPE.

Comment 6 Aristeu Rozanski 2010-12-13 15:14:38 UTC
Patch(es) available on kernel-2.6.32-89.el6

Comment 8 juzhang 2011-01-13 12:02:07 UTC
Reproduced on kernel-2.6.32-83.el6 using amit test-virtserial.git.

Step
1.get code form http://fedorapeople.org/gitweb?p=amitshah/public_git/test-virtserial.git;a=summary
  #git://fedorapeople.org/home/fedora/amitshah/public_git/test-virtserial.git
2.slightly modify
3./run-test.sh
file=/home/rhel6.0_64.qcow2,if=none,id=test,boot=on,cache=none,format=qcow2,werror=stop,rerror=stop -device virtio-blk-pci,drive=test -chardev socket,path=/tmp/amit/test0,server,nowait,id=test0 -chardev socket,path=/tmp/amit/test1,server,nowait,id=test1 -chardev socket,path=/tmp/amit/test2,server,nowait,id=test2 -chardev socket,path=/tmp/amit/test3,server,nowait,id=test3 -chardev socket,path=/tmp/amit/test4,server,nowait,id=test4 -device virtio-serial -device virtconsole,chardev=test0,name=console.0 -device virtserialport,chardev=test1,name=test1 -device virtserialport,chardev=test2,name=test2 -device virtserialport,chardev=test3,name=test3 -device virtserialport,chardev=test4,name=test4 -vnc :1 -net none -enable-kvm -m 1G -serial file:/tmp/amit/test-serial.log -monitor unix:/tmp/amit/test-monitor,server,nowait -snapshot -smp 2
Guest is up 1
          test_open_close -  enabled (      open): PASS
          test_open_close -  enabled (     close): PASS
       test_multiple_open -  enabled (  multiple): PASS
      test_sysfs_and_udev -  enabled (      udev): PASS
   test_read_without_host -  enabled (      read): PASS
       test_blocking_read -  enabled (      read): PASS
    test_nonblocking_read -  enabled (      read): PASS
                test_poll -  enabled (   POLLHUP): PASS
                test_poll -  enabled (   POLLOUT): PASS
                test_poll -  enabled (    POLLIN): PASS
                test_lseek -  enabled (     lseek): FAIL  (Expected result: = -29, received result: 20)

Verified on kernel-2.6.32-95.el6 using the same steps
#./run-test.sh
/usr/libexec/qemu-kvm -drive file=/home/rhel6.0_64.qcow2,if=none,id=test,boot=on,cache=none,format=qcow2,werror=stop,rerror=stop -device virtio-blk-pci,drive=test -chardev socket,path=/tmp/amit/test0,server,nowait,id=test0 -chardev socket,path=/tmp/amit/test1,server,nowait,id=test1 -chardev socket,path=/tmp/amit/test2,server,nowait,id=test2 -chardev socket,path=/tmp/amit/test3,server,nowait,id=test3 -chardev socket,path=/tmp/amit/test4,server,nowait,id=test4 -device virtio-serial -device virtconsole,chardev=test0,name=console.0 -device virtserialport,chardev=test1,name=test1 -device virtserialport,chardev=test2,name=test2 -device virtserialport,chardev=test3,name=test3 -device virtserialport,chardev=test4,name=test4 -vnc :1 -net none -enable-kvm -m 1G -serial file:/tmp/amit/test-serial.log -monitor unix:/tmp/amit/test-monitor,server,nowait -snapshot -smp 2
Guest is up 1
          test_open_close -  enabled (      open): PASS
          test_open_close -  enabled (     close): PASS
       test_multiple_open -  enabled (  multiple): PASS
      test_sysfs_and_udev -  enabled (      udev): PASS
   test_read_without_host -  enabled (      read): PASS
       test_blocking_read -  enabled (      read): PASS
    test_nonblocking_read -  enabled (      read): PASS
                test_poll -  enabled (   POLLHUP): PASS
                test_poll -  enabled (   POLLOUT): PASS
                test_poll -  enabled (    POLLIN): PASS
               test_lseek -  enabled (     lseek): PASS

Please note,test_lseek is pass,that's means no means return in -ESPIPE.

Comment 10 juzhang 2011-01-18 02:50:05 UTC
According to comment8,set this issue status as verified.

Comment 11 errata-xmlrpc 2011-05-23 20:52:51 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0542.html