Mir

Merge lp://qastaging/~raof/mir/xserver-spawner into lp://qastaging/mir

Proposed by Chris Halse Rogers
Status: Work in progress
Proposed branch: lp://qastaging/~raof/mir/xserver-spawner
Merge into: lp://qastaging/mir
Prerequisite: lp://qastaging/~raof/mir/process-wrapper
Diff against target: 725 lines (+566/-2)
16 files modified
.clang-format (+1/-1)
include/server/mir/default_server_configuration.h (+11/-0)
include/server/mir/xserver/null_server_spawner.h (+25/-0)
include/server/mir/xserver/xserver_launcher.h (+59/-0)
src/server/CMakeLists.txt (+3/-1)
src/server/default_server_configuration.cpp (+6/-0)
src/server/xserver/CMakeLists.txt (+12/-0)
src/server/xserver/global_socket_listening_server_spawner.cpp (+71/-0)
src/server/xserver/global_socket_listening_server_spawner.h (+52/-0)
src/server/xserver/null_server_spawner.cpp (+34/-0)
tests/CMakeLists.txt (+1/-0)
tests/acceptance-tests/CMakeLists.txt (+2/-0)
tests/acceptance-tests/test_xserver_spawner.cpp (+73/-0)
tests/unit-tests/CMakeLists.txt (+2/-0)
tests/unit-tests/xserver/CMakeLists.txt (+8/-0)
tests/unit-tests/xserver/test_xserver_spawner.cpp (+206/-0)
To merge this branch: bzr merge lp://qastaging/~raof/mir/xserver-spawner
Reviewer Review Type Date Requested Status
Andreas Pokorny (community) Needs Fixing
Daniel van Vugt Needs Fixing
Alan Griffiths Needs Information
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+203475@code.qastaging.launchpad.net

This proposal supersedes a proposal from 2014-01-28.

Description of the change

A first cut at the infrastructure required for seamless nesting of X11 clients.

In order to do this we need to be able to spawn an Xorg server, wait until it's
ready to accept connections, connect a Mir X11 client to act as a bridging WM,
and *then* offer the X11 socket to clients.

This branch accomplishes the first two requirements.

I'm proposing it now because it's a reasonable checkpoint and I need to go and work on something else.

To post a comment you must log in.
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

Please rethink class names ending in "er". That's almost always a bad decision, and an indication that a different cleaner design is possible...

http://www.benhallbenhall.com/2013/01/naming-objects-er-object-names/

review: Needs Fixing
Revision history for this message
Daniel van Vugt (vanvugt) :
review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

How much should Mir know about launching xservers?

Is it essential to all the uses we envisage: unity8? system compositor? Other (hypothetical at this time) shells?

review: Needs Information
Revision history for this message
Kevin DuBois (kdub) wrote :

could
+const char* mir::X::NullServerContext::client_connection_string()
return a string instead of a const char*?

Revision history for this message
Kevin DuBois (kdub) wrote :

> How much should Mir know about launching xservers?
>
> Is it essential to all the uses we envisage: unity8? system compositor? Other
> (hypothetical at this time) shells?

Last I heard from the architectural-level view is that lightdm was going to negotiate starting mir and friends and hooking up the FD's between them appropriately. That was something I heard a (relatively) long time ago though.

Revision history for this message
Chris Halse Rogers (raof) wrote :

@Alan:
I think most non-trivial shells are going to want to support running X11 apps. It's not interesting for system-compositor usage, true.

As to why Mir should know about launching xservers - the process of tying together foreign X11 windows needs Mir support. Mir will need to include an X11 window manager in order to proxy between X11 EWMH window management and Mir - this could be in U8, but any shell that wants to support X11 apps will need identical code.

