All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][6/9] Restore command line parsing code from qemu-0.6.1
@ 2005-07-25 21:01 Arun Sharma
  0 siblings, 0 replies; only message in thread
From: Arun Sharma @ 2005-07-25 21:01 UTC (permalink / raw)
  To: Ian Pratt, Keir Fraser; +Cc: xen-devel

Restore command line parsing code from qemu-0.6.1

This enables cdrom ejection (both file based and physical i.e. /dev/cdrom)

Signed-off-by: Edwin Zhai <edwin.zhai@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>

diff -r 4499d41c8941 -r 640ee1c33782 tools/ioemu/monitor.c
--- a/tools/ioemu/monitor.c	Mon Jul 18 20:13:53 2005
+++ b/tools/ioemu/monitor.c	Mon Jul 18 20:59:46 2005
@@ -514,21 +514,45 @@
                 str_allocated[nb_args] = str;
             add_str:
                 if (nb_args >= MAX_ARGS) {
-#if 0
                 error_args:
-#endif
                     term_printf("%s: too many arguments\n", cmdname);
                     goto fail;
                 }
                 args[nb_args++] = str;
             }
             break;
+        case '-':
+            {
+                int has_option;
+                /* option */
+                
+                c = *typestr++;
+                if (c == '\0')
+                    goto bad_type;
+                while (isspace(*p)) 
+                    p++;
+                has_option = 0;
+                if (*p == '-') {
+                    p++;
+                    if (*p != c) {
+                        term_printf("%s: unsupported option -%c\n", 
+                                    cmdname, *p);
+                        goto fail;
+                    }
+                    p++;
+                    has_option = 1;
+                }
+                if (nb_args >= MAX_ARGS)
+                    goto error_args;
+                args[nb_args++] = (void *)has_option;
+            }
+            break;
         /* TODO: add more commands we need here to support vmx device model */
         case '/':
         case 'i':
-        case '-':
         default:
-            term_printf("%s: unknown type '%c', we only support quit command now.\n", cmdname, c);
+        bad_type:
+            term_printf("%s: unknown type '%c',not support now.\n", cmdname, c);
             goto fail;
         }
     }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-07-25 21:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-25 21:01 [PATCH][6/9] Restore command line parsing code from qemu-0.6.1 Arun Sharma

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.