[Spice-devel] Welcome to the "Spice-devel" mailing list

Jonathon Jongsma jjongsma at redhat.com
Mon Sep 28 09:31:14 PDT 2015


On Sun, 2015-09-27 at 18:26 +0300, Alex Roithman wrote:
> Hi, guys!
> i'm try to code the qt-virt-manager with SPICE.
> For this i try to implement different spice-client properties
> with qspice-widget library, which somebody began write
> over spice-client-glib sometime ago.
> 
> Now i have some problems with
> #include <channel-main.h>
> (1)
> void spice_main_file_copy_async (...)
> for copy files to guest
> and
> (2)
> void spice_main_clipboard_selection_notify(...)
> for copy host clipboard data to guest.
> 
> (1)
> https://github.com/F1ash/qt-virt-manager/blob/master/src/vm_viewer/qspice_widgets/qspicemainchannel.cpp#L157-L179
> after the try to execute this method application crashed:
> (image, 0.3 MB) http://itmag.es/3aapu
> <code>
>   node = lookup_type_node_I(type_instance->g_class->g_type);
> </code>
> ...->g_type is broken address.
> This occured in
> static void file_xfer_send_start_msg_async(...) {
> ...
>         task->channel = g_object_ref(channel);
>         task->file = g_object_ref(files[i]);
> ...
> }

The documentation on this method is not clear, but the 'sources'
parameter to spice_main_file_copy_async() should be a NULL-terminated
array of GFile objects. If your array is not null-terminated, it's
possible that you could get the error that you reported.

(Trivia: technically the 'callback' function should have 'extern "C"'
linkage. The static C++ member function
QSpiceMainChannel::mainFileCopyFinish will probably work with every
compiler and platform that you care about, but in theory it should be a
plain C function).


> (2)
> https://github.com/F1ash/qt-virt-manager/blob/master/src/vm_viewer/qspice_widgets/qspicemainchannel.cpp#L129-L146
> after the try to execute this method host clipboard (text)
> data not received by guest clipboard. In virt-viewer this
> action is successful.


I didn't see anything obvious after a quick look at your function source
(although I think you could simply pass _data.toUtf8().data() to that
function instead of allocating and copying it to a new 'buff' variable).
If it's not working, I'm pretty sure the bug must be in your code
though, since spice_main_clipboard_selection_notify() works fine for
others.

Jonathon




More information about the Spice-devel mailing list