[Spice-devel] Windows guest and virtio serial port

Christophe Fergeau cfergeau at redhat.com
Thu Jul 7 12:27:34 UTC 2016


Hey,

On Wed, Jun 22, 2016 at 02:39:13PM +0300, Tadas wrote:
> 
> I'm not sure, if it's correct mailing list to post this problem to. For
> that I apologize.
> 
> I'm having problems with Windows guest and virtio serial port.
> According to this manual:
> http://www.spice-space.org/page/Whiteboard/AgentProtocol
> I should get a named pipe on my guest VM after I create VirtIO sedial
> device and spicevmc channel.
> This works without any problems on Linux guest:
> 
> ls /dev/virtio-ports/
> com.redhat.spice.0
> 
> But on Windows guest I can't see no such pipe:

This is how the Windows SPICE agent uses the virtio serial device:

https://gitlab.com/spice/vdagent-win/blob/master/vdagent/vdagent.cpp#L1261

bool VDAgent::init_vio_serial()
{
    #define VIOSERIAL_PORT_PATH L"\\\\.\\Global\\com.redhat.spice.0"
    _vio_serial = CreateFile(VIOSERIAL_PORT_PATH, GENERIC_READ | GENERIC_WRITE , 0, NULL,
                             OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL);
    if (_vio_serial == INVALID_HANDLE_VALUE) {
        vd_printf("Failed opening %ls, error %lu", VIOSERIAL_PORT_PATH, GetLastError());
        return false;
    }
    return true;
}

I'm not that fluent with Windows API, but maybe that's helpful? It looks like
it's using some "well-known" device name to open the serial port?

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160707/c9225989/attachment.sig>


More information about the Spice-devel mailing list