Bug 593237

Summary: start domain failed with readonly floppy.
Product: Red Hat Enterprise Linux 6 Reporter: dyuan
Component: libvirtAssignee: Daniel Veillard <veillard>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: berrange, hbrock, llim, nzhang, tyan, xen-maint, yoyzhang
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.8.1-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-07-02 19:33:48 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: 593256    
Bug Blocks:    

Description dyuan 2010-05-18 09:29:57 UTC
Description of problem:
When I add a floppy into guest with readonly flag, domain will be started failed with error: 
internal error Process exited while reading console log output: char device redirected to /dev/pts/1
qemu: readonly flag not supported for drive with this interface

remove the floppy or no readonly flag, domain can be started successfully.


Version-Release number of selected component (if applicable):
libvirt-0.8.1-4.el6.x86_64
kernel-2.6.32-26.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. prepare a guest , which is shutoff
# virsh list --all
 Id Name                 State
----------------------------------
  - demo                 shut off

2. insert following xml into the "<device>" node of xml
# virsh edit demo.xml

    <disk type='file' device='floppy'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/fd.img'/>
      <target dev='fda' bus='fdc'/>
      <readonly/>
    </disk>

3. create fd.img
# dd if=/dev/zero of=/var/lib/libvirt/images/fd.img bs=1024 count=10240


4. format the floppy disk in ext3 format.
# mkfs.ext3 /var/lib/libvirt/images/fd.img

5. start the guest
# virsh start demo
  
Actual results:
# virsh start demo
error: Failed to start domain rhel5u4_x86_64
error: internal error Process exited while reading console log output: char device redirected to /dev/pts/1
qemu: readonly flag not supported for drive with this interface

Expected results:
# virsh start demo
Domain demo started

Additional info:

# tail -f /var/log/messages
May 18 17:12:13 dhcp-66-70-43 kernel: device vnet0 entered promiscuous mode
May 18 17:12:13 dhcp-66-70-43 kernel: virbr0: topology change detected, propagating
May 18 17:12:13 dhcp-66-70-43 kernel: virbr0: port 1(vnet0) entering forwarding state
May 18 17:12:13 dhcp-66-70-43 NetworkManager[1583]: <warn> /sys/devices/virtual/net/vnet0: couldn't determine device driver; ignoring...
May 18 17:12:13 dhcp-66-70-43 kernel: virbr0: port 1(vnet0) entering disabled state
May 18 17:12:13 dhcp-66-70-43 kernel: device vnet0 left promiscuous mode
May 18 17:12:13 dhcp-66-70-43 kernel: virbr0: port 1(vnet0) entering disabled state
May 18 17:12:13 dhcp-66-70-43 libvirtd: 17:12:13.318: error : qemudReadLogOutput:2250 : internal error Process exited while reading console log output: char device redirected to /dev/pts/1#012qemu: readonly flag not supported for drive with this interface#012
May 18 17:12:13 dhcp-66-70-43 libvirtd: 17:12:13.386: error : SELinuxRestoreSecurityFileLabel:378 : internal error cannot restore selinux file label for /mnt/vol/rhel6_i386.img

Comment 1 Daniel Berrangé 2010-05-18 09:39:03 UTC
Please provide the QEMU command line for this guest from /var/log/libvirt/qemu/$GUEST.log

Comment 3 dyuan 2010-05-18 09:46:15 UTC
# tail -f /var/log/messages
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin QEMU_AUDIO_DRV=none /usr/libexec/qemu-kvm -S -M rhel6.0.0 -enable-kvm -m 512 -smp 1,sockets=1,cores=1,threads=1 -name demo -uuid 0e43537d-1ef5-9166-bc29-c95aa41fb85b -nodefaults -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/demo.monitor,server,nowait -mon chardev=monitor,mode=control -rtc base=utc -boot c -drive file=/mnt/vol/rhel6_i386.img,if=none,id=drive-ide0-0-0,boot=on -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -drive file=/var/lib/libvirt/images/fd.img,if=none,id=drive-fdc0-0-0,readonly=on,format=raw -global isa-fdc.driveA=drive-fdc0-0-0 -netdev tap,fd=20,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:76:13:2d,bus=pci.0,addr=0x4 -chardev pty,id=serial0 -device isa-serial,chardev=serial0 -usb -vnc 127.0.0.1:1 -k en-us -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 
char device redirected to /dev/pts/4
qemu: readonly flag not supported for drive with this interface

Comment 4 dyuan 2010-05-18 09:47:36 UTC
# tail -f /var/log/messages
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin QEMU_AUDIO_DRV=none /usr/libexec/qemu-kvm -S -M rhel6.0.0 -enable-kvm -m 512 -smp 1,sockets=1,cores=1,threads=1 -name demo -uuid 0e43537d-1ef5-9166-bc29-c95aa41fb85b -nodefaults -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/demo.monitor,server,nowait -mon chardev=monitor,mode=control -rtc base=utc -boot c -drive file=/mnt/vol/rhel6_i386.img,if=none,id=drive-ide0-0-0,boot=on -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -drive file=/var/lib/libvirt/images/fd.img,if=none,id=drive-fdc0-0-0,readonly=on,format=raw -global isa-fdc.driveA=drive-fdc0-0-0 -netdev tap,fd=20,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:76:13:2d,bus=pci.0,addr=0x4 -chardev pty,id=serial0 -device isa-serial,chardev=serial0 -usb -vnc 127.0.0.1:1 -k en-us -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 
char device redirected to /dev/pts/4
qemu: readonly flag not supported for drive with this interface

Comment 5 Daniel Berrangé 2010-05-18 10:36:50 UTC
This is a KVM bug 593256

Comment 6 RHEL Program Management 2010-06-07 16:00:06 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 7 Daniel Berrangé 2010-06-08 14:03:07 UTC
The fix is in qemu-kvm-0.12.1.2-2.71.el6

You should be able to verify this from libvirt now

Comment 9 releng-rhel@redhat.com 2010-07-02 19:33:48 UTC
Red Hat Enterprise Linux Beta 2 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.

Comment 10 Nan Zhang 2010-09-09 07:29:47 UTC
Verified with libvirt-0.8.1-27.el6.x86_64 & qemu-kvm-0.12.1.2-2.113.el6.x86_64.

# dd if=/dev/zero of=/var/lib/libvirt/images/fd.img bs=1M count=10
10+0 records in
10+0 records out
10485760 bytes (10 MB) copied, 0.0161993 s, 647 MB/s

# virsh edit rhel6
Domain rhel6 XML configuration edited.

# virsh start rhel6
Domain rhel6 started