Window information from guests

78 views
Skip to first unread message

drew....@gmail.com

unread,
Nov 22, 2016, 7:22:27 PM11/22/16
to qubes-devel
How do you actually get the data from the guests for each window that is loaded up?

Does the guest push to dom0?
Or does dom0 keep polling the guest for request of information?

With which one, how does it?
I've been through the code for the gui daemon on github, and there isn't anything there that tells me anything.

Help please?

Thanks in advance.

Marek Marczykowski-Górecki

unread,
Nov 22, 2016, 7:31:25 PM11/22/16
to drew....@gmail.com, qubes-devel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
https://www.qubes-os.org/attachment/wiki/QubesArchitecture/arch-spec-0.3.pdf
Page 25.

- --
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJYNONYAAoJENuP0xzK19csQxgH/0l+wZAVFmI4oCSAZ4h86tUX
TSeWtGnx+hZjdaoHNWAxghVUaFeBKn651cMA5R/I7We3i7uoEuKVccyASGGvIXY8
aQT/uxoUDpwdqVzsIAwUVlgbmA3rWNv68p82KaaPWWDRqfCzOnILNRfOFVurHatX
dFUzwyiFLYlQ/PM51gE1EHw4QdpEt2FHK9Na5WX41NeTz+fHdulFX4f4ZlA4XdiH
S9Te0krBtisbSPxWnwUjs4+8IZAeCRqWoMqgqdBLhWqyorGGBdpw9Qh8Jscwbhlo
UorggcEhe0fd9eb/x/HfgJSWPQ8x5dykH3IdM9cu1JJUAz+B3hjPx7DfjT9Q/cQ=
=ejpa
-----END PGP SIGNATURE-----

Jean-Philippe Ouellet

unread,
Nov 22, 2016, 7:36:19 PM11/22/16
to Marek Marczykowski-Górecki, Drew White, qubes-devel
On Tue, Nov 22, 2016 at 7:31 PM, Marek Marczykowski-Górecki
<marm...@invisiblethingslab.com> wrote:
> https://www.qubes-os.org/attachment/wiki/QubesArchitecture/arch-spec-0.3.pdf
> Page 25.

Some details are different between that spec and reality.

https://www.qubes-os.org/doc/gui/ and the source are more complete &
accurate references :)

drew....@gmail.com

unread,
Nov 23, 2016, 7:36:34 PM11/23/16
to qubes-devel, drew....@gmail.com


On Wednesday, 23 November 2016 11:31:25 UTC+11, Marek Marczykowski-Górecki wrote:
https://www.qubes-os.org/attachment/wiki/QubesArchitecture/arch-spec-0.3.pdf
Page 25.


Thanks Marek,
So the AppViewer listens only. and allows the guest to send data to dom0, but is there a static link between the two that is always active? Or is it listenning for any input from any guest at any time (etc) ?

What is it that it listens for?
What is the listenner/AppViewer ?


Marek Marczykowski-Górecki

unread,
Nov 23, 2016, 7:38:55 PM11/23/16
to drew....@gmail.com, qubes-devel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Some more info is here:
https://www.qubes-os.org/doc/gui/

Names of particular components have changed since writing this page, but
most of actual design is the same.

- --
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJYNjacAAoJENuP0xzK19cskuQH/2F3TWMFcUgnzVGms8VAAjhw
/N5MVoPHUCDqk7s0dwPMmoxxhfk9fTjxqNMtQ6m+0sY/UYfl1xqkuhDbCINcFZP4
vTc6v+w4RfqmsAt6wOS4ekq10ESk/6v356jvxrR+UNr6oMz4l30/WiOkYTczp/aJ
ntowDXqJd0J3ZmEdj5RAwIedhmu7pIFA9AFgImnptRxZETMZoigjKfjmt73HtwZM
e4QT9Ps9e0exT/X3JrAx3I7yVoU/3eER1+ouVup+POlF8x+P418eSy0d2m48u4Ff
db88JCjqs80FDWfXADiHHZBLgsxXyRrhoJeo2cAWGPnlaeA/JmEx7RB/IeMNdpk=
=0Vbo
-----END PGP SIGNATURE-----

drew....@gmail.com

