X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=monitor.c;h=d17ae2d3b1ea25216f5468e8ac46890766724406;hb=a8170e5e97ad17ca169c64ba87ae2f53850dab4c;hp=c24235e90917c81f03549baf4a77470943823d4e;hpb=a9940fc4cba811adfb296fe07b247ee707265f90;p=mirror_qemu.git diff --git a/monitor.c b/monitor.c index c24235e909..d17ae2d3b1 100644 --- a/monitor.c +++ b/monitor.c @@ -450,6 +450,7 @@ static const char *monitor_event_names[] = { [QEVENT_SPICE_DISCONNECTED] = "SPICE_DISCONNECTED", [QEVENT_BLOCK_JOB_COMPLETED] = "BLOCK_JOB_COMPLETED", [QEVENT_BLOCK_JOB_CANCELLED] = "BLOCK_JOB_CANCELLED", + [QEVENT_BLOCK_JOB_ERROR] = "BLOCK_JOB_ERROR", [QEVENT_DEVICE_TRAY_MOVED] = "DEVICE_TRAY_MOVED", [QEVENT_SUSPEND] = "SUSPEND", [QEVENT_SUSPEND_DISK] = "SUSPEND_DISK", @@ -897,13 +898,7 @@ static void do_info_registers(Monitor *mon) { CPUArchState *env; env = mon_get_cpu(); -#ifdef TARGET_I386 - cpu_dump_state(env, (FILE *)mon, monitor_fprintf, - X86_DUMP_FPU); -#else - cpu_dump_state(env, (FILE *)mon, monitor_fprintf, - 0); -#endif + cpu_dump_state(env, (FILE *)mon, monitor_fprintf, CPU_DUMP_FPU); } static void do_info_jit(Monitor *mon) @@ -944,45 +939,6 @@ static void do_trace_print_events(Monitor *mon) trace_print_events((FILE *)mon, &monitor_fprintf); } -static int add_graphics_client(Monitor *mon, const QDict *qdict, QObject **ret_data) -{ - const char *protocol = qdict_get_str(qdict, "protocol"); - const char *fdname = qdict_get_str(qdict, "fdname"); - CharDriverState *s; - - if (strcmp(protocol, "spice") == 0) { - int fd = monitor_get_fd(mon, fdname, NULL); - int skipauth = qdict_get_try_bool(qdict, "skipauth", 0); - int tls = qdict_get_try_bool(qdict, "tls", 0); - if (!using_spice) { - /* correct one? spice isn't a device ,,, */ - qerror_report(QERR_DEVICE_NOT_ACTIVE, "spice"); - return -1; - } - if (qemu_spice_display_add_client(fd, skipauth, tls) < 0) { - close(fd); - } - return 0; -#ifdef CONFIG_VNC - } else if (strcmp(protocol, "vnc") == 0) { - int fd = monitor_get_fd(mon, fdname, NULL); - int skipauth = qdict_get_try_bool(qdict, "skipauth", 0); - vnc_display_add_client(NULL, fd, skipauth); - return 0; -#endif - } else if ((s = qemu_chr_find(protocol)) != NULL) { - int fd = monitor_get_fd(mon, fdname, NULL); - if (qemu_chr_add_client(s, fd) < 0) { - qerror_report(QERR_ADD_CLIENT_FAILED); - return -1; - } - return 0; - } - - qerror_report(QERR_INVALID_PARAMETER, "protocol"); - return -1; -} - static int client_migrate_info(Monitor *mon, const QDict *qdict, MonitorCompletion cb, void *opaque) { @@ -1103,7 +1059,7 @@ static void monitor_printc(Monitor *mon, int c) } static void memory_dump(Monitor *mon, int count, int format, int wsize, - target_phys_addr_t addr, int is_physical) + hwaddr addr, int is_physical) { CPUArchState *env; int l, line_size, i, max_digits, len; @@ -1237,7 +1193,7 @@ static void do_physical_memory_dump(Monitor *mon, const QDict *qdict) int count = qdict_get_int(qdict, "count"); int format = qdict_get_int(qdict, "format"); int size = qdict_get_int(qdict, "size"); - target_phys_addr_t addr = qdict_get_int(qdict, "addr"); + hwaddr addr = qdict_get_int(qdict, "addr"); memory_dump(mon, count, format, size, addr, 1); } @@ -1245,21 +1201,21 @@ static void do_physical_memory_dump(Monitor *mon, const QDict *qdict) static void do_print(Monitor *mon, const QDict *qdict) { int format = qdict_get_int(qdict, "format"); - target_phys_addr_t val = qdict_get_int(qdict, "val"); + hwaddr val = qdict_get_int(qdict, "val"); switch(format) { case 'o': - monitor_printf(mon, "%#" TARGET_PRIoPHYS, val); + monitor_printf(mon, "%#" HWADDR_PRIo, val); break; case 'x': - monitor_printf(mon, "%#" TARGET_PRIxPHYS, val); + monitor_printf(mon, "%#" HWADDR_PRIx, val); break; case 'u': - monitor_printf(mon, "%" TARGET_PRIuPHYS, val); + monitor_printf(mon, "%" HWADDR_PRIu, val); break; default: case 'd': - monitor_printf(mon, "%" TARGET_PRIdPHYS, val); + monitor_printf(mon, "%" HWADDR_PRId, val); break; case 'c': monitor_printc(mon, val); @@ -1381,9 +1337,9 @@ static void do_boot_set(Monitor *mon, const QDict *qdict) } #if defined(TARGET_I386) -static void print_pte(Monitor *mon, target_phys_addr_t addr, - target_phys_addr_t pte, - target_phys_addr_t mask) +static void print_pte(Monitor *mon, hwaddr addr, + hwaddr pte, + hwaddr mask) { #ifdef TARGET_X86_64 if (addr & (1ULL << 47)) { @@ -1452,7 +1408,7 @@ static void tlb_info_pae32(Monitor *mon, CPUArchState *env) if (pde & PG_PSE_MASK) { /* 2M pages with PAE, CR4.PSE is ignored */ print_pte(mon, (l1 << 30 ) + (l2 << 21), pde, - ~((target_phys_addr_t)(1 << 20) - 1)); + ~((hwaddr)(1 << 20) - 1)); } else { pt_addr = pde & 0x3fffffffff000ULL; for (l3 = 0; l3 < 512; l3++) { @@ -1462,7 +1418,7 @@ static void tlb_info_pae32(Monitor *mon, CPUArchState *env) print_pte(mon, (l1 << 30 ) + (l2 << 21) + (l3 << 12), pte & ~PG_PSE_MASK, - ~(target_phys_addr_t)0xfff); + ~(hwaddr)0xfff); } } } @@ -1554,9 +1510,9 @@ static void tlb_info(Monitor *mon) } } -static void mem_print(Monitor *mon, target_phys_addr_t *pstart, +static void mem_print(Monitor *mon, hwaddr *pstart, int *plast_prot, - target_phys_addr_t end, int prot) + hwaddr end, int prot) { int prot1; prot1 = *plast_prot; @@ -1582,7 +1538,7 @@ static void mem_info_32(Monitor *mon, CPUArchState *env) unsigned int l1, l2; int prot, last_prot; uint32_t pgd, pde, pte; - target_phys_addr_t start, end; + hwaddr start, end; pgd = env->cr[3] & ~0xfff; last_prot = 0; @@ -1615,7 +1571,7 @@ static void mem_info_32(Monitor *mon, CPUArchState *env) } } /* Flush last range */ - mem_print(mon, &start, &last_prot, (target_phys_addr_t)1 << 32, 0); + mem_print(mon, &start, &last_prot, (hwaddr)1 << 32, 0); } static void mem_info_pae32(Monitor *mon, CPUArchState *env) @@ -1624,7 +1580,7 @@ static void mem_info_pae32(Monitor *mon, CPUArchState *env) int prot, last_prot; uint64_t pdpe, pde, pte; uint64_t pdp_addr, pd_addr, pt_addr; - target_phys_addr_t start, end; + hwaddr start, end; pdp_addr = env->cr[3] & ~0x1f; last_prot = 0; @@ -1670,7 +1626,7 @@ static void mem_info_pae32(Monitor *mon, CPUArchState *env) } } /* Flush last range */ - mem_print(mon, &start, &last_prot, (target_phys_addr_t)1 << 32, 0); + mem_print(mon, &start, &last_prot, (hwaddr)1 << 32, 0); } @@ -1749,7 +1705,7 @@ static void mem_info_64(Monitor *mon, CPUArchState *env) } } /* Flush last range */ - mem_print(mon, &start, &last_prot, (target_phys_addr_t)1 << 48, 0); + mem_print(mon, &start, &last_prot, (hwaddr)1 << 48, 0); } #endif @@ -3262,11 +3218,7 @@ static int64_t expr_unary(Monitor *mon) break; default: errno = 0; -#if TARGET_PHYS_ADDR_BITS > 32 n = strtoull(pch, &p, 0); -#else - n = strtoul(pch, &p, 0); -#endif if (errno == ERANGE) { expr_error(mon, "number too large"); }