convert windows console chardev to QemuOpts.
[qemu] / monitor.c
index 9067bf0..f5f4d0e 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -61,7 +61,9 @@
  * 'l'          target long (32 or 64 bit)
  * '/'          optional gdb-like print format (like "/10x")
  *
- * '?'          optional type (for 'F', 's' and 'i')
+ * '?'          optional type (for all types, except '/')
+ * '.'          other form of optional type (for 'i' and 'l')
+ * '-'          optional parameter (eg. '-f')
  *
  */
 
@@ -2759,6 +2761,12 @@ static const mon_cmd_t *monitor_parse_command(Monitor *mon,
                 }
                 if (get_expr(mon, &val, &p))
                     goto fail;
+                /* Check if 'i' is greater than 32-bit */
+                if ((c == 'i') && ((val >> 32) & 0xffffffff)) {
+                    monitor_printf(mon, "\'%s\' has failed: ", cmdname);
+                    monitor_printf(mon, "integer is for 32-bit values\n");
+                    goto fail;
+                }
                 qdict_put(qdict, key, qint_from_int(val));
             }
             break;