unread,
Nov 23, 2016, 11:06:40 PM11/23/16
to qubes-devel, drew....@gmail.com
qubes_gui_daemon contains next to no code and has next to no functionality in it.

This is why I'm asking what it is that listens and how it listens and does what it does, because I can't find anything. 

That document, it says it's meant to do things, but I look at the code, and there is nothing there.
Unless I'm completely missing something?
Or there is something else that is required?

Is there documentation on how it actually does the communication? 
As in technical/programmatic documentation, not that link.

Jean-Philippe Ouellet

unread,
Nov 23, 2016, 11:17:13 PM11/23/16
to Drew White, qubes-devel
On Wed, Nov 23, 2016 at 11:06 PM, <drew....@gmail.com> wrote:
> qubes_gui_daemon contains next to no code and has next to no functionality
> in it.

I'm sorry, but you are simply mistaken:

[user@fedora-23-dvm]/tmp% git clone https://github.com/QubesOS/qubes-gui-daemon
Cloning into 'qubes-gui-daemon'...
remote: Counting objects: 4559, done.
remote: Compressing objects: 100% (50/50), done.
remote: Total 4559 (delta 25), reused 0 (delta 0), pack-reused 4507
Receiving objects: 100% (4559/4559), 1.27 MiB | 0 bytes/s, done.
Resolving deltas: 100% (2625/2625), done.
Checking connectivity... done.
[user@fedora-23-dvm]/tmp% cd qubes-gui-daemon
[user@fedora-23-dvm]/tmp/qubes-gui-daemon% cloc .
53 text files.
51 unique files.
19 files ignored.

github.com/AlDanial/cloc v 1.70 T=0.41 s (86.2 files/s, 17638.1 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C 12 511 626 4320
C/C++ Header 12 253 457 441
Python 1 27 123 179
make 7 27 65 101
XML 1 0 3 13
YAML 1 0 1 8
Bourne Shell 1 1 0 2
-------------------------------------------------------------------------------
SUM: 35 819 1275 5064
-------------------------------------------------------------------------------

5000 lines of code is most certainly *NOT* "next to no code"!!

> This is why I'm asking what it is that listens and how it listens and does
> what it does, because I can't find anything.
>
> That document, it says it's meant to do things, but I look at the code, and
> there is nothing there.

I look at the code too and have a very different experience. I suppose
the repo must exist in a superposition and we collapse it to different
states ;)

> Unless I'm completely missing something?
> Or there is something else that is required?

Just actually reading it...

drew....@gmail.com

unread,
Nov 24, 2016, 6:16:13 PM11/24/16
to qubes-devel, drew....@gmail.com
I was looking at the one on GitHub, the code itself, not the compiled version.
Maybe the version from GitHub that I got wasn't downloaded right.

I'll re-download it and take another look.


 

drew....@gmail.com

unread,
Nov 24, 2016, 6:27:44 PM11/24/16
to qubes-devel, drew....@gmail.com


On Thursday, 24 November 2016 15:17:13 UTC+11, Jean-Philippe Ouellet wrote:
Looks like it was a bad download. The other one was only 80k, this one is over 200k.

I've looked at it, and yes, there is about 3800 lines of code in the daemon.

Now for my questions (since the code is NOT commented).

Where does it do everything?
What is it that actually listens?
How does it listen?
What protocol does it use?
etc..


 

Radoslaw Szkodzinski

unread,
Dec 16, 2016, 12:37:53 PM12/16/16
to drew....@gmail.com, qubes-devel
Now for my questions (since the code is NOT commented).

Where does it do everything?

Stupid answer would be "in the code". Less silly is in the main event loop. If is not threaded or asynchronous in any way. 

What is it that actually listens?

Libvchan. So, essentially, Linux kernel on a Xen hypercall. 

How does it listen?

It opens a Xen event channel to receive new data from the VM. This works similarly to select syscall on a file. 
The data is available in a shared memory buffer managed by Xen gntdev and evtchn, and finally, the hypervisor. 

Note that I haven't checked lately the support for KVM, someone else will have to speak up. 

What protocol does it use?


Custom simple protocol with uncompressed images. Those are relayed from a composing window manager in the VM.
This part is actually documented.

R. Sz. (not a Qubes dev) 
Reply all
Reply to author
Forward
0 new messages