[Spice-devel] [RFC] Implement of file drag-and-drop between host and guest
Daimon Wang
daimon_swang at yahoo.com
Sun Oct 21 23:39:14 PDT 2012
Hi Dunrong,
I suppose you mean drag-and-drop between 'client' and guest. Then you may want to read this plan http://spice-space.org/page/Features/LocalFolderAccess.
And yes, drag-and-drop is cool :)
Regards,
Daimon
________________________________
From: Dunrong Huang <riegamaths at gmail.com>
To: spice-devel <spice-devel at lists.freedesktop.org>
Sent: Saturday, October 20, 2012 5:06 PM
Subject: [Spice-devel] [RFC] Implement of file drag-and-drop between host and guest
Hi, all
I want to implement the feature: file drag-and-drop between the host and
guest. But i dont know whether someone is working on it, if this feature
has not been implemented, i want to implement it in my spare time.
Any suggestion is welcome.
My idea is:
0) Now i only consider file drag-n-drog from host to linux guest.
1) On QEMU side. virtserialport and spicevmc are used as communication
channel, e.g.
$ qemu -chardev spicevmc,id=charchannel0,name=filetrans -device
virtserialport,chardev=charchannel0,name=filetransfer
Because Hans has made spicevmc generic channel(commit c03038), we dont
need to change any code in QEMU for using spicevmc as backend of
virtualserialport.
2) On guest side. Use a simple daemon, or hack spice-agent to read/write
virtserialport mentioned above for receiving/sending file content.
Since we just want to receive/send file, the message protocol is simple.
3) On spice server side. Attach a new SpiceCharDevice for communication
with spice client and guset, rather than creating a new channel.
e.g.
static int spice_server_char_device_add_interface(SpiceServer *s,
SpiceBaseInstance *sin)
{
// [..snip..]
if (strcmp(char_device->subtype, SUBTYPE_FILETRANSFER) == 0) {
dev_state = attach_to_filetransfer(char_device);
}
// [..snip..]
}
The reason why i dont create a new channel is: a new channel wont
register util guest open the virtserialport. in this case, if spice client
connects to spice server, it can not receive any information about
the channel we created and will not create client channel for it.
4) On spice client. Spice client receives the message server passed to
it, handles the signal related "drag-n-drog", provide the callback for
handling it.
hans, Marc-André, any suggestion?
--
Best Regards,
Dunrong Huang
_______________________________________________
Spice-devel mailing list
Spice-devel at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20121021/102cc7cb/attachment.html>
More information about the Spice-devel
mailing list