Ideally you want to start the X11 WM before any app connects to the server to avoid unexpected behaviours; the easiest way to do this is to start the X server, wait for it to come up, connect the WM proxy, and only then consider the server to be started (that's the next part of X11 integration).

I (obviously) think it makes sense to have Mir know how to start the X server.
@kdub:
This is somewhat of a circular dependency - the X server needs Mir running in order to be started (it needs the mir socket), and Mir's X11 WM needs the X server to be running. You can't easily start both from LightDM, as it would need to start Mir, it to be ready to accept connections, then start the X server.

Also, U8 wants to (a) start an X server only when an app needs it, and (b) start one-Xserver-per-app.

re: client_connection_string - Yeah, it could return a std::string (and did, at one point). I switched to char const* because I only ever wanted to consume it from things that took a char const*, but can easily switch it back.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

(1) "er" issues as described above.

(2) I'm concerned about mentioning "X"-anything in the Mir source too. It feels like we're preventing Mir from being a success in its own right if it even has to mention X in its source. Even if the coupling is weak, we should strive for a better answer. Generalize, move it out-of-project, etc. We almost certainly don't want an "X" namespace. That's a reasonable indication that we're going in the wrong direction.

(3) You've introduced a build-dep on libx11-dev:
  +#include <X11/Xlib.h>
Definitely don't do that, at least :)

review: Needs Fixing
Revision history for this message
Chris Halse Rogers (raof) wrote :

On Wed, 2014-01-29 at 03:09 +0000, Daniel van Vugt wrote:
> Review: Needs Fixing
>
> (1) "er" issues as described above.

Would you prefer XServerFactory?

> (2) I'm concerned about mentioning "X"-anything in the Mir source too. It feels like we're preventing Mir from being a success in its own right if it even has to mention X in its source. Even if the coupling is weak, we should strive for a better answer. Generalize, move it out-of-project, etc. We almost certainly don't want an "X" namespace. That's a reasonable indication that we're going in the wrong direction.

We're going to have to support running X11 apps for the foreseeable
future. Certainly for the life of 14.04, probably for the life of 16.04.

I don't think it's unreasonable for the Mir codebase to reflect the
importance of legacy X11 support.

Indeed, the actual implementations should be in a separate opt-in
libmirserverX11integration.so library, and will be once they start to
depend on X11 libraries.

>
> (3) You've introduced a build-dep on libx11-dev:
> +#include <X11/Xlib.h>
> Definitely don't do that, at least :)
>

Ah, yeah. This is currently only for the (disabled) acceptance test.
Once there's mirserver code that depends on X11 libs it'll be optional
and in a separate library.

Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

@er:
I still dont get the argument about "er" - If RAOF renames "XServerSpawner" into "XServerFactory" and people are satisfied then there is something wrong with that rule (of thumb?).
We then switched from a noun that was derived from a verb that meant something like: "creates and launches a process or activity" to something that only means: "creates something". So from a clearer specific term to a generic one. A specific term that describes what should be in this class and what not - A term that suggest that this is actually a very specific functor that launches an XServer.

So I would prefer XServerSpawner::create_server over XServerFactory::create_server. Something like is XServerFactory::spawn_server also a good name - I just dont get the reasoning with the "no-er"-rule.

@library: I do believe that this functionality is something a current linux compositor framework needs to provide, but probably as a separate library. -> Needs Fixing

@clang-format: thanks for fixing!

review: Needs Fixing

Unmerged revisions

1349. By Chris Halse Rogers

clang-format: We always split constructor initialisers on new lines

1348. By Chris Halse Rogers

Disable X11ClientConnects acceptance test.

This needs a bit more fiddling - it all roughly works, but in the acceptance
test framework we don't have a real graphics card, so XMir currently fails.

Needs at least an xorg.conf specifying the dummy graphics driver

1347. By Chris Halse Rogers

Get the Xserver to connect to a Mir socket

1346. By Chris Halse Rogers

Update for process::Spawner API change

1345. By Chris Halse Rogers

Merged subprocess-wrapper into xserver-spawner.

1344. By Chris Halse Rogers

X::ServerSpawner::create_server must take a shared_ptr<process::Spawner>

create_server does things asynchronously, so it has to take shared ownership
of the process::Spawner it's using

1343. By Chris Halse Rogers

Rejigger X::ServerSpawner API.

spawn_server() now returns a future<ServerHandle> that will become a present ServerHandle once
the server is ready, rather than returning a ServerHandle now that has methods that will only
work in the future.

1342. By Chris Halse Rogers

Implement -displayfd handling for GlobalSocketListeningServerSpawner.

client_connection_string now returns a string that should be associated with an Xorg server that's ready to accept connections

1341. By Chris Halse Rogers

Merge process::Spawner work required to do Xserver startup properly

1340. By Chris Halse Rogers

More basic unittests for GlobalSocketListeningServerSpawner

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches