Bug 1145126

Summary: Allow to remove CD images through ovirt foreign menu
Product: Red Hat Enterprise Linux 7 Reporter: Christophe Fergeau <cfergeau>
Component: virt-viewerAssignee: Virt Viewer Maint <virt-viewer-maint>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.1CC: codong, dblechte, fidencio, jjongsma, juzhou, mzhan, rbalakri, tpelka, tzheng
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: virt-viewer-0.6.0-8.el7 Doc Type: Bug Fix
Doc Text:
Cause: We didn't know how to remove a CDRom from a VM through oVirt REST API Consequence: Users cannot remove CD images through oVirt foreign menu Fix: It turns out this is supposed to be done through update requests with a CD image with an empty name, which is what the current code tries to do, with a small change in libgovirt to allow empty filenames Result: Users can remove CD images through oVirt foreign menu
Story Points: ---
Clone Of:
: 1151171 (view as bug list) Environment:
Last Closed: 2015-03-05 13:39:50 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:
Bug Depends On: 1145121    
Bug Blocks: 1127156, 1151171    
Attachments:
Description Flags
Non-upstream patch (because it's untested) none

Description Christophe Fergeau 2014-09-22 12:32:58 UTC
Created attachment 939984 [details]
Non-upstream patch (because it's untested)

It's currently possible to change the current CD image through the oVirt foreign menu support, but it's not possible to remove it. The remote-viewer patch seems simple, but this is also buggy server-side, so I haven't been able to test this works as expected.
Opening this bug to track this, and attaching the needed patch there.

Comment 4 CongDong 2014-10-14 09:19:51 UTC
Test with virt-viewer-0.6.0-8.el7.x86_64

Steps:
1. Prepare a guset on rhevm, and a ISO domain to rhevm, add more than one cd images in the domain, and add user "admin" to virtual machine permissions
2. on client:
# wget http://rhevm.example.com/ca.crt
# remote-viewer --ovirt-ca-file=ca.crt ovirt://rhevm.example.com/$vm

3. Input right username and password to connect the guest
4. Click menu "Change CD", make sure the menu list the images, and choose one
5. Open the menu and choose the image to remove it.

Result:
virt-viewer core dumped.

(remote-viewer:31681): libgovirt-WARNING **: Passing a full http:// or https:// URI to ovirt_proxy_new() is deprecated

(remote-viewer:31681): libgovirt-WARNING **: Passing an URI ending in /api to ovirt_proxy_new() is deprecated

(remote-viewer:31681): libgovirt-WARNING **: could not find node storage_domain_state

(remote-viewer:31681): libgovirt-WARNING **: could not find node storage_domain_state

(remote-viewer:31681): libgovirt-WARNING **: could not find node storage_domain_state

(remote-viewer:31681): libgovirt-WARNING **: could not find node storage_domain_state

(remote-viewer:31681): libgovirt-CRITICAL **: ovirt_cdrom_to_xml: assertion `cdrom->priv->file != NULL' failed
Segmentation fault (core dumped)


As the result, set ASSIGNED it.

Comment 5 Christophe Fergeau 2014-10-14 10:16:44 UTC
You need libgovirt-0.3.1-3.el7 in order to test this.
I'd be interested in a backtrace of the crash though.

Comment 6 CongDong 2014-10-15 07:43:01 UTC
(In reply to Christophe Fergeau from comment #5)
> You need libgovirt-0.3.1-3.el7 in order to test this.
> I'd be interested in a backtrace of the crash though.

Thanks for reminding.

Re test with libgovirt-0.3.1-3.el7.x86_64

When I choose the same image again, virt-viewer won't crash.
But the image is not removed from the guest.

Comment 7 CongDong 2014-10-15 07:49:08 UTC
when I click the same image again:
...
(remote-viewer:26393): remote-viewer-DEBUG: 'en_windows_xp_professional_x64.iso' clicked
(remote-viewer:26393): remote-viewer-DEBUG: Removing current cdrom image
(remote-viewer:26393): remote-viewer-DEBUG: Finished updating cdrom content

(remote-viewer:26393): remote-viewer-WARNING **: failed to update cdrom resource: Bad Request
(remote-viewer:26393): remote-viewer-DEBUG: setting OvirtCdrom:file back to 'en_windows_xp_professional_x64.iso'
...

Comment 11 CongDong 2014-10-20 09:09:34 UTC
I prepare a rhevm3.5(3.5.0-0.14)

Steps are same with comment4.

Result:
If click the same cd image, it can be removed, click another image, the cd image will attached to the geust.

As the result, VERIFIED.

Comment 13 errata-xmlrpc 2015-03-05 13:39:50 UTC
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://rhn.redhat.com/errata/RHBA-2015-0295.html