<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/112294/">https://git.reviewboard.kde.org/r/112294/</a>
     </td>
    </tr>
   </table>
   <br />













<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On May 24th, 2014, 11:46 a.m. UTC, <b>Oswald Buddenhagen</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">regarding DynamicDisplays and your magic backwards compat handling ... i think the seat-encoded config stuff i insisted on makes that redundant, after all. suppose we do it like that:

  StaticServers=:0,@seat1_:4,@seat2_:7
  ReserveServers=:1,:2,@seat1_:5,@seat2_:8

local displays without a seat are implicitly on seat0. that's your special case, without much magic.
if kdm is started with systemd, *all* static local servers actually go straight into the dynamic state and need to be activated by systemd.
if kdm is compiled with systemd support but none is running, displays on seats != 0 are simply eliminated (with a notice to the log).
if kdm is compiled without systemd support, seats != 0 are rejected (with an error to the log). if somebody feels like implementing actual support for that, they can.
as before, the ReserveServers are only meant for demo purposes. don't worry about them.

would that work?</pre>
 </blockquote>




 <p>On May 24th, 2014, 6:16 p.m. UTC, <b>Stefan Brüns</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Hm, not exactly sure if I understand your proposal correctly - do you mean get rid of DynamicServers and use the StaticServers for either "legacy" static servers or for seats provided by systemd-logind, dependent on logind availability?

If yes, I am generally for it. But this would also require that the StaticServers list does not require (but allow) any special syntax for seats. Seats may be totally dynamic, added by e.g. plugging a DisplayLink USB adapter, with a name dependent on the used USB port.

So given the following partial config:
---
StaticServers=:0,:1,:2_@seat-foo
ReserveServers=:3,:4,:5_@seat-foo
[X-:*_@seat-foo-Core]
ServerArgsLocal=-layout Seat-Foo
---
and these seats: 'seat0', 'seat-some-machine-generated-specifier', 'seat-foo' --

In case of compiled in support for systemd-logind all StaticServers would be flagged with status dynamic instead of notRunning.
[a: logind running]                seat-foo will use DISPLAY=:2, whereas the other two will use one of :0 and :1, which one is unspecified. :2 will use "-layout Seat-Foo" as args, the other two will use the default args (or section [X-:*-Core])
[b: logind not running]            print a warning/error in kdm.log. Change the status from dynamic to notRunning for all seats without a seat specifier, this will spawn displays/greeters for :0 and :1, and if there where [X-:{0,1}-Core] config sections, these would be used.

[c: No logind support compiled in] print a warning for each display in StaticServers/ReserveServers matching :\d+_@seat.* and remove from the Static|ReserveServers list, i.e. :0 and :1 will be started.

In case ReserveServers support is added later, seat-foo would use :5 and the same [X-:*_@seat-foo-Core] config section as display :2.</pre>
 </blockquote>








</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">yes, you understood me right.
but as you point out correctly, i didn't consider the case of plugging unknown seats. how about this:

StaticServers=:0,@*:1,:2_@seat-foo

:0 is a fixed binding, as no seat is implicitly seat0 - exact match.
seat-foo will get :2 - exact match.
seat-some-machine-generated-specifier would get :1 - wildcard match.

for the b case, you slightly modified my proposal, but your version is actually better suited for the wildcard handling. we just define that a legacy-compatible config must have explicit entries without a seat spec (which default to seat0 with systemd). that way we don't need to exclude seat0 from wildcard matching.

note that in the config section headers, :0 and :0_@seat0 are equivalent.
implementation-wise, that may mean that it is best to null out the seat0 name asap, i.e. when parsing the config and when receiving seat names from systemd. at first sight, that seems to contradict the previous paragraph, but in a way it doesn't ... displays with an explict seat0 spec would just turn into displays with no seat spec. that would have the advantage of needing the fewest conditionals further down the line, which would also mean the fewest #ifdefs.


now comes the next problem: ServerArgs* needs to pass the seat to the server somehow.

[X-:*_@*-Core]
ServerArgsLocal=-seat @SEAT@ -layout @SEAT@

the -layout is actually irrelevant for unknown seats, as they can't have predefined layouts by definition.
i'm not sure yet whether i want to insist on passing -seat via the config. technically, it would be cleaner to take that knowledge about the server command line out of kdm. otoh, it already makes assumptions about how displays and vts are passed, and the seat is quite akin to that. oh, it also knows about auth files. and xdmcp queries. ok, forget the idea - you need no @SEAT@ magic. ^^</pre>
<br />


<p>- Oswald</p>


<br />
<p>On May 18th, 2014, 7:44 p.m. UTC, Stefan Brüns wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for kde-workspace and Oswald Buddenhagen.</div>
<div>By Stefan Brüns.</div>


<p style="color: grey;"><i>Updated May 18, 2014, 7:44 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kde-workspace
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This patch implements dynamic multiseat in KDM. It follows the description in:
http://www.freedesktop.org/wiki/Software/systemd/writing-display-managers/

In case systemd is no found at compile time, nothing changes. If logind is not running, nothing changes. If no additional seats have been configured (some Plugable USB-GPUs are automatically added as additional seats), nothing changes.

In case there are additional seats beyond seat0, a reserved display is promoted to a local static one (and demoted if the seat is removed) and a new X-Server/greeter is spawned.

The code has been tested extensively, with a combination of [Radeon dedicated GPU|Intel iGPU], [Intel iGPU|Displaylink USB GPU] and others. For history of this patch, see https://bugzilla.redhat.com/show_bug.cgi?id=884271 and https://bugzilla.redhat.com/show_bug.cgi?id=975079</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Single seat system, several multiseat systems</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>kdm/backend/dm.h <span style="color: grey">(b2f8c61)</span></li>

 <li>kdm/backend/dm.c <span style="color: grey">(77a2ef7)</span></li>

 <li>kdm/backend/dpylist.c <span style="color: grey">(b650c2f)</span></li>

 <li>kdm/backend/resource.c <span style="color: grey">(38a8c70)</span></li>

 <li>kdm/config.def <span style="color: grey">(751c0ed)</span></li>

 <li>kdm/kfrontend/kdm_config.c <span style="color: grey">(368c8d1)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/112294/diff/" style="margin-left: 3em;">View Diff</a></p>







  </td>
 </tr>
</table>








  </div>
 </body>
</html>