Bug 1161081 - copy/paste images does not work -- images are truncated
Summary: copy/paste images does not work -- images are truncated
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: mingw-virt-viewer
Version: 3.5.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ovirt-3.6.0-rc
: 3.6.0
Assignee: Christophe Fergeau
QA Contact: SPICE QE bug list
URL:
Whiteboard:
Depends On: 1154719 1181289
Blocks: 1187270
TreeView+ depends on / blocked
 
Reported: 2014-11-06 11:02 UTC by Christophe Fergeau
Modified: 2016-03-09 20:04 UTC (History)
17 users (show)

Fixed In Version: mingw-spice-gtk-0.26-4.el7ev mingw-virt-viewer-2.0-2.el7ev rhevm-spice-client 3.6-2
Doc Type: Bug Fix
Doc Text:
Previously, clipboard images were truncated when copying from the SPICE client to guest, as clipboard data size was incorrectly calculated as a text string. Data size is now calculated according to its type so that copying and pasting images between client and guest works as expected.
Clone Of: 1154719
: 1187270 (view as bug list)
Environment:
Last Closed: 2016-03-09 20:04:23 UTC
oVirt Team: Spice
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2016:0377 0 normal SHIPPED_LIVE rhevm-spice-client bug fix and enhancement update 2016-03-10 00:39:05 UTC

Description Christophe Fergeau 2014-11-06 11:02:15 UTC
mingw-spice-gtk build for 3.5 has http://cgit.freedesktop.org/spice/spice-gtk/commit/?id=a8f2e2d9906f9908ab6cae0b9c36d99e5b49d05d in order to fix bug #1090122. This caused a regression with image c&p fixed by http://cgit.freedesktop.org/spice/spice-gtk/commit/?id=43e3f6ea012236b1c3759a48b24026bdeff5d7e0

+++ This bug was initially created as a clone of Bug #1154719 +++

Description of problem:
When I build spice-gtk from upstream and use it in smoketest, copy/paste of images from client to guest fail with being unable to copy the images. 

The same tests pass from guest to client.

Version-Release number of selected component (if applicable):
Built spice-gtk from latest upstream => spice-gtk 0.25.48-af73-dirty
spice-gtk-python-0.22-7.el6.x86_64
spice-vdagent-0.14.0-4.el6.x86_64
spice-server-0.12.4-11.el6.x86_64
spice-glib-0.22-7.el6.x86_64
qemu-kvm-0.12.1.2-2.445.el6.x86_64
xorg-x11-drv-qxl-0.1.1-15.el6.x86_64
spice-vdagent-0.14.0-4.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Open guest with virt-viewer and spice-gtk (built from upstream) by LD_LIBRARY_PATH=/usr/local/lib virt-viewer spice://localhost?port=5901
2. Copy any image from client
3. Open http://ie.microsoft.com/testdrive/browser/Editing_Paste_Image/
4. Try pasting image using <Ctrl+v>
5. Image will not get copied
6. Try copying any image from guest
7. Open same webpage in client
8. Try pasting image using <Ctrl+v>. Image will get pasted. 


Actual results:
Images gets copied from guest to client but not client to guest. 

Expected results:
Image should get copied in both directions.

Additional info:

--- Additional comment from Swapna Krishnan on 2014-10-27 14:26:55 EDT ---

I checked the commits and narrowed the failure to this commit. Copy-Paste images from client to guest fails after this commit and passes before this commit. 

commit a8f2e2d9906f9908ab6cae0b9c36d99e5b49d05d
Author: Christophe Fergeau <cfergeau@redhat.com>
Date:   Tue Aug 12 16:17:16 2014 +0200

    Ensure '\0' is not part of text clipboard data
    
    On Windows, with some versions of gtk+, GtkSelectionData::length
    will include the final '\0'.
    When a string with this trailing '\0' is pasted in some linux
    applications, it will be pasted as <NIL> or as an invisible character,
    which is unwanted.
    
    This commit ensures the length we send to the agent does not
    include any trailing '\0'.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1090122

--- Additional comment from Christophe Fergeau on 2014-10-28 06:44:46 EDT ---

(In reply to Swapna Krishnan from comment #0)
> When I build spice-gtk from upstream

Just a note for future bugs, bugs in the upstream codebase should be filed on https://bugs.freedesktop.org/
Bugs in the Fedora component are for bugs you hit when using the fedora packages.

Thanks a lot for bisecting it down to the faulty commit, this is really helpful in fixing it!

--- Additional comment from Christophe Fergeau on 2014-10-29 09:37:53 EDT ---

Fixed upstream in http://cgit.freedesktop.org/spice/spice-gtk/commit/?id=43e3f6ea012236b1c3759a48b24026bdeff5d7e0 (and previous commit), will be in upcoming 0.26 release.

Comment 2 Vaclav Ehrlich 2014-11-11 11:04:17 UTC
Client Win7/32 mingw-virt-viewer-0.6.0-2.el6_5
Guest Win7/64 (Guest tools 3.5-5), RHEL6.6-64 (spice-vdagent-0.14-4)

Copy from client to guest is not working (Win7's Paint shows message 'The information on the Clipboard cant' be inserted into Paint')

Copy in opposite direction works like a charm.

Comment 4 Christophe Fergeau 2015-06-05 10:27:19 UTC
Will be resolved by the rebase.

Comment 5 Uri Lublin 2015-06-15 23:10:40 UTC
Rebase built -- mingw-spice-gtk-0.26-1.el7ev.
I put -4 in built-in field which is part of mingw-virt-viewer-2.0-2.el7ev
which is a part of rhevm-spice-client 3.6-2 build

Comment 9 errata-xmlrpc 2016-03-09 20:04:23 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/RHEA-2016-0377.html


Note You need to log in before you can comment on or make changes to this bug.