[PATCH] Respect seat assignments when assigning drm devices to server

Hans de Goede hdegoede at redhat.com
Wed Jan 21 02:19:51 PST 2015


Hi,

On 19-01-15 16:02, Jonathan Dieter wrote:
> Currently xorg ignores the seat assignments for drm devices because the devices are initialized earlier in the code.  Depending on race conditions, the first X server will get more than one of the drm devices, which breaks multiseat systems.
>
> This patch fixes that by rejecting drm devices that haven't been assigned to our seat.  The code has been mostly taken from config/udev.c and modified.
>
> This patch is against HEAD, but also applies cleanly and has been tested against 1.16.2.901.

Thanks for the patch, I've one minor comment:

Can you please rewrite this bit:

+        if (SeatId && strcmp(dev_seat, SeatId)) {
+            LogMessage(X_INFO, "xfree86: Not adding drm device (%s): Wrong seat: %s\n", path, dev_seat);
+            udev_unref(udev);
+            udev_device_unref(udev_device);
+            goto out_free;
+        }
+
+        if (!SeatId && strcmp(dev_seat, "seat0")) {
+            LogMessage(X_INFO, "xfree86: Not adding drm device (%s): Wrong seat: %s\n", path, dev_seat);
+            udev_unref(udev);
+            udev_device_unref(udev_device);
+            goto out_free;
+        }

as:

+        if ((SeatId && strcmp(dev_seat, SeatId)) ||
+            (!SeatId && strcmp(dev_seat, "seat0"))) {
+            LogMessage(X_INFO, "xfree86: Not adding drm device (%s): Wrong seat: %s\n", path, dev_seat);
+            udev_unref(udev);
+            udev_device_unref(udev_device);
+            goto out_free;
+        }

And then post a v2.

Regards,

Hans

p.s.

It is easier for reviewers if you send patches inline, git send-email does this properly for you.


More information about the xorg-devel mailing list