[libvirt] Non-blocking virStreamRecv always returns -2 (EAGAIN)?

2013-01-23 Thread John Eckersberg
I'm running the following test program, and it works as written with a blocking stream. Inside the guest I'm running: [root@f17-minimal ~]# socat /usr/share/dict/words /dev/virtio-ports/org.libguestfs.channel.0 As expected on the client side, I get all the words dumped. However if I swap the

[libvirt] [PATCHv2 1/5] api: Add API to tunnel a guest channel via stream

2013-01-02 Thread John Eckersberg
This patch adds a new API, virDomainOpenChannel, that uses streams to connect to a virtio channel on a guest. This creates a secure communication channel between a guest and a libvirt client. This behaves the same as virDomainOpenConsole, except on channels instead of console/serial/parallel

[libvirt] [PATCHv2 2/5] conf: Rename virconsole.* to virchrdev.*

2013-01-02 Thread John Eckersberg
This is just code motion, in preparation to rename identifiers to be less console-specific. --- po/POTFILES.in | 2 +- src/Makefile.am | 2 +- src/conf/virchrdev.c | 414 +++ src/conf/virchrdev.h | 36 +

[libvirt] [PATCHv2 3/5] conf: Rename console-specific identifiers to be more generic

2013-01-02 Thread John Eckersberg
The functionality provided in virchrdev.c (previously virconsole.c) is applicable to other types of character devices besides consoles, such as channels. This patch is just code motion, renaming things such as console or pty, instead using more general terms such as character device or device

[libvirt] [PATCHv2 5/5] qemu: Implement virDomainOpenChannel API

2013-01-02 Thread John Eckersberg
--- v2: correct version comment to 1.0.2 src/qemu/qemu_driver.c | 73 ++ 1 file changed, 73 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 20e2001..cdbe30d 100644 --- a/src/qemu/qemu_driver.c +++

[libvirt] [PATCHv2 0/5] Add API to tunnel channels

2013-01-02 Thread John Eckersberg
master - Correct version to 1.0.2 in 5/5 --- John Eckersberg (5): api: Add API to tunnel a guest channel via stream conf: Rename virconsole.* to virchrdev.* conf: Rename console-specific identifiers to be more generic conf: Add unix socket support to virChrdevOpen qemu: Implement

[libvirt] [PATCHv2 4/5] conf: Add unix socket support to virChrdevOpen

2013-01-02 Thread John Eckersberg
This also changes the function signature to take a virDomainChrSourceDefPtr instead of just a path, since it needs to differentiate behavior based on source-type. --- src/conf/virchrdev.c | 38 +- src/conf/virchrdev.h | 5 +++-- src/qemu/qemu_driver.c | 2

[libvirt] [Test] Add API to tunnel channels

2012-12-17 Thread John Eckersberg
Attached is a simple test program to exercise virDomainOpenChannel that echoes a toupper()'d string and exits. Edit the #defines as necessary to match your setup. You'll need a channel defined in the guest similar to: channel type=unix source mode=bind path=/tmp/guestfsd.sock/

[libvirt] [PATCH 5/5] qemu: Implement virDomainOpenChannel API

2012-12-13 Thread John Eckersberg
--- src/qemu/qemu_driver.c | 73 ++ 1 file changed, 73 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 441272d..bcd9c57 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -12907,6 +12907,78 @@

[libvirt] [PATCH 4/5] conf: Add unix socket support to virChrdevOpen

2012-12-13 Thread John Eckersberg
This also changes the function signature to take a virDomainChrSourceDefPtr instead of just a path, since it needs to differentiate behavior based on source-type. --- src/conf/virchrdev.c | 38 +- src/conf/virchrdev.h | 5 +++-- src/qemu/qemu_driver.c | 2

[libvirt] [PATCH 2/5] conf: Rename virconsole.* to virchrdev.*

2012-12-13 Thread John Eckersberg
This is just code motion, in preparation to rename identifiers to be less console-specific. --- po/POTFILES.in | 2 +- src/Makefile.am | 2 +- src/conf/virchrdev.c | 414 +++ src/conf/virchrdev.h | 36 +

[libvirt] [PATCH 1/5] api: Add API to tunnel a guest channel via stream

2012-12-13 Thread John Eckersberg
This patch adds a new API, virDomainOpenChannel, that uses streams to connect to a virtio channel on a guest. This creates a secure communication channel between a guest and a libvirt client. This behaves the same as virDomainOpenConsole, except on channels instead of console/serial/parallel

[libvirt] [PATCH 3/5] conf: Rename console-specific identifiers to be more generic

2012-12-13 Thread John Eckersberg
The functionality provided in virchrdev.c (previously virconsole.c) is applicable to other types of character devices besides consoles, such as channels. This patch is just code motion, renaming things such as console or pty, instead using more general terms such as character device or device

[libvirt] [PATCH 0/5] Add API to tunnel channels

2012-12-13 Thread John Eckersberg
This implements only item (3) in that list. The new API is nearly identical to the existing virDomainOpenConsole API, except it works on channels, and supports UNIX sockets in addition to PTYs for channel source type. This is my first libvirt patch, please be gentle :) John Eckersberg (5): api

Re: [libvirt] RFC: Coding style: require alphabetical header file sorting

2012-12-03 Thread John Eckersberg
Daniel P. Berrange berra...@redhat.com writes: Thus far we only have one rule about header files, #include config.h must be first in all .c files. I'm wondering if it is time to introduce some new rules - All system headers must be grouped to preceed all local headers - All system headers