Bug 1426724

Summary: Cannot change CD from remote-viewer for RHEL74 guest.
Product: Red Hat Enterprise Linux 7 Reporter: Andrei Stepanov <astepano>
Component: udisks2Assignee: Vratislav Podzimek <vpodzime>
Status: CLOSED NOTABUG QA Contact: Desktop QE <desktop-qa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.4CC: astepano, bugs, oholy, rduda, rh-spice-bugs, spice-qe-bugs, tjelinek
Target Milestone: alpha   
Target Release: 7.4   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-03 13:15:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
log for engine
none
log for engine (VM name is "newrhel74")
none
RV log
none
RV log with REST_DEBUG=proxy
none
dmesg from guest none

Description Andrei Stepanov 2017-02-24 16:57:24 UTC
remote-viewer provides a menu option: "Change CD".
The problem is that a selected CD does not appear in VM.

Client:
virt-viewer-2.0-6.el7_2.2.x86_64
or
virt-viewer-2.0-13.el7.x86_64


Guest is:
RHEL-7.4-20170221.n.0-Workstation
I cannot reproduce this for current RHEL6.9.

oVirt:
ovirt-engine-4.1.1.2-0.1.el7.noarch


Host:
spice-server-0.12.8-1.el7.x86_64
qemu-kvm-rhev-2.6.0-28.el7_3.6.x86_64


How reproducible: always


Steps to Reproduce:
1. Connect with remote-viewer to running VM.
2. From remote-viewer "Change CD" menu active any CD ISO.

Actual results: CD is not going to appear in VM.

Comment 1 Andrei Stepanov 2017-02-24 17:08:21 UTC
Created attachment 1257373 [details]
log for engine

Comment 2 Andrei Stepanov 2017-02-24 17:14:52 UTC
Created attachment 1257387 [details]
log for engine (VM name is "newrhel74")

Comment 3 Andrei Stepanov 2017-02-24 17:17:51 UTC
Created attachment 1257388 [details]
RV log

Comment 4 Andrei Stepanov 2017-02-24 17:21:43 UTC
Created attachment 1257389 [details]
RV log with REST_DEBUG=proxy

Comment 5 Tomas Jelinek 2017-02-28 08:54:35 UTC
It looks it has nothing to do with the remote-viewer, all calls look like passed so I suspect something is wrong inside the guest. Could you please look inside of guest to dmesg?

Comment 6 Andrei Stepanov 2017-02-28 09:27:30 UTC
Created attachment 1258307 [details]
dmesg from guest

Comment 8 Tomas Jelinek 2017-02-28 11:00:29 UTC
After a bit of investigation:
- the change CD arrives to libvirt which changes the CD in the guest OS
- the guest OS has the CD available, but it is not mounted
- if mounted manually (like mount /dev/<something> /somewhere) than the /somewhere contains the content of the CD

so it seems only the mount of the CD automatically does not work in guest, all other seems OK.

Comment 9 Ondrej Holy 2017-02-28 11:32:54 UTC
The problem may be at several places, however, it shouldn't be in GnomeVFS. Let's tentatively change the component to GVfs, which is GnomeVFS replacement.

GnomeShell is responsible for automounting. GVfs is responsible for volume monitoring. The monitoring is based on GLib, UDisks2 and UDev. 

Can you please provide output from "gvfs-mount --monitor --detail" and "udisksctl --monitor" which will be written, when you change the CD?

Comment 10 Andrei Stepanov 2017-02-28 11:41:59 UTC
Both commands stay quiet.

Comment 11 Andrei Stepanov 2017-02-28 11:53:15 UTC
This is not Gnome bug. Gnome can't show anything if there isn't any event from udisks.


# udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[1770.464517] change   /devices/pci0000:00/0000:00:01.1/ata2/host1/target1:0:0/1:0:0:0/block/sr0 (block)
KERNEL[1770.504329] change   /devices/pci0000:00/0000:00:01.1/ata2/host1/target1:0:0/1:0:0:0/block/sr0 (block)
UDEV  [1770.522218] change   /devices/pci0000:00/0000:00:01.1/ata2/host1/target1:0:0/1:0:0:0/block/sr0 (block)
UDEV  [1770.538370] change   /devices/pci0000:00/0000:00:01.1/ata2/host1/target1:0:0/1:0:0:0/block/sr0 (block)

Comment 12 Andrei Stepanov 2017-02-28 12:01:30 UTC
# udisksctl info --block-device '/devices/pci0000:00/0000:00:01.1/ata2/host1/target1:0:0/1:0:0/block/sr0'
Error looking up object for device /devices/pci0000:00/0000:00:01.1/ata2/host1/target1:0:0/1:0:0:0/block/sr0

Comment 13 Andrei Stepanov 2017-02-28 12:59:16 UTC
Update:

# udisksctl info -b /dev/sr0
/org/freedesktop/UDisks2/block_devices/sr0:
  org.freedesktop.UDisks2.Block:
    Configuration:              []
    CryptoBackingDevice:        '/'
    Device:                     /dev/sr0
    DeviceNumber:               2816
    Drive:                      '/org/freedesktop/UDisks2/drives/QEMU_DVD_ROM_QM00003'
    HintAuto:                   true
    HintIconName:               
    HintIgnore:                 false
    HintName:                   
    HintPartitionable:          false
    HintSymbolicIconName:       
    HintSystem:                 false
    Id:                         
    IdLabel:                    
    IdType:                     
    IdUUID:                     
    IdUsage:                    
    IdVersion:                  
    MDRaid:                     '/'
    MDRaidMember:               '/'
    PreferredDevice:            /dev/sr0
    ReadOnly:                   true
    Size:                       0
    Symlinks:                   /dev/cdrom
                                /dev/disk/by-id/ata-QEMU_DVD-ROM_QM00003
                                /dev/disk/by-path/pci-0000:00:01.1-ata-2.0

Comment 15 Radek Duda 2017-03-02 14:19:24 UTC
I cannot reproduce it on guest rhel7.4-latest and the same versions as in #c0

Comment 16 Andrei Stepanov 2017-03-03 13:15:21 UTC
I found a cause: our kickstart file has next entry:

echo 'Disable lock cdrom udev rules.'
sed -i '/--lock-media/s/^/#/' '/usr/lib/udev/rules.d/60-cdrom_id.rules'

This was the cause of such behavior.