[Spice-devel] [vdagentd] Add an explicit switch to signal fake uinput devices.

Jeremy White jwhite at codeweavers.com
Mon Jun 23 13:41:38 PDT 2014


Signed-off-by: Jeremy White <jwhite at codeweavers.com>
---
 src/vdagentd.c |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/vdagentd.c b/src/vdagentd.c
index 1098fb6..fa47997 100644
--- a/src/vdagentd.c
+++ b/src/vdagentd.c
@@ -756,6 +756,7 @@ static void usage(FILE *fp)
             "  -s <port>      set virtio serial port  [%s]\n"
             "  -S <filename>  set udcs socket [%s]\n"
             "  -u <dev>       set uinput device       [%s]\n"
+            "  -f             treat uinput device as fake; no ioctls\n"
             "  -x             don't daemonize\n"
 #ifdef HAVE_CONSOLE_KIT
             "  -X             Disable console kit integration\n"
@@ -865,7 +866,7 @@ int main(int argc, char *argv[])
     struct sigaction act;
 
     for (;;) {
-        if (-1 == (c = getopt(argc, argv, "-dhxXs:u:S:")))
+        if (-1 == (c = getopt(argc, argv, "-dhxXfs:u:S:")))
             break;
         switch (c) {
         case 'd':
@@ -880,6 +881,9 @@ int main(int argc, char *argv[])
         case 'u':
             uinput_device = optarg;
             break;
+        case 'f':
+            uinput_fake = 1;
+            break;
         case 'x':
             do_daemonize = 0;
             break;
@@ -896,11 +900,6 @@ int main(int argc, char *argv[])
         }
     }
 
-    if (strncmp(uinput_device, "/dev", 4) != 0) {
-        syslog(LOG_INFO, "using fake uinput");
-        uinput_fake = 1;
-    }
-
     memset(&act, 0, sizeof(act));
     act.sa_flags = SA_RESTART;
     act.sa_handler = quit_handler;
-- 
1.7.10.4



More information about the Spice-devel mailing list