]> git.proxmox.com Git - qemu.git/commitdiff
Merge remote-tracking branch 'qmp/queue/qmp' into staging
authorAnthony Liguori <aliguori@us.ibm.com>
Wed, 18 Jul 2012 19:44:37 +0000 (14:44 -0500)
committerAnthony Liguori <aliguori@us.ibm.com>
Wed, 18 Jul 2012 19:44:37 +0000 (14:44 -0500)
* qmp/queue/qmp:
  qapi: Convert getfd and closefd
  qapi: input_type_enum(): fix error message
  qmp: dump-guest-memory: improve schema doc

1  2 
monitor.c

diff --combined monitor.c
index 188c03d5b1a9af20af6ca3f142b04355cc7e1f90,522c88baf0534073d6568d6ab1ab33912a98177b..09aa3cdf5269f01d771b2d2f35a7f6b6073496c6
+++ b/monitor.c
@@@ -1262,24 -1262,45 +1262,24 @@@ static void do_print(Monitor *mon, cons
      int format = qdict_get_int(qdict, "format");
      target_phys_addr_t val = qdict_get_int(qdict, "val");
  
 -#if TARGET_PHYS_ADDR_BITS == 32
      switch(format) {
      case 'o':
 -        monitor_printf(mon, "%#o", val);
 +        monitor_printf(mon, "%#" TARGET_PRIoPHYS, val);
          break;
      case 'x':
 -        monitor_printf(mon, "%#x", val);
 +        monitor_printf(mon, "%#" TARGET_PRIxPHYS, val);
          break;
      case 'u':
 -        monitor_printf(mon, "%u", val);
 +        monitor_printf(mon, "%" TARGET_PRIuPHYS, val);
          break;
      default:
      case 'd':
 -        monitor_printf(mon, "%d", val);
 +        monitor_printf(mon, "%" TARGET_PRIdPHYS, val);
          break;
      case 'c':
          monitor_printc(mon, val);
          break;
      }
 -#else
 -    switch(format) {
 -    case 'o':
 -        monitor_printf(mon, "%#" PRIo64, val);
 -        break;
 -    case 'x':
 -        monitor_printf(mon, "%#" PRIx64, val);
 -        break;
 -    case 'u':
 -        monitor_printf(mon, "%" PRIu64, val);
 -        break;
 -    default:
 -    case 'd':
 -        monitor_printf(mon, "%" PRId64, val);
 -        break;
 -    case 'c':
 -        monitor_printc(mon, val);
 -        break;
 -    }
 -#endif
      monitor_printf(mon, "\n");
  }
  
@@@ -2307,48 -2328,45 +2307,45 @@@ static void do_inject_mce(Monitor *mon
  }
  #endif
  
static int do_getfd(Monitor *mon, const QDict *qdict, QObject **ret_data)
void qmp_getfd(const char *fdname, Error **errp)
  {
-     const char *fdname = qdict_get_str(qdict, "fdname");
      mon_fd_t *monfd;
      int fd;
  
-     fd = qemu_chr_fe_get_msgfd(mon->chr);
+     fd = qemu_chr_fe_get_msgfd(cur_mon->chr);
      if (fd == -1) {
-         qerror_report(QERR_FD_NOT_SUPPLIED);
-         return -1;
+         error_set(errp, QERR_FD_NOT_SUPPLIED);
+         return;
      }
  
      if (qemu_isdigit(fdname[0])) {
-         qerror_report(QERR_INVALID_PARAMETER_VALUE, "fdname",
-                       "a name not starting with a digit");
-         return -1;
+         error_set(errp, QERR_INVALID_PARAMETER_VALUE, "fdname",
+                   "a name not starting with a digit");
+         return;
      }
  
-     QLIST_FOREACH(monfd, &mon->fds, next) {
+     QLIST_FOREACH(monfd, &cur_mon->fds, next) {
          if (strcmp(monfd->name, fdname) != 0) {
              continue;
          }
  
          close(monfd->fd);
          monfd->fd = fd;
-         return 0;
+         return;
      }
  
      monfd = g_malloc0(sizeof(mon_fd_t));
      monfd->name = g_strdup(fdname);
      monfd->fd = fd;
  
-     QLIST_INSERT_HEAD(&mon->fds, monfd, next);
-     return 0;
+     QLIST_INSERT_HEAD(&cur_mon->fds, monfd, next);
  }
  
static int do_closefd(Monitor *mon, const QDict *qdict, QObject **ret_data)
void qmp_closefd(const char *fdname, Error **errp)
  {
-     const char *fdname = qdict_get_str(qdict, "fdname");
      mon_fd_t *monfd;
  
-     QLIST_FOREACH(monfd, &mon->fds, next) {
+     QLIST_FOREACH(monfd, &cur_mon->fds, next) {
          if (strcmp(monfd->name, fdname) != 0) {
              continue;
          }
          close(monfd->fd);
          g_free(monfd->name);
          g_free(monfd);
-         return 0;
+         return;
      }
  
-     qerror_report(QERR_FD_NOT_FOUND, fdname);
-     return -1;
+     error_set(errp, QERR_FD_NOT_FOUND, fdname);
  }
  
  static void do_loadvm(Monitor *mon, const QDict *qdict)