Compare commits
	
		
			70 Commits
		
	
	
		
			pull-vga-2
			...
			pull-gtk-6
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 341a034742 | ||
|  | d437074140 | ||
|  | db1da1f2b5 | ||
|  | 3d914488ae | ||
|  | 105923e08c | ||
|  | 9068f20dfb | ||
|  | a3f4d63d63 | ||
|  | f92d61f336 | ||
|  | e2da502c00 | ||
|  | 93156cef1c | ||
|  | 13de54eedd | ||
|  | a41b2c995b | ||
|  | d09a18d44d | ||
|  | 4a39cbb034 | ||
|  | b87b8a8b32 | ||
|  | 7a30842186 | ||
|  | b920cad669 | ||
|  | 00a9cacaea | ||
|  | b0f9300ca3 | ||
|  | 9057698d93 | ||
|  | d461863d3c | ||
|  | 7fb8b5d9c4 | ||
|  | 24c12b7923 | ||
|  | 6924bc1eef | ||
|  | a629f2fdba | ||
|  | 5d77c8f9b6 | ||
|  | a27b04577e | ||
|  | 296b14491a | ||
|  | 2d2ad6d090 | ||
|  | 6e1d3c1c85 | ||
|  | e96e5ae880 | ||
|  | eb6282f230 | ||
|  | e3f9bb011a | ||
|  | 8439761852 | ||
|  | 172fc4dd33 | ||
|  | f70edf9948 | ||
|  | 92de901290 | ||
|  | 4399c438a4 | ||
|  | 0fb6395c0c | ||
|  | a28315ebaf | ||
|  | 460787605e | ||
|  | 9974ad40bf | ||
|  | d1db760d7b | ||
|  | 1ba4b6a553 | ||
|  | 0b9f0e2fd7 | ||
|  | 1b7a0f758b | ||
|  | c20499d985 | ||
|  | c3481247e5 | ||
|  | 9083da1d4c | ||
|  | 638fb14169 | ||
|  | 2da1b3abbc | ||
|  | bfa40f77af | ||
|  | f7bdc41acc | ||
|  | 073a341151 | ||
|  | 0b15abfcbc | ||
|  | f231b88db1 | ||
|  | d73f0beadb | ||
|  | 4ad417baa4 | ||
|  | 4a66d3bf9a | ||
|  | d876f60d14 | ||
|  | 027a79c373 | ||
|  | 02d1608980 | ||
|  | f663faac3e | ||
|  | b925965294 | ||
|  | 16cf0b2b34 | ||
|  | 13a12f869b | ||
|  | 44b0c0bbb5 | ||
|  | 860643bc5a | ||
|  | 9ffd26859d | ||
|  | 8c0124490b | 
							
								
								
									
										18
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										18
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -18,8 +18,8 @@ | ||||
| /*-darwin-user | ||||
| /*-linux-user | ||||
| /*-bsd-user | ||||
| libdis* | ||||
| libuser | ||||
| /libdis* | ||||
| /libuser | ||||
| /linux-headers/asm | ||||
| /qga/qapi-generated | ||||
| /qapi-generated | ||||
| @@ -49,19 +49,9 @@ libuser | ||||
| /qemu-monitor.texi | ||||
| /qmp-commands.txt | ||||
| /vscclient | ||||
| /test-bitops | ||||
| /test-coroutine | ||||
| /test-int128 | ||||
| /test-opts-visitor | ||||
| /test-qmp-input-visitor | ||||
| /test-qmp-output-visitor | ||||
| /test-string-input-visitor | ||||
| /test-string-output-visitor | ||||
| /test-visitor-serialization | ||||
| /fsdev/virtfs-proxy-helper | ||||
| /fsdev/virtfs-proxy-helper.1 | ||||
| /fsdev/virtfs-proxy-helper.pod | ||||
| /.gdbinit | ||||
| *.a | ||||
| *.aux | ||||
| *.cp | ||||
| @@ -90,12 +80,8 @@ libuser | ||||
| *.pc | ||||
| .libs | ||||
| .sdk | ||||
| *.swp | ||||
| *.orig | ||||
| .pc | ||||
| *.gcda | ||||
| *.gcno | ||||
| patches | ||||
| /pc-bios/bios-pq/status | ||||
| /pc-bios/vgabios-pq/status | ||||
| /pc-bios/optionrom/linuxboot.asm | ||||
|   | ||||
| @@ -674,6 +674,8 @@ S: Supported | ||||
| F: block* | ||||
| F: block/ | ||||
| F: hw/block/ | ||||
| F: qemu-img* | ||||
| F: qemu-io* | ||||
| T: git git://repo.or.cz/qemu/kevin.git block | ||||
| T: git git://github.com/stefanha/qemu.git block | ||||
|  | ||||
|   | ||||
							
								
								
									
										35
									
								
								block.c
									
									
									
									
									
								
							
							
						
						
									
										35
									
								
								block.c
									
									
									
									
									
								
							| @@ -864,7 +864,7 @@ static int bdrv_open_common(BlockDriverState *bs, BlockDriverState *file, | ||||
|  | ||||
|     node_name = qdict_get_try_str(options, "node-name"); | ||||
|     bdrv_assign_node_name(bs, node_name, &local_err); | ||||
|     if (error_is_set(&local_err)) { | ||||
|     if (local_err) { | ||||
|         error_propagate(errp, local_err); | ||||
|         return -EINVAL; | ||||
|     } | ||||
| @@ -1068,14 +1068,14 @@ fail: | ||||
|  */ | ||||
| int bdrv_open_backing_file(BlockDriverState *bs, QDict *options, Error **errp) | ||||
| { | ||||
|     char backing_filename[PATH_MAX]; | ||||
|     int back_flags, ret; | ||||
|     char *backing_filename = g_malloc0(PATH_MAX); | ||||
|     int back_flags, ret = 0; | ||||
|     BlockDriver *back_drv = NULL; | ||||
|     Error *local_err = NULL; | ||||
|  | ||||
|     if (bs->backing_hd != NULL) { | ||||
|         QDECREF(options); | ||||
|         return 0; | ||||
|         goto free_exit; | ||||
|     } | ||||
|  | ||||
|     /* NULL means an empty set of options */ | ||||
| @@ -1088,10 +1088,9 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *options, Error **errp) | ||||
|         backing_filename[0] = '\0'; | ||||
|     } else if (bs->backing_file[0] == '\0' && qdict_size(options) == 0) { | ||||
|         QDECREF(options); | ||||
|         return 0; | ||||
|         goto free_exit; | ||||
|     } else { | ||||
|         bdrv_get_full_backing_filename(bs, backing_filename, | ||||
|                                        sizeof(backing_filename)); | ||||
|         bdrv_get_full_backing_filename(bs, backing_filename, PATH_MAX); | ||||
|     } | ||||
|  | ||||
|     if (bs->backing_format[0] != '\0') { | ||||
| @@ -1112,7 +1111,7 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *options, Error **errp) | ||||
|         error_setg(errp, "Could not open backing file: %s", | ||||
|                    error_get_pretty(local_err)); | ||||
|         error_free(local_err); | ||||
|         return ret; | ||||
|         goto free_exit; | ||||
|     } | ||||
|  | ||||
|     if (bs->backing_hd->file) { | ||||
| @@ -1123,7 +1122,9 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *options, Error **errp) | ||||
|     /* Recalculate the BlockLimits with the backing file */ | ||||
|     bdrv_refresh_limits(bs); | ||||
|  | ||||
|     return 0; | ||||
| free_exit: | ||||
|     g_free(backing_filename); | ||||
|     return ret; | ||||
| } | ||||
|  | ||||
| /* | ||||
| @@ -1180,8 +1181,7 @@ done: | ||||
| void bdrv_append_temp_snapshot(BlockDriverState *bs, Error **errp) | ||||
| { | ||||
|     /* TODO: extra byte is a hack to ensure MAX_PATH space on Windows. */ | ||||
|     char tmp_filename[PATH_MAX + 1]; | ||||
|  | ||||
|     char *tmp_filename = g_malloc0(PATH_MAX + 1); | ||||
|     int64_t total_size; | ||||
|     BlockDriver *bdrv_qcow2; | ||||
|     QEMUOptionParameter *create_options; | ||||
| @@ -1197,15 +1197,15 @@ void bdrv_append_temp_snapshot(BlockDriverState *bs, Error **errp) | ||||
|     total_size = bdrv_getlength(bs); | ||||
|     if (total_size < 0) { | ||||
|         error_setg_errno(errp, -total_size, "Could not get image size"); | ||||
|         return; | ||||
|         goto out; | ||||
|     } | ||||
|     total_size &= BDRV_SECTOR_MASK; | ||||
|  | ||||
|     /* Create the temporary image */ | ||||
|     ret = get_tmp_filename(tmp_filename, sizeof(tmp_filename)); | ||||
|     ret = get_tmp_filename(tmp_filename, PATH_MAX + 1); | ||||
|     if (ret < 0) { | ||||
|         error_setg_errno(errp, -ret, "Could not get temporary filename"); | ||||
|         return; | ||||
|         goto out; | ||||
|     } | ||||
|  | ||||
|     bdrv_qcow2 = bdrv_find_format("qcow2"); | ||||
| @@ -1221,7 +1221,7 @@ void bdrv_append_temp_snapshot(BlockDriverState *bs, Error **errp) | ||||
|                          "'%s': %s", tmp_filename, | ||||
|                          error_get_pretty(local_err)); | ||||
|         error_free(local_err); | ||||
|         return; | ||||
|         goto out; | ||||
|     } | ||||
|  | ||||
|     /* Prepare a new options QDict for the temporary file */ | ||||
| @@ -1238,10 +1238,13 @@ void bdrv_append_temp_snapshot(BlockDriverState *bs, Error **errp) | ||||
|                     bs->open_flags & ~BDRV_O_SNAPSHOT, bdrv_qcow2, &local_err); | ||||
|     if (ret < 0) { | ||||
|         error_propagate(errp, local_err); | ||||
|         return; | ||||
|         goto out; | ||||
|     } | ||||
|  | ||||
|     bdrv_append(bs_snapshot, bs); | ||||
|  | ||||
| out: | ||||
|     g_free(tmp_filename); | ||||
| } | ||||
|  | ||||
| /* | ||||
|   | ||||
| @@ -194,7 +194,7 @@ void commit_start(BlockDriverState *bs, BlockDriverState *base, | ||||
|     if ((on_error == BLOCKDEV_ON_ERROR_STOP || | ||||
|          on_error == BLOCKDEV_ON_ERROR_ENOSPC) && | ||||
|         !bdrv_iostatus_is_enabled(bs)) { | ||||
|         error_set(errp, QERR_INVALID_PARAMETER_COMBINATION); | ||||
|         error_setg(errp, "Invalid parameter combination"); | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -1095,16 +1095,15 @@ static struct scsi_task *iscsi_do_inquiry(struct iscsi_context *iscsi, int lun, | ||||
|     *inq = scsi_datain_unmarshall(task); | ||||
|     if (*inq == NULL) { | ||||
|         error_setg(errp, "iSCSI: failed to unmarshall inquiry datain blob"); | ||||
|         goto fail; | ||||
|         goto fail_with_err; | ||||
|     } | ||||
|  | ||||
|     return task; | ||||
|  | ||||
| fail: | ||||
|     if (!error_is_set(errp)) { | ||||
|         error_setg(errp, "iSCSI: Inquiry command failed : %s", | ||||
|                    iscsi_get_error(iscsi)); | ||||
|     } | ||||
|     error_setg(errp, "iSCSI: Inquiry command failed : %s", | ||||
|                iscsi_get_error(iscsi)); | ||||
| fail_with_err: | ||||
|     if (task != NULL) { | ||||
|         scsi_free_scsi_task(task); | ||||
|     } | ||||
|   | ||||
| @@ -680,7 +680,7 @@ void commit_active_start(BlockDriverState *bs, BlockDriverState *base, | ||||
|     mirror_start_job(bs, base, speed, 0, 0, | ||||
|                      on_error, on_error, cb, opaque, &local_err, | ||||
|                      &commit_active_job_driver, false, base); | ||||
|     if (error_is_set(&local_err)) { | ||||
|     if (local_err) { | ||||
|         error_propagate(errp, local_err); | ||||
|         goto error_restore_flags; | ||||
|     } | ||||
|   | ||||
| @@ -175,7 +175,7 @@ static void nbd_parse_filename(const char *filename, QDict *options, | ||||
|         InetSocketAddress *addr = NULL; | ||||
|  | ||||
|         addr = inet_parse(host_spec, errp); | ||||
|         if (error_is_set(errp)) { | ||||
|         if (!addr) { | ||||
|             goto out; | ||||
|         } | ||||
|  | ||||
|   | ||||
| @@ -343,7 +343,7 @@ static int nfs_file_open(BlockDriverState *bs, QDict *options, int flags, | ||||
|  | ||||
|     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort); | ||||
|     qemu_opts_absorb_qdict(opts, options, &local_err); | ||||
|     if (error_is_set(&local_err)) { | ||||
|     if (local_err) { | ||||
|         error_propagate(errp, local_err); | ||||
|         return -EINVAL; | ||||
|     } | ||||
|   | ||||
| @@ -753,7 +753,7 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags, | ||||
|  | ||||
|     opts = qemu_opts_create(&quorum_runtime_opts, NULL, 0, &error_abort); | ||||
|     qemu_opts_absorb_qdict(opts, options, &local_err); | ||||
|     if (error_is_set(&local_err)) { | ||||
|     if (local_err) { | ||||
|         ret = -EINVAL; | ||||
|         goto exit; | ||||
|     } | ||||
| @@ -828,7 +828,7 @@ close_exit: | ||||
|     g_free(opened); | ||||
| exit: | ||||
|     /* propagate error */ | ||||
|     if (error_is_set(&local_err)) { | ||||
|     if (local_err) { | ||||
|         error_propagate(errp, local_err); | ||||
|     } | ||||
|     QDECREF(list); | ||||
|   | ||||
							
								
								
									
										16
									
								
								blockdev.c
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								blockdev.c
									
									
									
									
									
								
							| @@ -1115,6 +1115,7 @@ typedef struct InternalSnapshotState { | ||||
| static void internal_snapshot_prepare(BlkTransactionState *common, | ||||
|                                       Error **errp) | ||||
| { | ||||
|     Error *local_err = NULL; | ||||
|     const char *device; | ||||
|     const char *name; | ||||
|     BlockDriverState *bs; | ||||
| @@ -1163,8 +1164,10 @@ static void internal_snapshot_prepare(BlkTransactionState *common, | ||||
|     } | ||||
|  | ||||
|     /* check whether a snapshot with name exist */ | ||||
|     ret = bdrv_snapshot_find_by_id_and_name(bs, NULL, name, &old_sn, errp); | ||||
|     if (error_is_set(errp)) { | ||||
|     ret = bdrv_snapshot_find_by_id_and_name(bs, NULL, name, &old_sn, | ||||
|                                             &local_err); | ||||
|     if (local_err) { | ||||
|         error_propagate(errp, local_err); | ||||
|         return; | ||||
|     } else if (ret) { | ||||
|         error_setg(errp, | ||||
| @@ -1520,14 +1523,16 @@ static void eject_device(BlockDriverState *bs, int force, Error **errp) | ||||
|         return; | ||||
|     } | ||||
|     if (!bdrv_dev_has_removable_media(bs)) { | ||||
|         error_set(errp, QERR_DEVICE_NOT_REMOVABLE, bdrv_get_device_name(bs)); | ||||
|         error_setg(errp, "Device '%s' is not removable", | ||||
|                    bdrv_get_device_name(bs)); | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     if (bdrv_dev_is_medium_locked(bs) && !bdrv_dev_is_tray_open(bs)) { | ||||
|         bdrv_dev_eject_request(bs, force); | ||||
|         if (!force) { | ||||
|             error_set(errp, QERR_DEVICE_LOCKED, bdrv_get_device_name(bs)); | ||||
|             error_setg(errp, "Device '%s' is locked", | ||||
|                        bdrv_get_device_name(bs)); | ||||
|             return; | ||||
|         } | ||||
|     } | ||||
| @@ -2219,7 +2224,8 @@ void qmp_block_job_cancel(const char *device, | ||||
|         return; | ||||
|     } | ||||
|     if (job->paused && !force) { | ||||
|         error_set(errp, QERR_BLOCK_JOB_PAUSED, device); | ||||
|         error_setg(errp, "The block job for device '%s' is currently paused", | ||||
|                    device); | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -88,7 +88,7 @@ void block_job_set_speed(BlockJob *job, int64_t speed, Error **errp) | ||||
|     Error *local_err = NULL; | ||||
|  | ||||
|     if (!job->driver->set_speed) { | ||||
|         error_set(errp, QERR_NOT_SUPPORTED); | ||||
|         error_set(errp, QERR_UNSUPPORTED); | ||||
|         return; | ||||
|     } | ||||
|     job->driver->set_speed(job, speed, &local_err); | ||||
|   | ||||
							
								
								
									
										10
									
								
								configure
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										10
									
								
								configure
									
									
									
									
										vendored
									
									
								
							| @@ -1087,7 +1087,10 @@ for opt do | ||||
|   ;; | ||||
|   --enable-quorum) quorum="yes" | ||||
|   ;; | ||||
|   *) echo "ERROR: unknown option $opt"; show_help="yes" | ||||
|   *) | ||||
|       echo "ERROR: unknown option $opt" | ||||
|       echo "Try '$0 --help' for more information" | ||||
|       exit 1 | ||||
|   ;; | ||||
|   esac | ||||
| done | ||||
| @@ -1230,6 +1233,7 @@ Advanced options (experts only): | ||||
|   --with-sdlabi            select preferred SDL ABI 1.2 or 2.0 | ||||
|   --disable-gtk            disable gtk UI | ||||
|   --enable-gtk             enable gtk UI | ||||
|   --with-gtkabi            select preferred GTK ABI 2.0 or 3.0 | ||||
|   --disable-virtfs         disable VirtFS | ||||
|   --enable-virtfs          enable VirtFS | ||||
|   --disable-vnc            disable VNC | ||||
| @@ -1353,7 +1357,7 @@ Advanced options (experts only): | ||||
|  | ||||
| NOTE: The object files are built at the place where configure is launched | ||||
| EOF | ||||
| exit 1 | ||||
| exit 0 | ||||
| fi | ||||
|  | ||||
| # Now we have handled --enable-tcg-interpreter and know we're not just | ||||
| @@ -4346,6 +4350,7 @@ if test "$modules" = "yes"; then | ||||
| fi | ||||
| if test "$sdl" = "yes" ; then | ||||
|   echo "CONFIG_SDL=y" >> $config_host_mak | ||||
|   echo "CONFIG_SDLABI=$sdlabi" >> $config_host_mak | ||||
|   echo "SDL_CFLAGS=$sdl_cflags" >> $config_host_mak | ||||
| fi | ||||
| if test "$cocoa" = "yes" ; then | ||||
| @@ -4429,6 +4434,7 @@ fi | ||||
| echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak | ||||
| if test "$gtk" = "yes" ; then | ||||
|   echo "CONFIG_GTK=y" >> $config_host_mak | ||||
|   echo "CONFIG_GTKABI=$gtkabi" >> $config_host_mak | ||||
|   echo "GTK_CFLAGS=$gtk_cflags" >> $config_host_mak | ||||
| fi | ||||
| if test "$vte" = "yes" ; then | ||||
|   | ||||
							
								
								
									
										2
									
								
								cpus.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								cpus.c
									
									
									
									
									
								
							| @@ -1454,7 +1454,7 @@ void qmp_pmemsave(int64_t addr, int64_t size, const char *filename, | ||||
|         l = sizeof(buf); | ||||
|         if (l > size) | ||||
|             l = size; | ||||
|         cpu_physical_memory_rw(addr, buf, l, 0); | ||||
|         cpu_physical_memory_read(addr, buf, l); | ||||
|         if (fwrite(buf, 1, l, f) != l) { | ||||
|             error_set(errp, QERR_IO_ERROR); | ||||
|             goto exit; | ||||
|   | ||||
| @@ -5,10 +5,9 @@ QEMU Standard VGA | ||||
| Exists in two variants, for isa and pci. | ||||
|  | ||||
| command line switches: | ||||
|     -vga std               [ picks isa for -M isapc, otherwise pci ] | ||||
|     -device VGA            [ pci variant ] | ||||
|     -device isa-vga        [ isa variant ] | ||||
|     -device secondary-vga  [ legacy-free pci variant ] | ||||
|     -vga std            [ picks isa for -M isapc, otherwise pci ] | ||||
|     -device VGA         [ pci variant ] | ||||
|     -device isa-vga     [ isa variant ] | ||||
|  | ||||
|  | ||||
| PCI spec | ||||
| @@ -32,15 +31,9 @@ PCI ROM Region: | ||||
|    Holds the vgabios (qemu 0.14+). | ||||
|  | ||||
|  | ||||
| The legacy-free variant has no ROM and has PCI_CLASS_DISPLAY_OTHER | ||||
| instead of PCI_CLASS_DISPLAY_VGA. | ||||
|  | ||||
|  | ||||
| IO ports used | ||||
| ------------- | ||||
|  | ||||
| Doesn't apply to the legacy-free pci variant, use the MMIO bar instead. | ||||
|  | ||||
| 03c0 - 03df : standard vga ports | ||||
| 01ce        : bochs vbe interface index port | ||||
| 01cf        : bochs vbe interface data port (x86 only) | ||||
|   | ||||
| @@ -311,7 +311,7 @@ void hmp_hello_world(Monitor *mon, const QDict *qdict) | ||||
|     Error *errp = NULL; | ||||
|  | ||||
|     qmp_hello_world(!!message, message, &errp); | ||||
|     if (error_is_set(&errp)) { | ||||
|     if (errp) { | ||||
|         monitor_printf(mon, "%s\n", error_get_pretty(errp)); | ||||
|         error_free(errp); | ||||
|         return; | ||||
| @@ -483,7 +483,7 @@ void hmp_info_alarm_clock(Monitor *mon) | ||||
|     Error *errp = NULL; | ||||
|  | ||||
|     clock = qmp_query_alarm_clock(&errp); | ||||
|     if (error_is_set(&errp)) { | ||||
|     if (errp) { | ||||
|         monitor_printf(mon, "Could not query alarm clock information\n"); | ||||
|         error_free(errp); | ||||
|         return; | ||||
| @@ -634,7 +634,7 @@ void hmp_info_alarm_methods(Monitor *mon) | ||||
|     Error *errp = NULL; | ||||
|  | ||||
|     method_list = qmp_query_alarm_methods(&errp); | ||||
|     if (error_is_set(&errp)) { | ||||
|     if (errp) { | ||||
|         monitor_printf(mon, "Could not query alarm methods\n"); | ||||
|         error_free(errp); | ||||
|         return; | ||||
|   | ||||
| @@ -760,6 +760,7 @@ static int proxy_socket(const char *path, uid_t uid, gid_t gid) | ||||
|         return -1; | ||||
|     } | ||||
|  | ||||
|     size = sizeof(qemu); | ||||
|     client = accept(sock, (struct sockaddr *)&qemu, &size); | ||||
|     if (client < 0) { | ||||
|         do_perror("accept"); | ||||
|   | ||||
| @@ -176,7 +176,7 @@ ETEXI | ||||
|  | ||||
|     { | ||||
|         .name       = "drive_del", | ||||
|         .args_type  = "id:s", | ||||
|         .args_type  = "id:B", | ||||
|         .params     = "device", | ||||
|         .help       = "remove host block device", | ||||
|         .user_print = monitor_user_noop, | ||||
| @@ -658,6 +658,7 @@ ETEXI | ||||
|         .help       = "add device, like -device on the command line", | ||||
|         .user_print = monitor_user_noop, | ||||
|         .mhandler.cmd_new = do_device_add, | ||||
|         .command_completion = device_add_completion, | ||||
|     }, | ||||
|  | ||||
| STEXI | ||||
| @@ -673,6 +674,7 @@ ETEXI | ||||
|         .params     = "device", | ||||
|         .help       = "remove device", | ||||
|         .mhandler.cmd = hmp_device_del, | ||||
|         .command_completion = device_del_completion, | ||||
|     }, | ||||
|  | ||||
| STEXI | ||||
| @@ -998,26 +1000,34 @@ ETEXI | ||||
|  | ||||
|     { | ||||
|         .name       = "dump-guest-memory", | ||||
|         .args_type  = "paging:-p,filename:F,begin:i?,length:i?", | ||||
|         .params     = "[-p] filename [begin] [length]", | ||||
|         .help       = "dump guest memory to file" | ||||
|                       "\n\t\t\t begin(optional): the starting physical address" | ||||
|                       "\n\t\t\t length(optional): the memory size, in bytes", | ||||
|         .args_type  = "paging:-p,zlib:-z,lzo:-l,snappy:-s,filename:F,begin:i?,length:i?", | ||||
|         .params     = "[-p] [-z|-l|-s] filename [begin length]", | ||||
|         .help       = "dump guest memory into file 'filename'.\n\t\t\t" | ||||
|                       "-p: do paging to get guest's memory mapping.\n\t\t\t" | ||||
|                       "-z: dump in kdump-compressed format, with zlib compression.\n\t\t\t" | ||||
|                       "-l: dump in kdump-compressed format, with lzo compression.\n\t\t\t" | ||||
|                       "-s: dump in kdump-compressed format, with snappy compression.\n\t\t\t" | ||||
|                       "begin: the starting physical address.\n\t\t\t" | ||||
|                       "length: the memory size, in bytes.", | ||||
|         .mhandler.cmd = hmp_dump_guest_memory, | ||||
|     }, | ||||
|  | ||||
|  | ||||
| STEXI | ||||
| @item dump-guest-memory [-p] @var{protocol} @var{begin} @var{length} | ||||
| @item dump-guest-memory [-p] @var{filename} @var{begin} @var{length} | ||||
| @item dump-guest-memory [-z|-l|-s] @var{filename} | ||||
| @findex dump-guest-memory | ||||
| Dump guest memory to @var{protocol}. The file can be processed with crash or | ||||
| gdb. | ||||
|   filename: dump file name | ||||
|     paging: do paging to get guest's memory mapping | ||||
| gdb. Without -z|-l|-s, the dump format is ELF. | ||||
|         -p: do paging to get guest's memory mapping. | ||||
|         -z: dump in kdump-compressed format, with zlib compression. | ||||
|         -l: dump in kdump-compressed format, with lzo compression. | ||||
|         -s: dump in kdump-compressed format, with snappy compression. | ||||
|   filename: dump file name. | ||||
|      begin: the starting physical address. It's optional, and should be | ||||
|             specified with length together. | ||||
|             specified together with length. | ||||
|     length: the memory size, in bytes. It's optional, and should be specified | ||||
|             with begin together. | ||||
|             together with begin. | ||||
| ETEXI | ||||
|  | ||||
|     { | ||||
| @@ -1254,6 +1264,7 @@ ETEXI | ||||
|         .params     = "[qom-type=]type,id=str[,prop=value][,...]", | ||||
|         .help       = "create QOM object", | ||||
|         .mhandler.cmd = hmp_object_add, | ||||
|         .command_completion = object_add_completion, | ||||
|     }, | ||||
|  | ||||
| STEXI | ||||
| @@ -1268,6 +1279,7 @@ ETEXI | ||||
|         .params     = "id", | ||||
|         .help       = "destroy QOM object", | ||||
|         .mhandler.cmd = hmp_object_del, | ||||
|         .command_completion = object_del_completion, | ||||
|     }, | ||||
|  | ||||
| STEXI | ||||
|   | ||||
							
								
								
									
										25
									
								
								hmp.c
									
									
									
									
									
								
							
							
						
						
									
										25
									
								
								hmp.c
									
									
									
									
									
								
							| @@ -1308,16 +1308,35 @@ void hmp_dump_guest_memory(Monitor *mon, const QDict *qdict) | ||||
| { | ||||
|     Error *errp = NULL; | ||||
|     int paging = qdict_get_try_bool(qdict, "paging", 0); | ||||
|     int zlib = qdict_get_try_bool(qdict, "zlib", 0); | ||||
|     int lzo = qdict_get_try_bool(qdict, "lzo", 0); | ||||
|     int snappy = qdict_get_try_bool(qdict, "snappy", 0); | ||||
|     const char *file = qdict_get_str(qdict, "filename"); | ||||
|     bool has_begin = qdict_haskey(qdict, "begin"); | ||||
|     bool has_length = qdict_haskey(qdict, "length"); | ||||
|     /* kdump-compressed format is not supported for HMP */ | ||||
|     bool has_format = false; | ||||
|     int64_t begin = 0; | ||||
|     int64_t length = 0; | ||||
|     enum DumpGuestMemoryFormat dump_format = DUMP_GUEST_MEMORY_FORMAT_ELF; | ||||
|     char *prot; | ||||
|  | ||||
|     if (zlib + lzo + snappy > 1) { | ||||
|         error_setg(&errp, "only one of '-z|-l|-s' can be set"); | ||||
|         hmp_handle_error(mon, &errp); | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     if (zlib) { | ||||
|         dump_format = DUMP_GUEST_MEMORY_FORMAT_KDUMP_ZLIB; | ||||
|     } | ||||
|  | ||||
|     if (lzo) { | ||||
|         dump_format = DUMP_GUEST_MEMORY_FORMAT_KDUMP_LZO; | ||||
|     } | ||||
|  | ||||
|     if (snappy) { | ||||
|         dump_format = DUMP_GUEST_MEMORY_FORMAT_KDUMP_SNAPPY; | ||||
|     } | ||||
|  | ||||
|     if (has_begin) { | ||||
|         begin = qdict_get_int(qdict, "begin"); | ||||
|     } | ||||
| @@ -1328,7 +1347,7 @@ void hmp_dump_guest_memory(Monitor *mon, const QDict *qdict) | ||||
|     prot = g_strconcat("file:", file, NULL); | ||||
|  | ||||
|     qmp_dump_guest_memory(paging, prot, has_begin, begin, has_length, length, | ||||
|                           has_format, dump_format, &errp); | ||||
|                           true, dump_format, &errp); | ||||
|     hmp_handle_error(mon, &errp); | ||||
|     g_free(prot); | ||||
| } | ||||
|   | ||||
							
								
								
									
										5
									
								
								hmp.h
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								hmp.h
									
									
									
									
									
								
							| @@ -15,6 +15,7 @@ | ||||
| #define HMP_H | ||||
|  | ||||
| #include "qemu-common.h" | ||||
| #include "qemu/readline.h" | ||||
| #include "qapi-types.h" | ||||
| #include "qapi/qmp/qdict.h" | ||||
|  | ||||
| @@ -92,5 +93,9 @@ void hmp_qemu_io(Monitor *mon, const QDict *qdict); | ||||
| void hmp_cpu_add(Monitor *mon, const QDict *qdict); | ||||
| void hmp_object_add(Monitor *mon, const QDict *qdict); | ||||
| void hmp_object_del(Monitor *mon, const QDict *qdict); | ||||
| void object_add_completion(ReadLineState *rs, int nb_args, const char *str); | ||||
| void object_del_completion(ReadLineState *rs, int nb_args, const char *str); | ||||
| void device_add_completion(ReadLineState *rs, int nb_args, const char *str); | ||||
| void device_del_completion(ReadLineState *rs, int nb_args, const char *str); | ||||
|  | ||||
| #endif | ||||
|   | ||||
| @@ -987,8 +987,9 @@ static void v9fs_attach(void *opaque) | ||||
|      */ | ||||
|     if (!s->migration_blocker) { | ||||
|         s->root_fid = fid; | ||||
|         error_set(&s->migration_blocker, QERR_VIRTFS_FEATURE_BLOCKS_MIGRATION, | ||||
|                   s->ctx.fs_root ? s->ctx.fs_root : "NULL", s->tag); | ||||
|         error_setg(&s->migration_blocker, | ||||
|                    "Migration is disabled when VirtFS export path '%s' is mounted in the guest using mount_tag '%s'", | ||||
|                    s->ctx.fs_root ? s->ctx.fs_root : "NULL", s->tag); | ||||
|         migrate_add_blocker(s->migration_blocker); | ||||
|     } | ||||
| out: | ||||
|   | ||||
| @@ -587,8 +587,9 @@ static void set_blocksize(Object *obj, Visitor *v, void *opaque, | ||||
|  | ||||
|     /* We rely on power-of-2 blocksizes for bitmasks */ | ||||
|     if ((value & (value - 1)) != 0) { | ||||
|         error_set(errp, QERR_PROPERTY_VALUE_NOT_POWER_OF_2, | ||||
|                   dev->id?:"", name, (int64_t)value); | ||||
|         error_setg(errp, | ||||
|                   "Property %s.%s doesn't take value '%" PRId64 "', it's not a power of 2", | ||||
|                   dev->id ?: "", name, (int64_t)value); | ||||
|         return; | ||||
|     } | ||||
|  | ||||
| @@ -853,7 +854,7 @@ void error_set_from_qdev_prop_error(Error **errp, int ret, DeviceState *dev, | ||||
| { | ||||
|     switch (ret) { | ||||
|     case -EEXIST: | ||||
|         error_set(errp, QERR_PROPERTY_VALUE_IN_USE, | ||||
|         error_setg(errp, "Property '%s.%s' can't take value '%s', it's in use", | ||||
|                   object_get_typename(OBJECT(dev)), prop->name, value); | ||||
|         break; | ||||
|     default: | ||||
| @@ -862,7 +863,7 @@ void error_set_from_qdev_prop_error(Error **errp, int ret, DeviceState *dev, | ||||
|                   object_get_typename(OBJECT(dev)), prop->name, value); | ||||
|         break; | ||||
|     case -ENOENT: | ||||
|         error_set(errp, QERR_PROPERTY_VALUE_NOT_FOUND, | ||||
|         error_setg(errp, "Property '%s.%s' can't find value '%s'", | ||||
|                   object_get_typename(OBJECT(dev)), prop->name, value); | ||||
|         break; | ||||
|     case 0: | ||||
|   | ||||
| @@ -2913,7 +2913,7 @@ static void isa_cirrus_vga_realizefn(DeviceState *dev, Error **errp) | ||||
|     ISACirrusVGAState *d = ISA_CIRRUS_VGA(dev); | ||||
|     VGACommonState *s = &d->cirrus_vga.vga; | ||||
|  | ||||
|     vga_common_init(s, OBJECT(dev), true); | ||||
|     vga_common_init(s, OBJECT(dev)); | ||||
|     cirrus_init_common(&d->cirrus_vga, OBJECT(dev), CIRRUS_ID_CLGD5430, 0, | ||||
|                        isa_address_space(isadev), | ||||
|                        isa_address_space_io(isadev)); | ||||
| @@ -2960,7 +2960,7 @@ static int pci_cirrus_vga_initfn(PCIDevice *dev) | ||||
|      int16_t device_id = pc->device_id; | ||||
|  | ||||
|      /* setup VGA */ | ||||
|      vga_common_init(&s->vga, OBJECT(dev), true); | ||||
|      vga_common_init(&s->vga, OBJECT(dev)); | ||||
|      cirrus_init_common(s, OBJECT(dev), device_id, 1, pci_address_space(dev), | ||||
|                         pci_address_space_io(dev)); | ||||
|      s->vga.con = graphic_console_init(DEVICE(dev), 0, s->vga.hw_ops, &s->vga); | ||||
|   | ||||
| @@ -2061,7 +2061,7 @@ static int qxl_init_primary(PCIDevice *dev) | ||||
|     qxl->id = 0; | ||||
|     qxl_init_ramsize(qxl); | ||||
|     vga->vram_size_mb = qxl->vga.vram_size >> 20; | ||||
|     vga_common_init(vga, OBJECT(dev), true); | ||||
|     vga_common_init(vga, OBJECT(dev)); | ||||
|     vga_init(vga, OBJECT(dev), | ||||
|              pci_address_space(dev), pci_address_space_io(dev), false); | ||||
|     portio_list_init(qxl_vga_port_list, OBJECT(dev), qxl_vga_portio_list, | ||||
|   | ||||
| @@ -132,7 +132,7 @@ int isa_vga_mm_init(hwaddr vram_base, | ||||
|     s = g_malloc0(sizeof(*s)); | ||||
|  | ||||
|     s->vga.vram_size_mb = VGA_RAM_SIZE >> 20; | ||||
|     vga_common_init(&s->vga, NULL, true); | ||||
|     vga_common_init(&s->vga, NULL); | ||||
|     vga_mm_init(s, vram_base, ctrl_base, it_shift, address_space); | ||||
|  | ||||
|     s->vga.con = graphic_console_init(NULL, 0, s->vga.hw_ops, s); | ||||
|   | ||||
| @@ -56,7 +56,7 @@ static void vga_isa_realizefn(DeviceState *dev, Error **errp) | ||||
|     MemoryRegion *vga_io_memory; | ||||
|     const MemoryRegionPortio *vga_ports, *vbe_ports; | ||||
|  | ||||
|     vga_common_init(s, OBJECT(dev), true); | ||||
|     vga_common_init(s, OBJECT(dev)); | ||||
|     s->legacy_address_space = isa_address_space(isadev); | ||||
|     vga_io_memory = vga_init_io(s, OBJECT(dev), &vga_ports, &vbe_ports); | ||||
|     isa_register_portio_list(isadev, 0x3b0, vga_ports, s, "vga"); | ||||
|   | ||||
| @@ -147,7 +147,7 @@ static int pci_std_vga_initfn(PCIDevice *dev) | ||||
|     VGACommonState *s = &d->vga; | ||||
|  | ||||
|     /* vga + console init */ | ||||
|     vga_common_init(s, OBJECT(dev), true); | ||||
|     vga_common_init(s, OBJECT(dev)); | ||||
|     vga_init(s, OBJECT(dev), pci_address_space(dev), pci_address_space_io(dev), | ||||
|              true); | ||||
|  | ||||
| @@ -179,51 +179,12 @@ static int pci_std_vga_initfn(PCIDevice *dev) | ||||
|     return 0; | ||||
| } | ||||
|  | ||||
| static int pci_secondary_vga_initfn(PCIDevice *dev) | ||||
| { | ||||
|     PCIVGAState *d = DO_UPCAST(PCIVGAState, dev, dev); | ||||
|     VGACommonState *s = &d->vga; | ||||
|  | ||||
|     /* vga + console init */ | ||||
|     vga_common_init(s, OBJECT(dev), false); | ||||
|     s->con = graphic_console_init(DEVICE(dev), 0, s->hw_ops, s); | ||||
|  | ||||
|     /* mmio bar */ | ||||
|     memory_region_init(&d->mmio, OBJECT(dev), "vga.mmio", 4096); | ||||
|     memory_region_init_io(&d->ioport, OBJECT(dev), &pci_vga_ioport_ops, d, | ||||
|                           "vga ioports remapped", PCI_VGA_IOPORT_SIZE); | ||||
|     memory_region_init_io(&d->bochs, OBJECT(dev), &pci_vga_bochs_ops, d, | ||||
|                           "bochs dispi interface", PCI_VGA_BOCHS_SIZE); | ||||
|  | ||||
|     memory_region_add_subregion(&d->mmio, PCI_VGA_IOPORT_OFFSET, | ||||
|                                 &d->ioport); | ||||
|     memory_region_add_subregion(&d->mmio, PCI_VGA_BOCHS_OFFSET, | ||||
|                                 &d->bochs); | ||||
|  | ||||
|     pci_register_bar(&d->dev, 0, PCI_BASE_ADDRESS_MEM_PREFETCH, &s->vram); | ||||
|     pci_register_bar(&d->dev, 2, PCI_BASE_ADDRESS_SPACE_MEMORY, &d->mmio); | ||||
|  | ||||
|     return 0; | ||||
| } | ||||
|  | ||||
| static void pci_secondary_vga_reset(DeviceState *dev) | ||||
| { | ||||
|     PCIVGAState *d = DO_UPCAST(PCIVGAState, dev.qdev, dev); | ||||
|  | ||||
|     vga_common_reset(&d->vga); | ||||
| } | ||||
|  | ||||
| static Property vga_pci_properties[] = { | ||||
|     DEFINE_PROP_UINT32("vgamem_mb", PCIVGAState, vga.vram_size_mb, 16), | ||||
|     DEFINE_PROP_BIT("mmio", PCIVGAState, flags, PCI_VGA_FLAG_ENABLE_MMIO, true), | ||||
|     DEFINE_PROP_END_OF_LIST(), | ||||
| }; | ||||
|  | ||||
| static Property secondary_pci_properties[] = { | ||||
|     DEFINE_PROP_UINT32("vgamem_mb", PCIVGAState, vga.vram_size_mb, 16), | ||||
|     DEFINE_PROP_END_OF_LIST(), | ||||
| }; | ||||
|  | ||||
| static void vga_class_init(ObjectClass *klass, void *data) | ||||
| { | ||||
|     DeviceClass *dc = DEVICE_CLASS(klass); | ||||
| @@ -240,20 +201,6 @@ static void vga_class_init(ObjectClass *klass, void *data) | ||||
|     set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); | ||||
| } | ||||
|  | ||||
| static void secondary_class_init(ObjectClass *klass, void *data) | ||||
| { | ||||
|     DeviceClass *dc = DEVICE_CLASS(klass); | ||||
|     PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); | ||||
|  | ||||
|     k->init = pci_secondary_vga_initfn; | ||||
|     k->vendor_id = PCI_VENDOR_ID_QEMU; | ||||
|     k->device_id = PCI_DEVICE_ID_QEMU_VGA; | ||||
|     k->class_id = PCI_CLASS_DISPLAY_OTHER; | ||||
|     dc->vmsd = &vmstate_vga_pci; | ||||
|     dc->props = secondary_pci_properties; | ||||
|     dc->reset = pci_secondary_vga_reset; | ||||
| } | ||||
|  | ||||
| static const TypeInfo vga_info = { | ||||
|     .name          = "VGA", | ||||
|     .parent        = TYPE_PCI_DEVICE, | ||||
| @@ -261,17 +208,9 @@ static const TypeInfo vga_info = { | ||||
|     .class_init    = vga_class_init, | ||||
| }; | ||||
|  | ||||
| static const TypeInfo secondary_info = { | ||||
|     .name          = "secondary-vga", | ||||
|     .parent        = TYPE_PCI_DEVICE, | ||||
|     .instance_size = sizeof(PCIVGAState), | ||||
|     .class_init    = secondary_class_init, | ||||
| }; | ||||
|  | ||||
| static void vga_register_types(void) | ||||
| { | ||||
|     type_register_static(&vga_info); | ||||
|     type_register_static(&secondary_info); | ||||
| } | ||||
|  | ||||
| type_init(vga_register_types) | ||||
|   | ||||
| @@ -171,10 +171,6 @@ static void vga_update_memory_access(VGACommonState *s) | ||||
|     MemoryRegion *region, *old_region = s->chain4_alias; | ||||
|     hwaddr base, offset, size; | ||||
|  | ||||
|     if (s->legacy_address_space == NULL) { | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     s->chain4_alias = NULL; | ||||
|  | ||||
|     if ((s->sr[VGA_SEQ_PLANE_WRITE] & VGA_SR02_ALL_PLANES) == | ||||
| @@ -2256,7 +2252,7 @@ static const GraphicHwOps vga_ops = { | ||||
|     .text_update = vga_update_text, | ||||
| }; | ||||
|  | ||||
| void vga_common_init(VGACommonState *s, Object *obj, bool global_vmstate) | ||||
| void vga_common_init(VGACommonState *s, Object *obj) | ||||
| { | ||||
|     int i, j, v, b; | ||||
|  | ||||
| @@ -2293,7 +2289,7 @@ void vga_common_init(VGACommonState *s, Object *obj, bool global_vmstate) | ||||
|  | ||||
|     s->is_vbe_vmstate = 1; | ||||
|     memory_region_init_ram(&s->vram, obj, "vga.vram", s->vram_size); | ||||
|     vmstate_register_ram(&s->vram, global_vmstate ? NULL : DEVICE(obj)); | ||||
|     vmstate_register_ram_global(&s->vram); | ||||
|     xen_register_framebuffer(&s->vram); | ||||
|     s->vram_ptr = memory_region_get_ram_ptr(&s->vram); | ||||
|     s->get_bpp = vga_get_bpp; | ||||
|   | ||||
| @@ -177,7 +177,7 @@ static inline int c6_to_8(int v) | ||||
|     return (v << 2) | (b << 1) | b; | ||||
| } | ||||
|  | ||||
| void vga_common_init(VGACommonState *s, Object *obj, bool global_vmstate); | ||||
| void vga_common_init(VGACommonState *s, Object *obj); | ||||
| void vga_init(VGACommonState *s, Object *obj, MemoryRegion *address_space, | ||||
|               MemoryRegion *address_space_io, bool init_vga_ports); | ||||
| MemoryRegion *vga_init_io(VGACommonState *s, Object *obj, | ||||
|   | ||||
| @@ -1207,7 +1207,7 @@ static void vmsvga_init(DeviceState *dev, struct vmsvga_state_s *s, | ||||
|     vmstate_register_ram_global(&s->fifo_ram); | ||||
|     s->fifo_ptr = memory_region_get_ram_ptr(&s->fifo_ram); | ||||
|  | ||||
|     vga_common_init(&s->vga, OBJECT(dev), true); | ||||
|     vga_common_init(&s->vga, OBJECT(dev)); | ||||
|     vga_init(&s->vga, OBJECT(dev), address_space, io, true); | ||||
|     vmstate_register(NULL, 0, &vmstate_vga_common, &s->vga); | ||||
|     s->new_depth = 32; | ||||
|   | ||||
| @@ -124,14 +124,14 @@ static const TPRInstruction tpr_instr[] = { | ||||
|  | ||||
| static void read_guest_rom_state(VAPICROMState *s) | ||||
| { | ||||
|     cpu_physical_memory_rw(s->rom_state_paddr, (void *)&s->rom_state, | ||||
|                            sizeof(GuestROMState), 0); | ||||
|     cpu_physical_memory_read(s->rom_state_paddr, &s->rom_state, | ||||
|                              sizeof(GuestROMState)); | ||||
| } | ||||
|  | ||||
| static void write_guest_rom_state(VAPICROMState *s) | ||||
| { | ||||
|     cpu_physical_memory_rw(s->rom_state_paddr, (void *)&s->rom_state, | ||||
|                            sizeof(GuestROMState), 1); | ||||
|     cpu_physical_memory_write(s->rom_state_paddr, &s->rom_state, | ||||
|                               sizeof(GuestROMState)); | ||||
| } | ||||
|  | ||||
| static void update_guest_rom_state(VAPICROMState *s) | ||||
| @@ -311,16 +311,14 @@ static int update_rom_mapping(VAPICROMState *s, CPUX86State *env, target_ulong i | ||||
|     for (pos = le32_to_cpu(s->rom_state.fixup_start); | ||||
|          pos < le32_to_cpu(s->rom_state.fixup_end); | ||||
|          pos += 4) { | ||||
|         cpu_physical_memory_rw(paddr + pos - s->rom_state.vaddr, | ||||
|                                (void *)&offset, sizeof(offset), 0); | ||||
|         cpu_physical_memory_read(paddr + pos - s->rom_state.vaddr, | ||||
|                                  &offset, sizeof(offset)); | ||||
|         offset = le32_to_cpu(offset); | ||||
|         cpu_physical_memory_rw(paddr + offset, (void *)&patch, | ||||
|                                sizeof(patch), 0); | ||||
|         cpu_physical_memory_read(paddr + offset, &patch, sizeof(patch)); | ||||
|         patch = le32_to_cpu(patch); | ||||
|         patch += rom_state_vaddr - le32_to_cpu(s->rom_state.vaddr); | ||||
|         patch = cpu_to_le32(patch); | ||||
|         cpu_physical_memory_rw(paddr + offset, (void *)&patch, | ||||
|                                sizeof(patch), 1); | ||||
|         cpu_physical_memory_write(paddr + offset, &patch, sizeof(patch)); | ||||
|     } | ||||
|     read_guest_rom_state(s); | ||||
|     s->vapic_paddr = paddr + le32_to_cpu(s->rom_state.vapic_vaddr) - | ||||
| @@ -364,8 +362,8 @@ static int vapic_enable(VAPICROMState *s, X86CPU *cpu) | ||||
|     } | ||||
|     vapic_paddr = s->vapic_paddr + | ||||
|         (((hwaddr)cpu_number) << VAPIC_CPU_SHIFT); | ||||
|     cpu_physical_memory_rw(vapic_paddr + offsetof(VAPICState, enabled), | ||||
|                            (void *)&enabled, sizeof(enabled), 1); | ||||
|     cpu_physical_memory_write(vapic_paddr + offsetof(VAPICState, enabled), | ||||
|                               &enabled, sizeof(enabled)); | ||||
|     apic_enable_vapic(cpu->apic_state, vapic_paddr); | ||||
|  | ||||
|     s->state = VAPIC_ACTIVE; | ||||
| @@ -535,7 +533,7 @@ static int patch_hypercalls(VAPICROMState *s) | ||||
|     uint8_t *rom; | ||||
|  | ||||
|     rom = g_malloc(s->rom_size); | ||||
|     cpu_physical_memory_rw(rom_paddr, rom, s->rom_size, 0); | ||||
|     cpu_physical_memory_read(rom_paddr, rom, s->rom_size); | ||||
|  | ||||
|     for (pos = 0; pos < s->rom_size - sizeof(vmcall_pattern); pos++) { | ||||
|         if (kvm_irqchip_in_kernel()) { | ||||
| @@ -551,8 +549,7 @@ static int patch_hypercalls(VAPICROMState *s) | ||||
|         } | ||||
|         if (memcmp(rom + pos, pattern, 7) == 0 && | ||||
|             (rom[pos + 7] == alternates[0] || rom[pos + 7] == alternates[1])) { | ||||
|             cpu_physical_memory_rw(rom_paddr + pos + 5, (uint8_t *)patch, | ||||
|                                    3, 1); | ||||
|             cpu_physical_memory_write(rom_paddr + pos + 5, patch, 3); | ||||
|             /* | ||||
|              * Don't flush the tb here. Under ordinary conditions, the patched | ||||
|              * calls are miles away from the current IP. Under malicious | ||||
| @@ -760,8 +757,8 @@ static int vapic_post_load(void *opaque, int version_id) | ||||
|             run_on_cpu(first_cpu, do_vapic_enable, s); | ||||
|         } else { | ||||
|             zero = g_malloc0(s->rom_state.vapic_size); | ||||
|             cpu_physical_memory_rw(s->vapic_paddr, zero, | ||||
|                                    s->rom_state.vapic_size, 1); | ||||
|             cpu_physical_memory_write(s->vapic_paddr, zero, | ||||
|                                       s->rom_state.vapic_size); | ||||
|             g_free(zero); | ||||
|         } | ||||
|     } | ||||
|   | ||||
| @@ -98,8 +98,8 @@ static void apic_sync_vapic(APICCommonState *s, int sync_type) | ||||
|         return; | ||||
|     } | ||||
|     if (sync_type & SYNC_FROM_VAPIC) { | ||||
|         cpu_physical_memory_rw(s->vapic_paddr, (void *)&vapic_state, | ||||
|                                sizeof(vapic_state), 0); | ||||
|         cpu_physical_memory_read(s->vapic_paddr, &vapic_state, | ||||
|                                  sizeof(vapic_state)); | ||||
|         s->tpr = vapic_state.tpr; | ||||
|     } | ||||
|     if (sync_type & (SYNC_TO_VAPIC | SYNC_ISR_IRR_TO_VAPIC)) { | ||||
|   | ||||
| @@ -684,8 +684,8 @@ static int pci_ivshmem_init(PCIDevice *dev) | ||||
|     } | ||||
|  | ||||
|     if (s->role_val == IVSHMEM_PEER) { | ||||
|         error_set(&s->migration_blocker, QERR_DEVICE_FEATURE_BLOCKS_MIGRATION, | ||||
|                   "peer mode", "ivshmem"); | ||||
|         error_setg(&s->migration_blocker, | ||||
|                    "Migration is disabled when using feature 'peer mode' in device 'ivshmem'"); | ||||
|         migrate_add_blocker(s->migration_blocker); | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -718,7 +718,6 @@ static void pcnet_s_reset(PCNetState *s) | ||||
|     s->csr[94]  = 0x0000; | ||||
|     s->csr[100] = 0x0200; | ||||
|     s->csr[103] = 0x0105; | ||||
|     s->csr[103] = 0x0105; | ||||
|     s->csr[112] = 0x0000; | ||||
|     s->csr[114] = 0x0000; | ||||
|     s->csr[122] = 0x0000; | ||||
|   | ||||
| @@ -98,7 +98,7 @@ static unsigned int tdk_read(struct PHY *phy, unsigned int req) | ||||
|             r |= 1; | ||||
|             break; | ||||
|         case 17: | ||||
|             /* Marvel PHY on many xilinx boards.  */ | ||||
|             /* Marvell PHY on many xilinx boards.  */ | ||||
|             r = 0x8000; /* 1000Mb  */ | ||||
|             break; | ||||
|         case 18: | ||||
| @@ -142,6 +142,9 @@ tdk_write(struct PHY *phy, unsigned int req, unsigned int data) | ||||
|             phy->regs[regnum] = data; | ||||
|             break; | ||||
|     } | ||||
|  | ||||
|     /* Unconditionally clear regs[BMCR][BMCR_RESET] */ | ||||
|     phy->regs[0] &= ~0x8000; | ||||
| } | ||||
|  | ||||
| static void | ||||
|   | ||||
| @@ -79,7 +79,6 @@ int monitor_handle_fd_param(Monitor *mon, const char *fdname); | ||||
| void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap) | ||||
|     GCC_FMT_ATTR(2, 0); | ||||
| void monitor_printf(Monitor *mon, const char *fmt, ...) GCC_FMT_ATTR(2, 3); | ||||
| void monitor_print_filename(Monitor *mon, const char *filename); | ||||
| void monitor_flush(Monitor *mon); | ||||
| int monitor_set_cpu(int cpu_index); | ||||
| int monitor_get_cpu_index(void); | ||||
|   | ||||
| @@ -12,7 +12,6 @@ | ||||
| #ifndef QERROR_H | ||||
| #define QERROR_H | ||||
|  | ||||
| #include "qapi/qmp/qdict.h" | ||||
| #include "qapi/qmp/qstring.h" | ||||
| #include "qemu/error-report.h" | ||||
| #include "qapi/error.h" | ||||
| @@ -35,51 +34,30 @@ void qerror_report_err(Error *err); | ||||
|  * Please keep the definitions in alphabetical order. | ||||
|  * Use scripts/check-qerror.sh to check. | ||||
|  */ | ||||
| #define QERR_ADD_CLIENT_FAILED \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Could not add client" | ||||
|  | ||||
| #define QERR_AMBIGUOUS_PATH \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Path '%s' does not uniquely identify an object" | ||||
|  | ||||
| #define QERR_BAD_BUS_FOR_DEVICE \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Device '%s' can't go on a %s bus" | ||||
|  | ||||
| #define QERR_BASE_NOT_FOUND \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Base '%s' not found" | ||||
|  | ||||
| #define QERR_BLOCK_JOB_NOT_ACTIVE \ | ||||
|     ERROR_CLASS_DEVICE_NOT_ACTIVE, "No active block job on device '%s'" | ||||
|  | ||||
| #define QERR_BLOCK_JOB_PAUSED \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "The block job for device '%s' is currently paused" | ||||
|  | ||||
| #define QERR_BLOCK_JOB_NOT_READY \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "The active block job for device '%s' cannot be completed" | ||||
|  | ||||
| #define QERR_BLOCK_FORMAT_FEATURE_NOT_SUPPORTED \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Block format '%s' used by device '%s' does not support feature '%s'" | ||||
|  | ||||
| #define QERR_BUFFER_OVERRUN \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "An internal buffer overran" | ||||
|  | ||||
| #define QERR_BUS_NO_HOTPLUG \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Bus '%s' does not support hotplugging" | ||||
|  | ||||
| #define QERR_BUS_NOT_FOUND \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Bus '%s' not found" | ||||
|  | ||||
| #define QERR_COMMAND_DISABLED \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "The command %s has been disabled for this instance" | ||||
|  | ||||
| #define QERR_COMMAND_NOT_FOUND \ | ||||
|     ERROR_CLASS_COMMAND_NOT_FOUND, "The command %s has not been found" | ||||
|  | ||||
| #define QERR_DEVICE_ENCRYPTED \ | ||||
|     ERROR_CLASS_DEVICE_ENCRYPTED, "'%s' (%s) is encrypted" | ||||
|  | ||||
| #define QERR_DEVICE_FEATURE_BLOCKS_MIGRATION \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Migration is disabled when using feature '%s' in device '%s'" | ||||
|  | ||||
| #define QERR_DEVICE_HAS_NO_MEDIUM \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Device '%s' has no medium" | ||||
|  | ||||
| @@ -92,15 +70,6 @@ void qerror_report_err(Error *err); | ||||
| #define QERR_DEVICE_IS_READ_ONLY \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Device '%s' is read only" | ||||
|  | ||||
| #define QERR_DEVICE_LOCKED \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Device '%s' is locked" | ||||
|  | ||||
| #define QERR_DEVICE_MULTIPLE_BUSSES \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Device '%s' has multiple child busses" | ||||
|  | ||||
| #define QERR_DEVICE_NO_BUS \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Device '%s' has no child bus" | ||||
|  | ||||
| #define QERR_DEVICE_NO_HOTPLUG \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Device '%s' does not support hotplugging" | ||||
|  | ||||
| @@ -113,12 +82,6 @@ void qerror_report_err(Error *err); | ||||
| #define QERR_DEVICE_NOT_FOUND \ | ||||
|     ERROR_CLASS_DEVICE_NOT_FOUND, "Device '%s' not found" | ||||
|  | ||||
| #define QERR_DEVICE_NOT_REMOVABLE \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Device '%s' is not removable" | ||||
|  | ||||
| #define QERR_DUPLICATE_ID \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Duplicate ID '%s' for %s" | ||||
|  | ||||
| #define QERR_FD_NOT_FOUND \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "File descriptor named '%s' not found" | ||||
|  | ||||
| @@ -131,15 +94,9 @@ void qerror_report_err(Error *err); | ||||
| #define QERR_INVALID_BLOCK_FORMAT \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Invalid block format '%s'" | ||||
|  | ||||
| #define QERR_INVALID_OPTION_GROUP \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "There is no option group '%s'" | ||||
|  | ||||
| #define QERR_INVALID_PARAMETER \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Invalid parameter '%s'" | ||||
|  | ||||
| #define QERR_INVALID_PARAMETER_COMBINATION \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Invalid parameter combination" | ||||
|  | ||||
| #define QERR_INVALID_PARAMETER_TYPE \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Invalid parameter type for '%s', expected: %s" | ||||
|  | ||||
| @@ -152,9 +109,6 @@ void qerror_report_err(Error *err); | ||||
| #define QERR_IO_ERROR \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "An IO error has occurred" | ||||
|  | ||||
| #define QERR_JSON_PARSE_ERROR \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "JSON parse error, %s" | ||||
|  | ||||
| #define QERR_JSON_PARSING \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Invalid JSON syntax" | ||||
|  | ||||
| @@ -164,45 +118,21 @@ void qerror_report_err(Error *err); | ||||
| #define QERR_MIGRATION_ACTIVE \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "There's a migration process in progress" | ||||
|  | ||||
| #define QERR_MIGRATION_NOT_SUPPORTED \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "State blocked by non-migratable device '%s'" | ||||
|  | ||||
| #define QERR_MISSING_PARAMETER \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Parameter '%s' is missing" | ||||
|  | ||||
| #define QERR_NO_BUS_FOR_DEVICE \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "No '%s' bus found for device '%s'" | ||||
|  | ||||
| #define QERR_NOT_SUPPORTED \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Not supported" | ||||
|  | ||||
| #define QERR_PERMISSION_DENIED \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Insufficient permission to perform this operation" | ||||
|  | ||||
| #define QERR_PROPERTY_NOT_FOUND \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Property '%s.%s' not found" | ||||
|  | ||||
| #define QERR_PROPERTY_VALUE_BAD \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Property '%s.%s' doesn't take value '%s'" | ||||
|  | ||||
| #define QERR_PROPERTY_VALUE_IN_USE \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Property '%s.%s' can't take value '%s', it's in use" | ||||
|  | ||||
| #define QERR_PROPERTY_VALUE_NOT_FOUND \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Property '%s.%s' can't find value '%s'" | ||||
|  | ||||
| #define QERR_PROPERTY_VALUE_NOT_POWER_OF_2 \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Property %s.%s doesn't take value '%" PRId64 "', it's not a power of 2" | ||||
|  | ||||
| #define QERR_PROPERTY_VALUE_OUT_OF_RANGE \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Property %s.%s doesn't take value %" PRId64 " (minimum: %" PRId64 ", maximum: %" PRId64 ")" | ||||
|  | ||||
| #define QERR_QGA_COMMAND_FAILED \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Guest agent command failed, error was '%s'" | ||||
|  | ||||
| #define QERR_QGA_LOGGING_FAILED \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Guest agent failed to log non-optional log statement" | ||||
|  | ||||
| #define QERR_QMP_BAD_INPUT_OBJECT \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Expected '%s' in QMP input" | ||||
|  | ||||
| @@ -212,15 +142,9 @@ void qerror_report_err(Error *err); | ||||
| #define QERR_QMP_EXTRA_MEMBER \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "QMP input object member '%s' is unexpected" | ||||
|  | ||||
| #define QERR_RESET_REQUIRED \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Resetting the Virtual Machine is required" | ||||
|  | ||||
| #define QERR_SET_PASSWD_FAILED \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Could not set password" | ||||
|  | ||||
| #define QERR_TOO_MANY_FILES \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Too many open files" | ||||
|  | ||||
| #define QERR_UNDEFINED_ERROR \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "An undefined error has occurred" | ||||
|  | ||||
| @@ -230,9 +154,6 @@ void qerror_report_err(Error *err); | ||||
| #define QERR_UNSUPPORTED \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "this feature or command is not currently supported" | ||||
|  | ||||
| #define QERR_VIRTFS_FEATURE_BLOCKS_MIGRATION \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Migration is disabled when VirtFS export path '%s' is mounted in the guest using mount_tag '%s'" | ||||
|  | ||||
| #define QERR_SOCKET_CONNECT_FAILED \ | ||||
|     ERROR_CLASS_GENERIC_ERROR, "Failed to connect to socket" | ||||
|  | ||||
|   | ||||
| @@ -8,6 +8,8 @@ | ||||
|  | ||||
| QemuOptsList *qemu_find_opts(const char *group); | ||||
| QemuOptsList *qemu_find_opts_err(const char *group, Error **errp); | ||||
| QemuOpts *qemu_find_opts_singleton(const char *group); | ||||
|  | ||||
| void qemu_add_opts(QemuOptsList *list); | ||||
| void qemu_add_drive_opts(QemuOptsList *list); | ||||
| int qemu_set_option(const char *str); | ||||
|   | ||||
| @@ -37,7 +37,6 @@ void loc_set_file(const char *fname, int lno); | ||||
| void error_vprintf(const char *fmt, va_list ap) GCC_FMT_ATTR(1, 0); | ||||
| void error_printf(const char *fmt, ...) GCC_FMT_ATTR(1, 2); | ||||
| void error_printf_unless_qmp(const char *fmt, ...) GCC_FMT_ATTR(1, 2); | ||||
| void error_print_loc(void); | ||||
| void error_set_progname(const char *argv0); | ||||
| void error_report(const char *fmt, ...) GCC_FMT_ATTR(1, 2); | ||||
| const char *error_get_progname(void); | ||||
|   | ||||
| @@ -22,6 +22,8 @@ | ||||
| #define KVM_DEV_FLIC_CLEAR_IRQS		3 | ||||
| #define KVM_DEV_FLIC_APF_ENABLE		4 | ||||
| #define KVM_DEV_FLIC_APF_DISABLE_WAIT	5 | ||||
| #define KVM_DEV_FLIC_ADAPTER_REGISTER	6 | ||||
| #define KVM_DEV_FLIC_ADAPTER_MODIFY	7 | ||||
| /* | ||||
|  * We can have up to 4*64k pending subchannels + 8 adapter interrupts, | ||||
|  * as well as up  to ASYNC_PF_PER_VCPU*KVM_MAX_VCPUS pfault done interrupts. | ||||
| @@ -32,6 +34,26 @@ | ||||
| #define KVM_S390_MAX_FLOAT_IRQS	266250 | ||||
| #define KVM_S390_FLIC_MAX_BUFFER	0x2000000 | ||||
|  | ||||
| struct kvm_s390_io_adapter { | ||||
| 	__u32 id; | ||||
| 	__u8 isc; | ||||
| 	__u8 maskable; | ||||
| 	__u8 swap; | ||||
| 	__u8 pad; | ||||
| }; | ||||
|  | ||||
| #define KVM_S390_IO_ADAPTER_MASK 1 | ||||
| #define KVM_S390_IO_ADAPTER_MAP 2 | ||||
| #define KVM_S390_IO_ADAPTER_UNMAP 3 | ||||
|  | ||||
| struct kvm_s390_io_adapter_req { | ||||
| 	__u32 id; | ||||
| 	__u8 type; | ||||
| 	__u8 mask; | ||||
| 	__u16 pad0; | ||||
| 	__u64 addr; | ||||
| }; | ||||
|  | ||||
| /* for KVM_GET_REGS and KVM_SET_REGS */ | ||||
| struct kvm_regs { | ||||
| 	/* general purpose regs for s390 */ | ||||
| @@ -76,4 +98,6 @@ struct kvm_sync_regs { | ||||
| #define KVM_REG_S390_PFTOKEN	(KVM_REG_S390 | KVM_REG_SIZE_U64 | 0x5) | ||||
| #define KVM_REG_S390_PFCOMPARE	(KVM_REG_S390 | KVM_REG_SIZE_U64 | 0x6) | ||||
| #define KVM_REG_S390_PFSELECT	(KVM_REG_S390 | KVM_REG_SIZE_U64 | 0x7) | ||||
| #define KVM_REG_S390_PP		(KVM_REG_S390 | KVM_REG_SIZE_U64 | 0x8) | ||||
| #define KVM_REG_S390_GBEA	(KVM_REG_S390 | KVM_REG_SIZE_U64 | 0x9) | ||||
| #endif | ||||
|   | ||||
| @@ -740,6 +740,9 @@ struct kvm_ppc_smmu_info { | ||||
| #define KVM_CAP_SPAPR_MULTITCE 94 | ||||
| #define KVM_CAP_EXT_EMUL_CPUID 95 | ||||
| #define KVM_CAP_HYPERV_TIME 96 | ||||
| #define KVM_CAP_IOAPIC_POLARITY_IGNORED 97 | ||||
| #define KVM_CAP_ENABLE_CAP_VM 98 | ||||
| #define KVM_CAP_S390_IRQCHIP 99 | ||||
|  | ||||
| #ifdef KVM_CAP_IRQ_ROUTING | ||||
|  | ||||
| @@ -755,9 +758,18 @@ struct kvm_irq_routing_msi { | ||||
| 	__u32 pad; | ||||
| }; | ||||
|  | ||||
| struct kvm_irq_routing_s390_adapter { | ||||
| 	__u64 ind_addr; | ||||
| 	__u64 summary_addr; | ||||
| 	__u64 ind_offset; | ||||
| 	__u32 summary_offset; | ||||
| 	__u32 adapter_id; | ||||
| }; | ||||
|  | ||||
| /* gsi routing entry types */ | ||||
| #define KVM_IRQ_ROUTING_IRQCHIP 1 | ||||
| #define KVM_IRQ_ROUTING_MSI 2 | ||||
| #define KVM_IRQ_ROUTING_S390_ADAPTER 3 | ||||
|  | ||||
| struct kvm_irq_routing_entry { | ||||
| 	__u32 gsi; | ||||
| @@ -767,6 +779,7 @@ struct kvm_irq_routing_entry { | ||||
| 	union { | ||||
| 		struct kvm_irq_routing_irqchip irqchip; | ||||
| 		struct kvm_irq_routing_msi msi; | ||||
| 		struct kvm_irq_routing_s390_adapter adapter; | ||||
| 		__u32 pad[8]; | ||||
| 	} u; | ||||
| }; | ||||
| @@ -1075,6 +1088,10 @@ struct kvm_s390_ucas_mapping { | ||||
| /* Available with KVM_CAP_DEBUGREGS */ | ||||
| #define KVM_GET_DEBUGREGS         _IOR(KVMIO,  0xa1, struct kvm_debugregs) | ||||
| #define KVM_SET_DEBUGREGS         _IOW(KVMIO,  0xa2, struct kvm_debugregs) | ||||
| /* | ||||
|  * vcpu version available with KVM_ENABLE_CAP | ||||
|  * vm version available with KVM_CAP_ENABLE_CAP_VM | ||||
|  */ | ||||
| #define KVM_ENABLE_CAP            _IOW(KVMIO,  0xa3, struct kvm_enable_cap) | ||||
| /* Available with KVM_CAP_XSAVE */ | ||||
| #define KVM_GET_XSAVE		  _IOR(KVMIO,  0xa4, struct kvm_xsave) | ||||
|   | ||||
| @@ -23,6 +23,12 @@ | ||||
|  | ||||
| #define VFIO_TYPE1_IOMMU		1 | ||||
| #define VFIO_SPAPR_TCE_IOMMU		2 | ||||
| #define VFIO_TYPE1v2_IOMMU		3 | ||||
| /* | ||||
|  * IOMMU enforces DMA cache coherence (ex. PCIe NoSnoop stripping).  This | ||||
|  * capability is subject to change as groups are added or removed. | ||||
|  */ | ||||
| #define VFIO_DMA_CC_IOMMU		4 | ||||
|  | ||||
| /* | ||||
|  * The IOCTL interface is designed for extensibility by embedding the | ||||
|   | ||||
							
								
								
									
										85
									
								
								monitor.c
									
									
									
									
									
								
							
							
						
						
									
										85
									
								
								monitor.c
									
									
									
									
									
								
							| @@ -137,6 +137,7 @@ typedef struct mon_cmd_t { | ||||
|      * used, and mhandler of 1st level plays the role of help function. | ||||
|      */ | ||||
|     struct mon_cmd_t *sub_table; | ||||
|     void (*command_completion)(ReadLineState *rs, int nb_args, const char *str); | ||||
| } mon_cmd_t; | ||||
|  | ||||
| /* file descriptors passed via SCM_RIGHTS */ | ||||
| @@ -352,33 +353,6 @@ void monitor_printf(Monitor *mon, const char *fmt, ...) | ||||
|     va_end(ap); | ||||
| } | ||||
|  | ||||
| void monitor_print_filename(Monitor *mon, const char *filename) | ||||
| { | ||||
|     int i; | ||||
|  | ||||
|     for (i = 0; filename[i]; i++) { | ||||
|         switch (filename[i]) { | ||||
|         case ' ': | ||||
|         case '"': | ||||
|         case '\\': | ||||
|             monitor_printf(mon, "\\%c", filename[i]); | ||||
|             break; | ||||
|         case '\t': | ||||
|             monitor_printf(mon, "\\t"); | ||||
|             break; | ||||
|         case '\r': | ||||
|             monitor_printf(mon, "\\r"); | ||||
|             break; | ||||
|         case '\n': | ||||
|             monitor_printf(mon, "\\n"); | ||||
|             break; | ||||
|         default: | ||||
|             monitor_printf(mon, "%c", filename[i]); | ||||
|             break; | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| static int GCC_FMT_ATTR(2, 3) monitor_fprintf(FILE *stream, | ||||
|                                               const char *fmt, ...) | ||||
| { | ||||
| @@ -2254,6 +2228,7 @@ void qmp_getfd(const char *fdname, Error **errp) | ||||
|     } | ||||
|  | ||||
|     if (qemu_isdigit(fdname[0])) { | ||||
|         close(fd); | ||||
|         error_set(errp, QERR_INVALID_PARAMETER_VALUE, "fdname", | ||||
|                   "a name not starting with a digit"); | ||||
|         return; | ||||
| @@ -4277,11 +4252,15 @@ static const char *next_arg_type(const char *typestr) | ||||
|     return (p != NULL ? ++p : typestr); | ||||
| } | ||||
|  | ||||
| static void device_add_completion(ReadLineState *rs, const char *str) | ||||
| void device_add_completion(ReadLineState *rs, int nb_args, const char *str) | ||||
| { | ||||
|     GSList *list, *elt; | ||||
|     size_t len; | ||||
|  | ||||
|     if (nb_args != 2) { | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     len = strlen(str); | ||||
|     readline_set_completion_index(rs, len); | ||||
|     list = elt = object_class_get_list(TYPE_DEVICE, false); | ||||
| @@ -4290,7 +4269,9 @@ static void device_add_completion(ReadLineState *rs, const char *str) | ||||
|         DeviceClass *dc = OBJECT_CLASS_CHECK(DeviceClass, elt->data, | ||||
|                                              TYPE_DEVICE); | ||||
|         name = object_class_get_name(OBJECT_CLASS(dc)); | ||||
|         if (!strncmp(name, str, len)) { | ||||
|  | ||||
|         if (!dc->cannot_instantiate_with_device_add_yet | ||||
|             && !strncmp(name, str, len)) { | ||||
|             readline_add_completion(rs, name); | ||||
|         } | ||||
|         elt = elt->next; | ||||
| @@ -4298,11 +4279,15 @@ static void device_add_completion(ReadLineState *rs, const char *str) | ||||
|     g_slist_free(list); | ||||
| } | ||||
|  | ||||
| static void object_add_completion(ReadLineState *rs, const char *str) | ||||
| void object_add_completion(ReadLineState *rs, int nb_args, const char *str) | ||||
| { | ||||
|     GSList *list, *elt; | ||||
|     size_t len; | ||||
|  | ||||
|     if (nb_args != 2) { | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     len = strlen(str); | ||||
|     readline_set_completion_index(rs, len); | ||||
|     list = elt = object_class_get_list(TYPE_USER_CREATABLE, false); | ||||
| @@ -4318,8 +4303,8 @@ static void object_add_completion(ReadLineState *rs, const char *str) | ||||
|     g_slist_free(list); | ||||
| } | ||||
|  | ||||
| static void device_del_completion(ReadLineState *rs, BusState *bus, | ||||
|                                   const char *str, size_t len) | ||||
| static void device_del_bus_completion(ReadLineState *rs,  BusState *bus, | ||||
|                                       const char *str, size_t len) | ||||
| { | ||||
|     BusChild *kid; | ||||
|  | ||||
| @@ -4332,16 +4317,32 @@ static void device_del_completion(ReadLineState *rs, BusState *bus, | ||||
|         } | ||||
|  | ||||
|         QLIST_FOREACH(dev_child, &dev->child_bus, sibling) { | ||||
|             device_del_completion(rs, dev_child, str, len); | ||||
|             device_del_bus_completion(rs, dev_child, str, len); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| static void object_del_completion(ReadLineState *rs, const char *str) | ||||
| void device_del_completion(ReadLineState *rs, int nb_args, const char *str) | ||||
| { | ||||
|     size_t len; | ||||
|  | ||||
|     if (nb_args != 2) { | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     len = strlen(str); | ||||
|     readline_set_completion_index(rs, len); | ||||
|     device_del_bus_completion(rs, sysbus_get_default(), str, len); | ||||
| } | ||||
|  | ||||
| void object_del_completion(ReadLineState *rs, int nb_args, const char *str) | ||||
| { | ||||
|     ObjectPropertyInfoList *list, *start; | ||||
|     size_t len; | ||||
|  | ||||
|     if (nb_args != 2) { | ||||
|         return; | ||||
|     } | ||||
|     len = strlen(str); | ||||
|     readline_set_completion_index(rs, len); | ||||
|  | ||||
| @@ -4395,6 +4396,9 @@ static void monitor_find_completion_by_table(Monitor *mon, | ||||
|             return monitor_find_completion_by_table(mon, cmd->sub_table, | ||||
|                                                     &args[1], nb_args - 1); | ||||
|         } | ||||
|         if (cmd->command_completion) { | ||||
|             return cmd->command_completion(mon->rs, nb_args, args[nb_args - 1]); | ||||
|         } | ||||
|  | ||||
|         ptype = next_arg_type(cmd->args_type); | ||||
|         for(i = 0; i < nb_args - 2; i++) { | ||||
| @@ -4421,13 +4425,6 @@ static void monitor_find_completion_by_table(Monitor *mon, | ||||
|             readline_set_completion_index(mon->rs, strlen(str)); | ||||
|             bdrv_iterate(block_completion_it, &mbs); | ||||
|             break; | ||||
|         case 'O': | ||||
|             if (!strcmp(cmd->name, "device_add") && nb_args == 2) { | ||||
|                 device_add_completion(mon->rs, str); | ||||
|             } else if (!strcmp(cmd->name, "object_add") && nb_args == 2) { | ||||
|                 object_add_completion(mon->rs, str); | ||||
|             } | ||||
|             break; | ||||
|         case 's': | ||||
|         case 'S': | ||||
|             if (!strcmp(cmd->name, "sendkey")) { | ||||
| @@ -4441,12 +4438,6 @@ static void monitor_find_completion_by_table(Monitor *mon, | ||||
|             } else if (!strcmp(cmd->name, "help|?")) { | ||||
|                 monitor_find_completion_by_table(mon, cmd_table, | ||||
|                                                  &args[1], nb_args - 1); | ||||
|             } else if (!strcmp(cmd->name, "device_del") && nb_args == 2) { | ||||
|                 size_t len = strlen(str); | ||||
|                 readline_set_completion_index(mon->rs, len); | ||||
|                 device_del_completion(mon->rs, sysbus_get_default(), str, len); | ||||
|             } else if (!strcmp(cmd->name, "object_del") && nb_args == 2) { | ||||
|                 object_del_completion(mon->rs, str); | ||||
|             } | ||||
|             break; | ||||
|         default: | ||||
|   | ||||
							
								
								
									
										10
									
								
								net/net.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								net/net.c
									
									
									
									
									
								
							| @@ -473,7 +473,7 @@ ssize_t qemu_deliver_packet(NetClientState *sender, | ||||
|  | ||||
|     if (ret == 0) { | ||||
|         nc->receive_disabled = 1; | ||||
|     }; | ||||
|     } | ||||
|  | ||||
|     return ret; | ||||
| } | ||||
| @@ -1045,7 +1045,7 @@ RxFilterInfoList *qmp_query_rx_filter(bool has_name, const char *name, | ||||
|         if (nc->info->type != NET_CLIENT_OPTIONS_KIND_NIC) { | ||||
|             if (has_name) { | ||||
|                 error_setg(errp, "net client(%s) isn't a NIC", name); | ||||
|                 break; | ||||
|                 return NULL; | ||||
|             } | ||||
|             continue; | ||||
|         } | ||||
| @@ -1064,11 +1064,15 @@ RxFilterInfoList *qmp_query_rx_filter(bool has_name, const char *name, | ||||
|         } else if (has_name) { | ||||
|             error_setg(errp, "net client(%s) doesn't support" | ||||
|                        " rx-filter querying", name); | ||||
|             return NULL; | ||||
|         } | ||||
|  | ||||
|         if (has_name) { | ||||
|             break; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     if (filter_list == NULL && !error_is_set(errp) && has_name) { | ||||
|     if (filter_list == NULL && has_name) { | ||||
|         error_setg(errp, "invalid net client name: %s", name); | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -527,6 +527,7 @@ static int slirp_smb(SlirpState* s, const char *exported_dir, | ||||
|             "pid directory=%s\n" | ||||
|             "lock directory=%s\n" | ||||
|             "state directory=%s\n" | ||||
|             "ncalrpc dir=%s/ncalrpc\n" | ||||
|             "log file=%s/log.smbd\n" | ||||
|             "smb passwd file=%s/smbpasswd\n" | ||||
|             "security = user\n" | ||||
| @@ -542,6 +543,7 @@ static int slirp_smb(SlirpState* s, const char *exported_dir, | ||||
|             s->smb_dir, | ||||
|             s->smb_dir, | ||||
|             s->smb_dir, | ||||
|             s->smb_dir, | ||||
|             exported_dir, | ||||
|             passwd->pw_name | ||||
|             ); | ||||
|   | ||||
							
								
								
									
										14
									
								
								net/tap.c
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								net/tap.c
									
									
									
									
									
								
							| @@ -367,11 +367,8 @@ static int launch_script(const char *setup_script, const char *ifname, int fd) | ||||
|     if (pid == 0) { | ||||
|         int open_max = sysconf(_SC_OPEN_MAX), i; | ||||
|  | ||||
|         for (i = 0; i < open_max; i++) { | ||||
|             if (i != STDIN_FILENO && | ||||
|                 i != STDOUT_FILENO && | ||||
|                 i != STDERR_FILENO && | ||||
|                 i != fd) { | ||||
|         for (i = 3; i < open_max; i++) { | ||||
|             if (i != fd) { | ||||
|                 close(i); | ||||
|             } | ||||
|         } | ||||
| @@ -452,11 +449,8 @@ static int net_bridge_run_helper(const char *helper, const char *bridge) | ||||
|         char br_buf[6+IFNAMSIZ] = {0}; | ||||
|         char helper_cmd[PATH_MAX + sizeof(fd_buf) + sizeof(br_buf) + 15]; | ||||
|  | ||||
|         for (i = 0; i < open_max; i++) { | ||||
|             if (i != STDIN_FILENO && | ||||
|                 i != STDOUT_FILENO && | ||||
|                 i != STDERR_FILENO && | ||||
|                 i != sv[1]) { | ||||
|         for (i = 3; i < open_max; i++) { | ||||
|             if (i != sv[1]) { | ||||
|                 close(i); | ||||
|             } | ||||
|         } | ||||
|   | ||||
							
								
								
									
										1010
									
								
								pc-bios/qemu_logo.svg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1010
									
								
								pc-bios/qemu_logo.svg
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| After Width: | Height: | Size: 32 KiB | 
| @@ -37,8 +37,8 @@ install: $(OBJS) | ||||
| 	$(call quiet-command, msgfmt -o $@ $<, "  GEN   $@") | ||||
|  | ||||
| $(PO_PATH)/messages.po: $(SRC_PATH)/ui/gtk.c | ||||
| 	$(call quiet-command, cd $(SRC_PATH) && \ | ||||
| 	 (xgettext -o - --from-code=UTF-8 --foreign-user \ | ||||
| 	$(call quiet-command, ( cd $(SRC_PATH) && \ | ||||
|           xgettext -o - --from-code=UTF-8 --foreign-user \ | ||||
| 	    --package-name=QEMU --package-version=$(VERSION) \ | ||||
| 	    --msgid-bugs-address=qemu-devel@nongnu.org -k_ -C ui/gtk.c | \ | ||||
| 	  sed -e s/CHARSET/UTF-8/) >$@, "  GEN   $@") | ||||
|   | ||||
| @@ -10,7 +10,7 @@ msgstr "" | ||||
| "PO-Revision-Date: 2012-02-28 16:00+0100\n" | ||||
| "Last-Translator: Kevin Wolf <kwolf@redhat.com>\n" | ||||
| "Language-Team: Deutsch <de@li.org>\n" | ||||
| "Language: \n" | ||||
| "Language: de\n" | ||||
| "MIME-Version: 1.0\n" | ||||
| "Content-Type: text/plain; charset=UTF-8\n" | ||||
| "Content-Transfer-Encoding: 8bit\n" | ||||
|   | ||||
| @@ -10,7 +10,7 @@ msgstr "" | ||||
| "PO-Revision-Date: 2013-03-31 19:39+0200\n" | ||||
| "Last-Translator: Aurelien Jarno <aurelien@aurel32.net>\n" | ||||
| "Language-Team: French <FR@li.org>\n" | ||||
| "Language: \n" | ||||
| "Language: fr\n" | ||||
| "MIME-Version: 1.0\n" | ||||
| "Content-Type: text/plain; charset=UTF-8\n" | ||||
| "Content-Transfer-Encoding: 8bit\n" | ||||
|   | ||||
							
								
								
									
										2
									
								
								po/hu.po
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								po/hu.po
									
									
									
									
									
								
							| @@ -10,7 +10,7 @@ msgstr "" | ||||
| "PO-Revision-Date: 2013-05-06 20:42+0200\n" | ||||
| "Last-Translator: Ákos Kovács <akoskovacs@gmx.com>\n" | ||||
| "Language-Team: Hungarian <hu@li.org>\n" | ||||
| "Language: \n" | ||||
| "Language: hu\n" | ||||
| "MIME-Version: 1.0\n" | ||||
| "Content-Type: text/plain; charset=UTF-8\n" | ||||
| "Content-Transfer-Encoding: 8bit\n" | ||||
|   | ||||
							
								
								
									
										2
									
								
								po/it.po
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								po/it.po
									
									
									
									
									
								
							| @@ -10,7 +10,7 @@ msgstr "" | ||||
| "PO-Revision-Date: 2012-02-27 08:23+0100\n" | ||||
| "Last-Translator: Paolo Bonzini <pbonzini@redhat.com>\n" | ||||
| "Language-Team: Italian <it@li.org>\n" | ||||
| "Language: \n" | ||||
| "Language: it\n" | ||||
| "MIME-Version: 1.0\n" | ||||
| "Content-Type: text/plain; charset=UTF-8\n" | ||||
| "Content-Transfer-Encoding: 8bit\n" | ||||
|   | ||||
							
								
								
									
										2
									
								
								po/tr.po
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								po/tr.po
									
									
									
									
									
								
							| @@ -10,7 +10,7 @@ msgstr "" | ||||
| "PO-Revision-Date: 2013-04-22 18:35+0300\n" | ||||
| "Last-Translator: Ozan Çağlayan <ozancag@gmail.com>\n" | ||||
| "Language-Team: Türkçe <>\n" | ||||
| "Language: \n" | ||||
| "Language: tr\n" | ||||
| "MIME-Version: 1.0\n" | ||||
| "Content-Type: text/plain; charset=UTF-8\n" | ||||
| "Content-Transfer-Encoding: 8bit\n" | ||||
|   | ||||
| @@ -4285,10 +4285,13 @@ | ||||
| # | ||||
| # Drivers that are supported in block device operations. | ||||
| # | ||||
| # @host_device, @host_cdrom, @host_floppy: Since 2.1 | ||||
| # | ||||
| # Since: 2.0 | ||||
| ## | ||||
| { 'enum': 'BlockdevDriver', | ||||
|   'data': [ 'file', 'http', 'https', 'ftp', 'ftps', 'tftp', 'vvfat', 'blkdebug', | ||||
|   'data': [ 'file', 'host_device', 'host_cdrom', 'host_floppy', | ||||
|             'http', 'https', 'ftp', 'ftps', 'tftp', 'vvfat', 'blkdebug', | ||||
|             'blkverify', 'bochs', 'cloop', 'cow', 'dmg', 'parallels', 'qcow', | ||||
|             'qcow2', 'qed', 'raw', 'vdi', 'vhdx', 'vmdk', 'vpc', 'quorum' ] } | ||||
|  | ||||
| @@ -4555,6 +4558,9 @@ | ||||
|   'discriminator': 'driver', | ||||
|   'data': { | ||||
|       'file':       'BlockdevOptionsFile', | ||||
|       'host_device':'BlockdevOptionsFile', | ||||
|       'host_cdrom': 'BlockdevOptionsFile', | ||||
|       'host_floppy':'BlockdevOptionsFile', | ||||
|       'http':       'BlockdevOptionsFile', | ||||
|       'https':      'BlockdevOptionsFile', | ||||
|       'ftp':        'BlockdevOptionsFile', | ||||
|   | ||||
| @@ -80,7 +80,8 @@ static QObject *do_qmp_dispatch(QObject *request, Error **errp) | ||||
|         return NULL; | ||||
|     } | ||||
|     if (!cmd->enabled) { | ||||
|         error_set(errp, QERR_COMMAND_DISABLED, command); | ||||
|         error_setg(errp, "The command %s has been disabled for this instance", | ||||
|                    command); | ||||
|         return NULL; | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -71,7 +71,7 @@ static void qmp_input_push(QmpInputVisitor *qiv, QObject *obj, Error **errp) | ||||
|     GHashTable *h; | ||||
|  | ||||
|     if (qiv->nb_stack >= QIV_STACK_SIZE) { | ||||
|         error_set(errp, QERR_BUFFER_OVERRUN); | ||||
|         error_setg(errp, "An internal buffer overran"); | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -422,12 +422,14 @@ static BusState *qbus_find(const char *path) | ||||
|              * one child bus accept it nevertheless */ | ||||
|             switch (dev->num_child_bus) { | ||||
|             case 0: | ||||
|                 qerror_report(QERR_DEVICE_NO_BUS, elem); | ||||
|                 qerror_report(ERROR_CLASS_GENERIC_ERROR, | ||||
|                               "Device '%s' has no child bus", elem); | ||||
|                 return NULL; | ||||
|             case 1: | ||||
|                 return QLIST_FIRST(&dev->child_bus); | ||||
|             default: | ||||
|                 qerror_report(QERR_DEVICE_MULTIPLE_BUSSES, elem); | ||||
|                 qerror_report(ERROR_CLASS_GENERIC_ERROR, | ||||
|                               "Device '%s' has multiple child busses", elem); | ||||
|                 if (!monitor_cur_is_qmp()) { | ||||
|                     qbus_list_bus(dev); | ||||
|                 } | ||||
| @@ -505,14 +507,16 @@ DeviceState *qdev_device_add(QemuOpts *opts) | ||||
|             return NULL; | ||||
|         } | ||||
|         if (!object_dynamic_cast(OBJECT(bus), dc->bus_type)) { | ||||
|             qerror_report(QERR_BAD_BUS_FOR_DEVICE, | ||||
|             qerror_report(ERROR_CLASS_GENERIC_ERROR, | ||||
|                           "Device '%s' can't go on a %s bus", | ||||
|                           driver, object_get_typename(OBJECT(bus))); | ||||
|             return NULL; | ||||
|         } | ||||
|     } else if (dc->bus_type != NULL) { | ||||
|         bus = qbus_find_recursive(sysbus_get_default(), NULL, dc->bus_type); | ||||
|         if (!bus) { | ||||
|             qerror_report(QERR_NO_BUS_FOR_DEVICE, | ||||
|             qerror_report(ERROR_CLASS_GENERIC_ERROR, | ||||
|                           "No '%s' bus found for device '%s'", | ||||
|                           dc->bus_type, driver); | ||||
|             return NULL; | ||||
|         } | ||||
|   | ||||
							
								
								
									
										12
									
								
								qemu-img.c
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								qemu-img.c
									
									
									
									
									
								
							| @@ -457,12 +457,12 @@ fail: | ||||
|  | ||||
| static void dump_json_image_check(ImageCheck *check, bool quiet) | ||||
| { | ||||
|     Error *errp = NULL; | ||||
|     Error *local_err = NULL; | ||||
|     QString *str; | ||||
|     QmpOutputVisitor *ov = qmp_output_visitor_new(); | ||||
|     QObject *obj; | ||||
|     visit_type_ImageCheck(qmp_output_get_visitor(ov), | ||||
|                           &check, NULL, &errp); | ||||
|                           &check, NULL, &local_err); | ||||
|     obj = qmp_output_get_qobject(ov); | ||||
|     str = qobject_to_json_pretty(obj); | ||||
|     assert(str != NULL); | ||||
| @@ -1731,12 +1731,12 @@ static void dump_snapshots(BlockDriverState *bs) | ||||
|  | ||||
| static void dump_json_image_info_list(ImageInfoList *list) | ||||
| { | ||||
|     Error *errp = NULL; | ||||
|     Error *local_err = NULL; | ||||
|     QString *str; | ||||
|     QmpOutputVisitor *ov = qmp_output_visitor_new(); | ||||
|     QObject *obj; | ||||
|     visit_type_ImageInfoList(qmp_output_get_visitor(ov), | ||||
|                              &list, NULL, &errp); | ||||
|                              &list, NULL, &local_err); | ||||
|     obj = qmp_output_get_qobject(ov); | ||||
|     str = qobject_to_json_pretty(obj); | ||||
|     assert(str != NULL); | ||||
| @@ -1748,12 +1748,12 @@ static void dump_json_image_info_list(ImageInfoList *list) | ||||
|  | ||||
| static void dump_json_image_info(ImageInfo *info) | ||||
| { | ||||
|     Error *errp = NULL; | ||||
|     Error *local_err = NULL; | ||||
|     QString *str; | ||||
|     QmpOutputVisitor *ov = qmp_output_visitor_new(); | ||||
|     QObject *obj; | ||||
|     visit_type_ImageInfo(qmp_output_get_visitor(ov), | ||||
|                          &info, NULL, &errp); | ||||
|                          &info, NULL, &local_err); | ||||
|     obj = qmp_output_get_qobject(ov); | ||||
|     str = qobject_to_json_pretty(obj); | ||||
|     assert(str != NULL); | ||||
|   | ||||
| @@ -210,10 +210,13 @@ use is discouraged as it may be removed from future versions. | ||||
| ETEXI | ||||
|  | ||||
| DEF("m", HAS_ARG, QEMU_OPTION_m, | ||||
|     "-m megs         set virtual RAM size to megs MB [default=" | ||||
|     stringify(DEFAULT_RAM_SIZE) "]\n", QEMU_ARCH_ALL) | ||||
|     "-m [size=]megs\n" | ||||
|     "                configure guest RAM\n" | ||||
|     "                size: initial amount of guest memory (default: " | ||||
|     stringify(DEFAULT_RAM_SIZE) "MiB)\n", | ||||
|     QEMU_ARCH_ALL) | ||||
| STEXI | ||||
| @item -m @var{megs} | ||||
| @item -m [size=]@var{megs} | ||||
| @findex -m | ||||
| Set virtual RAM size to @var{megs} megabytes. Default is 128 MiB.  Optionally, | ||||
| a suffix of ``M'' or ``G'' can be used to signify a value in megabytes or | ||||
| @@ -408,7 +411,8 @@ DEF("drive", HAS_ARG, QEMU_OPTION_drive, | ||||
|     "-drive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i]\n" | ||||
|     "       [,cyls=c,heads=h,secs=s[,trans=t]][,snapshot=on|off]\n" | ||||
|     "       [,cache=writethrough|writeback|none|directsync|unsafe][,format=f]\n" | ||||
|     "       [,serial=s][,addr=A][,id=name][,aio=threads|native]\n" | ||||
|     "       [,serial=s][,addr=A][,rerror=ignore|stop|report]\n" | ||||
|     "       [,werror=ignore|stop|report|enospc][,id=name][,aio=threads|native]\n" | ||||
|     "       [,readonly=on|off][,copy-on-read=on|off]\n" | ||||
|     "       [[,bps=b]|[[,bps_rd=r][,bps_wr=w]]]\n" | ||||
|     "       [[,iops=i]|[[,iops_rd=r][,iops_wr=w]]]\n" | ||||
|   | ||||
| @@ -143,6 +143,7 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = { | ||||
|     { SCMP_SYS(getsockname), 242 }, | ||||
|     { SCMP_SYS(getpeername), 242 }, | ||||
|     { SCMP_SYS(accept4), 242 }, | ||||
|     { SCMP_SYS(timerfd_settime), 242 }, | ||||
|     { SCMP_SYS(newfstatat), 241 }, | ||||
|     { SCMP_SYS(shutdown), 241 }, | ||||
|     { SCMP_SYS(getsockopt), 241 }, | ||||
| @@ -225,7 +226,11 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = { | ||||
|     { SCMP_SYS(fchmod), 240 }, | ||||
|     { SCMP_SYS(shmget), 240 }, | ||||
|     { SCMP_SYS(shmat), 240 }, | ||||
|     { SCMP_SYS(shmdt), 240 } | ||||
|     { SCMP_SYS(shmdt), 240 }, | ||||
|     { SCMP_SYS(timerfd_create), 240 }, | ||||
|     { SCMP_SYS(shmctl), 240 }, | ||||
|     { SCMP_SYS(mlock), 240 }, | ||||
|     { SCMP_SYS(munlock), 240 } | ||||
| }; | ||||
|  | ||||
| int seccomp_start(void) | ||||
|   | ||||
							
								
								
									
										23
									
								
								qmp.c
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								qmp.c
									
									
									
									
									
								
							| @@ -166,7 +166,7 @@ void qmp_cont(Error **errp) | ||||
|     Error *local_err = NULL; | ||||
|  | ||||
|     if (runstate_needs_reset()) { | ||||
|         error_set(errp, QERR_RESET_REQUIRED); | ||||
|         error_setg(errp, "Resetting the Virtual Machine is required"); | ||||
|         return; | ||||
|     } else if (runstate_check(RUN_STATE_SUSPENDED)) { | ||||
|         return; | ||||
| @@ -540,14 +540,27 @@ void object_add(const char *type, const char *id, const QDict *qdict, | ||||
|                 Visitor *v, Error **errp) | ||||
| { | ||||
|     Object *obj; | ||||
|     ObjectClass *klass; | ||||
|     const QDictEntry *e; | ||||
|     Error *local_err = NULL; | ||||
|  | ||||
|     if (!object_class_by_name(type)) { | ||||
|     klass = object_class_by_name(type); | ||||
|     if (!klass) { | ||||
|         error_setg(errp, "invalid class name"); | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     if (!object_class_dynamic_cast(klass, TYPE_USER_CREATABLE)) { | ||||
|         error_setg(errp, "object type '%s' isn't supported by object-add", | ||||
|                    type); | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     if (object_class_is_abstract(klass)) { | ||||
|         error_setg(errp, "object type '%s' is abstract", type); | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     obj = object_new(type); | ||||
|     if (qdict) { | ||||
|         for (e = qdict_first(qdict); e; e = qdict_next(qdict, e)) { | ||||
| @@ -558,12 +571,6 @@ void object_add(const char *type, const char *id, const QDict *qdict, | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     if (!object_dynamic_cast(obj, TYPE_USER_CREATABLE)) { | ||||
|         error_setg(&local_err, "object type '%s' isn't supported by object-add", | ||||
|                    type); | ||||
|         goto out; | ||||
|     } | ||||
|  | ||||
|     user_creatable_complete(obj, &local_err); | ||||
|     if (local_err) { | ||||
|         goto out; | ||||
|   | ||||
| @@ -110,7 +110,7 @@ static void GCC_FMT_ATTR(3, 4) parse_error(JSONParserContext *ctxt, | ||||
|         error_free(ctxt->err); | ||||
|         ctxt->err = NULL; | ||||
|     } | ||||
|     error_set(&ctxt->err, QERR_JSON_PARSE_ERROR, message); | ||||
|     error_setg(&ctxt->err, "JSON parse error, %s", message); | ||||
| } | ||||
|  | ||||
| /** | ||||
|   | ||||
| @@ -768,7 +768,7 @@ ObjectProperty *object_property_find(Object *obj, const char *name, | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     error_set(errp, QERR_PROPERTY_NOT_FOUND, "", name); | ||||
|     error_setg(errp, "Property '.%s' not found", name); | ||||
|     return NULL; | ||||
| } | ||||
|  | ||||
| @@ -1075,7 +1075,8 @@ static Object *object_resolve_link(Object *obj, const char *name, | ||||
|     target = object_resolve_path_type(path, target_type, &ambiguous); | ||||
|  | ||||
|     if (ambiguous) { | ||||
|         error_set(errp, QERR_AMBIGUOUS_PATH, path); | ||||
|         error_set(errp, ERROR_CLASS_GENERIC_ERROR, | ||||
|                   "Path '%s' does not uniquely identify an object", path); | ||||
|     } else if (!target) { | ||||
|         target = object_resolve_path(path, &ambiguous); | ||||
|         if (target || ambiguous) { | ||||
|   | ||||
							
								
								
									
										3
									
								
								savevm.c
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								savevm.c
									
									
									
									
									
								
							| @@ -453,7 +453,8 @@ bool qemu_savevm_state_blocked(Error **errp) | ||||
|  | ||||
|     QTAILQ_FOREACH(se, &savevm_handlers, entry) { | ||||
|         if (se->no_migrate) { | ||||
|             error_set(errp, QERR_MIGRATION_NOT_SUPPORTED, se->idstr); | ||||
|             error_setg(errp, "State blocked by non-migratable device '%s'", | ||||
|                        se->idstr); | ||||
|             return true; | ||||
|         } | ||||
|     } | ||||
|   | ||||
							
								
								
									
										13
									
								
								slirp/misc.c
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								slirp/misc.c
									
									
									
									
									
								
							| @@ -136,7 +136,7 @@ fork_exec(struct socket *so, const char *ex, int do_pty) | ||||
| 		if ((s = qemu_socket(AF_INET, SOCK_STREAM, 0)) < 0 || | ||||
| 		    bind(s, (struct sockaddr *)&addr, addrlen) < 0 || | ||||
| 		    listen(s, 1) < 0) { | ||||
| 			lprint("Error: inet socket: %s\n", strerror(errno)); | ||||
| 			error_report("Error: inet socket: %s", strerror(errno)); | ||||
| 			closesocket(s); | ||||
|  | ||||
| 			return 0; | ||||
| @@ -146,7 +146,7 @@ fork_exec(struct socket *so, const char *ex, int do_pty) | ||||
| 	pid = fork(); | ||||
| 	switch(pid) { | ||||
| 	 case -1: | ||||
| 		lprint("Error: fork failed: %s\n", strerror(errno)); | ||||
| 		error_report("Error: fork failed: %s", strerror(errno)); | ||||
| 		close(s); | ||||
| 		return 0; | ||||
|  | ||||
| @@ -242,15 +242,6 @@ strdup(str) | ||||
| } | ||||
| #endif | ||||
|  | ||||
| void lprint(const char *format, ...) | ||||
| { | ||||
|     va_list args; | ||||
|  | ||||
|     va_start(args, format); | ||||
|     monitor_vprintf(default_mon, format, args); | ||||
|     va_end(args); | ||||
| } | ||||
|  | ||||
| void slirp_connection_info(Slirp *slirp, Monitor *mon) | ||||
| { | ||||
|     const char * const tcpstates[] = { | ||||
|   | ||||
| @@ -139,7 +139,7 @@ int get_dns_addr(struct in_addr *pdns_addr) | ||||
|         return -1; | ||||
|  | ||||
| #ifdef DEBUG | ||||
|     lprint("IP address of your DNS(s): "); | ||||
|     fprintf(stderr, "IP address of your DNS(s): "); | ||||
| #endif | ||||
|     while (fgets(buff, 512, f) != NULL) { | ||||
|         if (sscanf(buff, "nameserver%*[ \t]%256s", buff2) == 1) { | ||||
| @@ -153,17 +153,17 @@ int get_dns_addr(struct in_addr *pdns_addr) | ||||
|             } | ||||
| #ifdef DEBUG | ||||
|             else | ||||
|                 lprint(", "); | ||||
|                 fprintf(stderr, ", "); | ||||
| #endif | ||||
|             if (++found > 3) { | ||||
| #ifdef DEBUG | ||||
|                 lprint("(more)"); | ||||
|                 fprintf(stderr, "(more)"); | ||||
| #endif | ||||
|                 break; | ||||
|             } | ||||
| #ifdef DEBUG | ||||
|             else | ||||
|                 lprint("%s", inet_ntoa(tmp_addr)); | ||||
|                 fprintf(stderr, "%s", inet_ntoa(tmp_addr)); | ||||
| #endif | ||||
|         } | ||||
|     } | ||||
|   | ||||
| @@ -287,8 +287,6 @@ void if_start(struct ttys *); | ||||
|  long gethostid(void); | ||||
| #endif | ||||
|  | ||||
| void lprint(const char *, ...) GCC_FMT_ATTR(1, 2); | ||||
|  | ||||
| #ifndef _WIN32 | ||||
| #include <netdb.h> | ||||
| #endif | ||||
|   | ||||
| @@ -14,7 +14,6 @@ stub-obj-y += iothread-lock.o | ||||
| stub-obj-y += migr-blocker.o | ||||
| stub-obj-y += mon-is-qmp.o | ||||
| stub-obj-y += mon-printf.o | ||||
| stub-obj-y += mon-print-filename.o | ||||
| stub-obj-y += mon-protocol-event.o | ||||
| stub-obj-y += mon-set-error.o | ||||
| stub-obj-y += pci-drive-hot-add.o | ||||
|   | ||||
| @@ -4,6 +4,6 @@ | ||||
|  | ||||
| CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp) | ||||
| { | ||||
|     error_set(errp, QERR_NOT_SUPPORTED); | ||||
|     error_set(errp, QERR_UNSUPPORTED); | ||||
|     return NULL; | ||||
| } | ||||
|   | ||||
| @@ -1,6 +0,0 @@ | ||||
| #include "qemu-common.h" | ||||
| #include "monitor/monitor.h" | ||||
|  | ||||
| void monitor_print_filename(Monitor *mon, const char *filename) | ||||
| { | ||||
| } | ||||
| @@ -126,6 +126,9 @@ typedef struct CPUS390XState { | ||||
|     uint64_t pfault_compare; | ||||
|     uint64_t pfault_select; | ||||
|  | ||||
|     uint64_t gbea; | ||||
|     uint64_t pp; | ||||
|  | ||||
|     CPU_COMMON | ||||
|  | ||||
|     /* reset does memset(0) up to here */ | ||||
|   | ||||
| @@ -36,6 +36,7 @@ | ||||
| #include "sysemu/device_tree.h" | ||||
| #include "qapi/qmp/qjson.h" | ||||
| #include "monitor/monitor.h" | ||||
| #include "trace.h" | ||||
|  | ||||
| /* #define DEBUG_KVM */ | ||||
|  | ||||
| @@ -128,14 +129,42 @@ void kvm_arch_reset_vcpu(CPUState *cpu) | ||||
|     } | ||||
| } | ||||
|  | ||||
| static int kvm_set_one_reg(CPUState *cs, uint64_t id, void *source) | ||||
| { | ||||
|     struct kvm_one_reg reg; | ||||
|     int r; | ||||
|  | ||||
|     reg.id = id; | ||||
|     reg.addr = (uint64_t) source; | ||||
|     r = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, ®); | ||||
|     if (r) { | ||||
|         trace_kvm_failed_reg_set(id, strerror(errno)); | ||||
|     } | ||||
|     return r; | ||||
| } | ||||
|  | ||||
| static int kvm_get_one_reg(CPUState *cs, uint64_t id, void *target) | ||||
| { | ||||
|     struct kvm_one_reg reg; | ||||
|     int r; | ||||
|  | ||||
|     reg.id = id; | ||||
|     reg.addr = (uint64_t) target; | ||||
|     r = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, ®); | ||||
|     if (r) { | ||||
|         trace_kvm_failed_reg_get(id, strerror(errno)); | ||||
|     } | ||||
|     return r; | ||||
| } | ||||
|  | ||||
|  | ||||
| int kvm_arch_put_registers(CPUState *cs, int level) | ||||
| { | ||||
|     S390CPU *cpu = S390_CPU(cs); | ||||
|     CPUS390XState *env = &cpu->env; | ||||
|     struct kvm_one_reg reg; | ||||
|     struct kvm_sregs sregs; | ||||
|     struct kvm_regs regs; | ||||
|     int ret; | ||||
|     int r; | ||||
|     int i; | ||||
|  | ||||
|     /* always save the PSW  and the GPRS*/ | ||||
| @@ -151,9 +180,9 @@ int kvm_arch_put_registers(CPUState *cs, int level) | ||||
|         for (i = 0; i < 16; i++) { | ||||
|             regs.gprs[i] = env->regs[i]; | ||||
|         } | ||||
|         ret = kvm_vcpu_ioctl(cs, KVM_SET_REGS, ®s); | ||||
|         if (ret < 0) { | ||||
|             return ret; | ||||
|         r = kvm_vcpu_ioctl(cs, KVM_SET_REGS, ®s); | ||||
|         if (r < 0) { | ||||
|             return r; | ||||
|         } | ||||
|     } | ||||
|  | ||||
| @@ -162,47 +191,29 @@ int kvm_arch_put_registers(CPUState *cs, int level) | ||||
|         return 0; | ||||
|     } | ||||
|  | ||||
|     reg.id = KVM_REG_S390_CPU_TIMER; | ||||
|     reg.addr = (__u64)&(env->cputm); | ||||
|     ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, ®); | ||||
|     if (ret < 0) { | ||||
|         return ret; | ||||
|     } | ||||
|  | ||||
|     reg.id = KVM_REG_S390_CLOCK_COMP; | ||||
|     reg.addr = (__u64)&(env->ckc); | ||||
|     ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, ®); | ||||
|     if (ret < 0) { | ||||
|         return ret; | ||||
|     } | ||||
|  | ||||
|     reg.id = KVM_REG_S390_TODPR; | ||||
|     reg.addr = (__u64)&(env->todpr); | ||||
|     ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, ®); | ||||
|     if (ret < 0) { | ||||
|         return ret; | ||||
|     } | ||||
|     /* | ||||
|      * These ONE_REGS are not protected by a capability. As they are only | ||||
|      * necessary for migration we just trace a possible error, but don't | ||||
|      * return with an error return code. | ||||
|      */ | ||||
|     kvm_set_one_reg(cs, KVM_REG_S390_CPU_TIMER, &env->cputm); | ||||
|     kvm_set_one_reg(cs, KVM_REG_S390_CLOCK_COMP, &env->ckc); | ||||
|     kvm_set_one_reg(cs, KVM_REG_S390_TODPR, &env->todpr); | ||||
|     kvm_set_one_reg(cs, KVM_REG_S390_GBEA, &env->gbea); | ||||
|     kvm_set_one_reg(cs, KVM_REG_S390_PP, &env->pp); | ||||
|  | ||||
|     if (cap_async_pf) { | ||||
|         reg.id = KVM_REG_S390_PFTOKEN; | ||||
|         reg.addr = (__u64)&(env->pfault_token); | ||||
|         ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, ®); | ||||
|         if (ret < 0) { | ||||
|             return ret; | ||||
|         r = kvm_set_one_reg(cs, KVM_REG_S390_PFTOKEN, &env->pfault_token); | ||||
|         if (r < 0) { | ||||
|             return r; | ||||
|         } | ||||
|  | ||||
|         reg.id = KVM_REG_S390_PFCOMPARE; | ||||
|         reg.addr = (__u64)&(env->pfault_compare); | ||||
|         ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, ®); | ||||
|         if (ret < 0) { | ||||
|             return ret; | ||||
|         r = kvm_set_one_reg(cs, KVM_REG_S390_PFCOMPARE, &env->pfault_compare); | ||||
|         if (r < 0) { | ||||
|             return r; | ||||
|         } | ||||
|  | ||||
|         reg.id = KVM_REG_S390_PFSELECT; | ||||
|         reg.addr = (__u64)&(env->pfault_select); | ||||
|         ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, ®); | ||||
|         if (ret < 0) { | ||||
|             return ret; | ||||
|         r = kvm_set_one_reg(cs, KVM_REG_S390_PFSELECT, &env->pfault_select); | ||||
|         if (r < 0) { | ||||
|             return r; | ||||
|         } | ||||
|     } | ||||
|  | ||||
| @@ -220,9 +231,9 @@ int kvm_arch_put_registers(CPUState *cs, int level) | ||||
|             sregs.acrs[i] = env->aregs[i]; | ||||
|             sregs.crs[i] = env->cregs[i]; | ||||
|         } | ||||
|         ret = kvm_vcpu_ioctl(cs, KVM_SET_SREGS, &sregs); | ||||
|         if (ret < 0) { | ||||
|             return ret; | ||||
|         r = kvm_vcpu_ioctl(cs, KVM_SET_SREGS, &sregs); | ||||
|         if (r < 0) { | ||||
|             return r; | ||||
|         } | ||||
|     } | ||||
|  | ||||
| @@ -240,7 +251,6 @@ int kvm_arch_get_registers(CPUState *cs) | ||||
| { | ||||
|     S390CPU *cpu = S390_CPU(cs); | ||||
|     CPUS390XState *env = &cpu->env; | ||||
|     struct kvm_one_reg reg; | ||||
|     struct kvm_sregs sregs; | ||||
|     struct kvm_regs regs; | ||||
|     int i, r; | ||||
| @@ -288,46 +298,27 @@ int kvm_arch_get_registers(CPUState *cs) | ||||
|         env->psa = cs->kvm_run->s.regs.prefix; | ||||
|     } | ||||
|  | ||||
|     /* One Regs */ | ||||
|     reg.id = KVM_REG_S390_CPU_TIMER; | ||||
|     reg.addr = (__u64)&(env->cputm); | ||||
|     r = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, ®); | ||||
|     if (r < 0) { | ||||
|         return r; | ||||
|     } | ||||
|  | ||||
|     reg.id = KVM_REG_S390_CLOCK_COMP; | ||||
|     reg.addr = (__u64)&(env->ckc); | ||||
|     r = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, ®); | ||||
|     if (r < 0) { | ||||
|         return r; | ||||
|     } | ||||
|  | ||||
|     reg.id = KVM_REG_S390_TODPR; | ||||
|     reg.addr = (__u64)&(env->todpr); | ||||
|     r = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, ®); | ||||
|     if (r < 0) { | ||||
|         return r; | ||||
|     } | ||||
|     /* | ||||
|      * These ONE_REGS are not protected by a capability. As they are only | ||||
|      * necessary for migration we just trace a possible error, but don't | ||||
|      * return with an error return code. | ||||
|      */ | ||||
|     kvm_get_one_reg(cs, KVM_REG_S390_CPU_TIMER, &env->cputm); | ||||
|     kvm_get_one_reg(cs, KVM_REG_S390_CLOCK_COMP, &env->ckc); | ||||
|     kvm_get_one_reg(cs, KVM_REG_S390_TODPR, &env->todpr); | ||||
|     kvm_get_one_reg(cs, KVM_REG_S390_GBEA, &env->gbea); | ||||
|     kvm_get_one_reg(cs, KVM_REG_S390_PP, &env->pp); | ||||
|  | ||||
|     if (cap_async_pf) { | ||||
|         reg.id = KVM_REG_S390_PFTOKEN; | ||||
|         reg.addr = (__u64)&(env->pfault_token); | ||||
|         r = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, ®); | ||||
|         r = kvm_get_one_reg(cs, KVM_REG_S390_PFTOKEN, &env->pfault_token); | ||||
|         if (r < 0) { | ||||
|             return r; | ||||
|         } | ||||
|  | ||||
|         reg.id = KVM_REG_S390_PFCOMPARE; | ||||
|         reg.addr = (__u64)&(env->pfault_compare); | ||||
|         r = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, ®); | ||||
|         r = kvm_get_one_reg(cs, KVM_REG_S390_PFCOMPARE, &env->pfault_compare); | ||||
|         if (r < 0) { | ||||
|             return r; | ||||
|         } | ||||
|  | ||||
|         reg.id = KVM_REG_S390_PFSELECT; | ||||
|         reg.addr = (__u64)&(env->pfault_select); | ||||
|         r = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, ®); | ||||
|         r = kvm_get_one_reg(cs, KVM_REG_S390_PFSELECT, &env->pfault_select); | ||||
|         if (r < 0) { | ||||
|             return r; | ||||
|         } | ||||
| @@ -383,6 +374,26 @@ int kvm_arch_remove_sw_breakpoint(CPUState *cs, struct kvm_sw_breakpoint *bp) | ||||
|     return 0; | ||||
| } | ||||
|  | ||||
| int kvm_arch_insert_hw_breakpoint(target_ulong addr, | ||||
|                                   target_ulong len, int type) | ||||
| { | ||||
|     return -ENOSYS; | ||||
| } | ||||
|  | ||||
| int kvm_arch_remove_hw_breakpoint(target_ulong addr, | ||||
|                                   target_ulong len, int type) | ||||
| { | ||||
|     return -ENOSYS; | ||||
| } | ||||
|  | ||||
| void kvm_arch_remove_all_hw_breakpoints(void) | ||||
| { | ||||
| } | ||||
|  | ||||
| void kvm_arch_update_guest_debug(CPUState *cpu, struct kvm_guest_debug *dbg) | ||||
| { | ||||
| } | ||||
|  | ||||
| void kvm_arch_pre_run(CPUState *cpu, struct kvm_run *run) | ||||
| { | ||||
| } | ||||
| @@ -844,6 +855,11 @@ static int handle_tsch(S390CPU *cpu) | ||||
|     return ret; | ||||
| } | ||||
|  | ||||
| static int kvm_arch_handle_debug_exit(S390CPU *cpu) | ||||
| { | ||||
|     return -ENOSYS; | ||||
| } | ||||
|  | ||||
| int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run) | ||||
| { | ||||
|     S390CPU *cpu = S390_CPU(cs); | ||||
| @@ -859,6 +875,9 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run) | ||||
|         case KVM_EXIT_S390_TSCH: | ||||
|             ret = handle_tsch(cpu); | ||||
|             break; | ||||
|         case KVM_EXIT_DEBUG: | ||||
|             ret = kvm_arch_handle_debug_exit(cpu); | ||||
|             break; | ||||
|         default: | ||||
|             fprintf(stderr, "Unknown KVM exit: %d\n", run->exit_reason); | ||||
|             break; | ||||
|   | ||||
| @@ -336,7 +336,7 @@ uint32_t HELPER(stsi)(CPUS390XState *env, uint64_t a0, | ||||
|             ebcdic_put(sysib.model, "QEMU            ", 16); | ||||
|             ebcdic_put(sysib.sequence, "QEMU            ", 16); | ||||
|             ebcdic_put(sysib.plant, "QEMU", 4); | ||||
|             cpu_physical_memory_rw(a0, (uint8_t *)&sysib, sizeof(sysib), 1); | ||||
|             cpu_physical_memory_write(a0, &sysib, sizeof(sysib)); | ||||
|         } else if ((sel1 == 2) && (sel2 == 1)) { | ||||
|             /* Basic Machine CPU */ | ||||
|             struct sysib_121 sysib; | ||||
| @@ -346,7 +346,7 @@ uint32_t HELPER(stsi)(CPUS390XState *env, uint64_t a0, | ||||
|             ebcdic_put(sysib.sequence, "QEMUQEMUQEMUQEMU", 16); | ||||
|             ebcdic_put(sysib.plant, "QEMU", 4); | ||||
|             stw_p(&sysib.cpu_addr, env->cpu_num); | ||||
|             cpu_physical_memory_rw(a0, (uint8_t *)&sysib, sizeof(sysib), 1); | ||||
|             cpu_physical_memory_write(a0, &sysib, sizeof(sysib)); | ||||
|         } else if ((sel1 == 2) && (sel2 == 2)) { | ||||
|             /* Basic Machine CPUs */ | ||||
|             struct sysib_122 sysib; | ||||
| @@ -358,7 +358,7 @@ uint32_t HELPER(stsi)(CPUS390XState *env, uint64_t a0, | ||||
|             stw_p(&sysib.active_cpus, 1); | ||||
|             stw_p(&sysib.standby_cpus, 0); | ||||
|             stw_p(&sysib.reserved_cpus, 0); | ||||
|             cpu_physical_memory_rw(a0, (uint8_t *)&sysib, sizeof(sysib), 1); | ||||
|             cpu_physical_memory_write(a0, &sysib, sizeof(sysib)); | ||||
|         } else { | ||||
|             cc = 3; | ||||
|         } | ||||
| @@ -375,7 +375,7 @@ uint32_t HELPER(stsi)(CPUS390XState *env, uint64_t a0, | ||||
|                 ebcdic_put(sysib.plant, "QEMU", 4); | ||||
|                 stw_p(&sysib.cpu_addr, env->cpu_num); | ||||
|                 stw_p(&sysib.cpu_id, 0); | ||||
|                 cpu_physical_memory_rw(a0, (uint8_t *)&sysib, sizeof(sysib), 1); | ||||
|                 cpu_physical_memory_write(a0, &sysib, sizeof(sysib)); | ||||
|             } else if ((sel1 == 2) && (sel2 == 2)) { | ||||
|                 /* LPAR CPUs */ | ||||
|                 struct sysib_222 sysib; | ||||
| @@ -392,7 +392,7 @@ uint32_t HELPER(stsi)(CPUS390XState *env, uint64_t a0, | ||||
|                 stl_p(&sysib.caf, 1000); | ||||
|                 stw_p(&sysib.dedicated_cpus, 0); | ||||
|                 stw_p(&sysib.shared_cpus, 0); | ||||
|                 cpu_physical_memory_rw(a0, (uint8_t *)&sysib, sizeof(sysib), 1); | ||||
|                 cpu_physical_memory_write(a0, &sysib, sizeof(sysib)); | ||||
|             } else { | ||||
|                 cc = 3; | ||||
|             } | ||||
| @@ -414,7 +414,7 @@ uint32_t HELPER(stsi)(CPUS390XState *env, uint64_t a0, | ||||
|                 ebcdic_put(sysib.vm[0].name, "KVMguest", 8); | ||||
|                 stl_p(&sysib.vm[0].caf, 1000); | ||||
|                 ebcdic_put(sysib.vm[0].cpi, "KVM/Linux       ", 16); | ||||
|                 cpu_physical_memory_rw(a0, (uint8_t *)&sysib, sizeof(sysib), 1); | ||||
|                 cpu_physical_memory_write(a0, &sysib, sizeof(sysib)); | ||||
|             } else { | ||||
|                 cc = 3; | ||||
|             } | ||||
|   | ||||
							
								
								
									
										12
									
								
								tests/.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										12
									
								
								tests/.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -7,20 +7,28 @@ check-qstring | ||||
| check-qom-interface | ||||
| test-aio | ||||
| test-bitops | ||||
| test-throttle | ||||
| test-coroutine | ||||
| test-cutils | ||||
| test-hbitmap | ||||
| test-int128 | ||||
| test-iov | ||||
| test-mul64 | ||||
| test-opts-visitor | ||||
| test-qapi-types.[ch] | ||||
| test-qapi-visit.[ch] | ||||
| test-qdev-global-props | ||||
| test-qmp-commands.h | ||||
| test-qmp-commands | ||||
| test-qmp-commands.h | ||||
| test-qmp-input-strict | ||||
| test-qmp-input-visitor | ||||
| test-qmp-marshal.c | ||||
| test-qmp-output-visitor | ||||
| test-rfifolock | ||||
| test-string-input-visitor | ||||
| test-string-output-visitor | ||||
| test-thread-pool | ||||
| test-throttle | ||||
| test-visitor-serialization | ||||
| test-vmstate | ||||
| test-x86-cpuid | ||||
| test-xbzrle | ||||
|   | ||||
| @@ -113,10 +113,6 @@ check-qtest-pci-y += tests/tpci200-test$(EXESUF) | ||||
| gcov-files-pci-y += hw/ipack/tpci200.c | ||||
| check-qtest-pci-y += $(check-qtest-ipack-y) | ||||
| gcov-files-pci-y += $(gcov-files-ipack-y) | ||||
| check-qtest-pci-y += tests/display-vga-test$(EXESUF) | ||||
| gcov-files-pci-y += hw/display/vga.c | ||||
| gcov-files-pci-y += hw/display/cirrus_vga.c | ||||
| gcov-files-pci-y += hw/display/vga-pci.c | ||||
|  | ||||
| check-qtest-i386-y = tests/endianness-test$(EXESUF) | ||||
| check-qtest-i386-y += tests/fdc-test$(EXESUF) | ||||
| @@ -284,7 +280,6 @@ tests/virtio-9p-test$(EXESUF): tests/virtio-9p-test.o | ||||
| tests/virtio-serial-test$(EXESUF): tests/virtio-serial-test.o | ||||
| tests/virtio-console-test$(EXESUF): tests/virtio-console-test.o | ||||
| tests/tpci200-test$(EXESUF): tests/tpci200-test.o | ||||
| tests/display-vga-test$(EXESUF): tests/display-vga-test.o | ||||
| tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o | ||||
| tests/qom-test$(EXESUF): tests/qom-test.o | ||||
| tests/blockdev-test$(EXESUF): tests/blockdev-test.o $(libqos-pc-obj-y) | ||||
|   | ||||
| @@ -1,52 +0,0 @@ | ||||
| /* | ||||
|  * QTest testcase for vga cards | ||||
|  * | ||||
|  * Copyright (c) 2014 Red Hat, Inc | ||||
|  * | ||||
|  * This work is licensed under the terms of the GNU GPL, version 2 or later. | ||||
|  * See the COPYING file in the top-level directory. | ||||
|  */ | ||||
|  | ||||
| #include <glib.h> | ||||
| #include <string.h> | ||||
| #include "libqtest.h" | ||||
| #include "qemu/osdep.h" | ||||
|  | ||||
| static void pci_cirrus(void) | ||||
| { | ||||
|     qtest_start("-vga none -device cirrus-vga"); | ||||
|     qtest_end(); | ||||
| } | ||||
|  | ||||
| static void pci_stdvga(void) | ||||
| { | ||||
|     qtest_start("-vga none -device VGA"); | ||||
|     qtest_end(); | ||||
| } | ||||
|  | ||||
| static void pci_secondary(void) | ||||
| { | ||||
|     qtest_start("-vga none -device secondary-vga"); | ||||
|     qtest_end(); | ||||
| } | ||||
|  | ||||
| static void pci_multihead(void) | ||||
| { | ||||
|     qtest_start("-vga none -device VGA -device secondary-vga"); | ||||
|     qtest_end(); | ||||
| } | ||||
|  | ||||
| int main(int argc, char **argv) | ||||
| { | ||||
|     int ret; | ||||
|  | ||||
|     g_test_init(&argc, &argv, NULL); | ||||
|  | ||||
|     qtest_add_func("/display/pci/cirrus", pci_cirrus); | ||||
|     qtest_add_func("/display/pci/stdvga", pci_stdvga); | ||||
|     qtest_add_func("/display/pci/secondary", pci_secondary); | ||||
|     qtest_add_func("/display/pci/multihead", pci_multihead); | ||||
|     ret = g_test_run(); | ||||
|  | ||||
|     return ret; | ||||
| } | ||||
| @@ -50,15 +50,7 @@ class TestSingleDrive(iotests.QMPTestCase): | ||||
|         result = self.vm.qmp('block-stream', device='drive0') | ||||
|         self.assert_qmp(result, 'return', {}) | ||||
|  | ||||
|         completed = False | ||||
|         while not completed: | ||||
|             for event in self.vm.get_qmp_events(wait=True): | ||||
|                 if event['event'] == 'BLOCK_JOB_COMPLETED': | ||||
|                     self.assert_qmp(event, 'data/type', 'stream') | ||||
|                     self.assert_qmp(event, 'data/device', 'drive0') | ||||
|                     self.assert_qmp(event, 'data/offset', self.image_len) | ||||
|                     self.assert_qmp(event, 'data/len', self.image_len) | ||||
|                     completed = True | ||||
|         self.wait_until_completed() | ||||
|  | ||||
|         self.assert_no_active_block_jobs() | ||||
|         self.vm.shutdown() | ||||
| @@ -89,15 +81,7 @@ class TestSingleDrive(iotests.QMPTestCase): | ||||
|         self.assert_qmp(result, 'return', {}) | ||||
|  | ||||
|         self.vm.resume_drive('drive0') | ||||
|         completed = False | ||||
|         while not completed: | ||||
|             for event in self.vm.get_qmp_events(wait=True): | ||||
|                 if event['event'] == 'BLOCK_JOB_COMPLETED': | ||||
|                     self.assert_qmp(event, 'data/type', 'stream') | ||||
|                     self.assert_qmp(event, 'data/device', 'drive0') | ||||
|                     self.assert_qmp(event, 'data/offset', self.image_len) | ||||
|                     self.assert_qmp(event, 'data/len', self.image_len) | ||||
|                     completed = True | ||||
|         self.wait_until_completed() | ||||
|  | ||||
|         self.assert_no_active_block_jobs() | ||||
|         self.vm.shutdown() | ||||
| @@ -112,15 +96,7 @@ class TestSingleDrive(iotests.QMPTestCase): | ||||
|         result = self.vm.qmp('block-stream', device='drive0', base=mid_img) | ||||
|         self.assert_qmp(result, 'return', {}) | ||||
|  | ||||
|         completed = False | ||||
|         while not completed: | ||||
|             for event in self.vm.get_qmp_events(wait=True): | ||||
|                 if event['event'] == 'BLOCK_JOB_COMPLETED': | ||||
|                     self.assert_qmp(event, 'data/type', 'stream') | ||||
|                     self.assert_qmp(event, 'data/device', 'drive0') | ||||
|                     self.assert_qmp(event, 'data/offset', self.image_len) | ||||
|                     self.assert_qmp(event, 'data/len', self.image_len) | ||||
|                     completed = True | ||||
|         self.wait_until_completed() | ||||
|  | ||||
|         self.assert_no_active_block_jobs() | ||||
|         self.vm.shutdown() | ||||
| @@ -152,15 +128,7 @@ class TestSmallerBackingFile(iotests.QMPTestCase): | ||||
|         result = self.vm.qmp('block-stream', device='drive0') | ||||
|         self.assert_qmp(result, 'return', {}) | ||||
|  | ||||
|         completed = False | ||||
|         while not completed: | ||||
|             for event in self.vm.get_qmp_events(wait=True): | ||||
|                 if event['event'] == 'BLOCK_JOB_COMPLETED': | ||||
|                     self.assert_qmp(event, 'data/type', 'stream') | ||||
|                     self.assert_qmp(event, 'data/device', 'drive0') | ||||
|                     self.assert_qmp(event, 'data/offset', self.image_len) | ||||
|                     self.assert_qmp(event, 'data/len', self.image_len) | ||||
|                     completed = True | ||||
|         self.wait_until_completed() | ||||
|  | ||||
|         self.assert_no_active_block_jobs() | ||||
|         self.vm.shutdown() | ||||
| @@ -442,15 +410,7 @@ class TestSetSpeed(iotests.QMPTestCase): | ||||
|         result = self.vm.qmp('block-job-set-speed', device='drive0', speed=8 * 1024 * 1024) | ||||
|         self.assert_qmp(result, 'return', {}) | ||||
|  | ||||
|         completed = False | ||||
|         while not completed: | ||||
|             for event in self.vm.get_qmp_events(wait=True): | ||||
|                 if event['event'] == 'BLOCK_JOB_COMPLETED': | ||||
|                     self.assert_qmp(event, 'data/type', 'stream') | ||||
|                     self.assert_qmp(event, 'data/device', 'drive0') | ||||
|                     self.assert_qmp(event, 'data/offset', self.image_len) | ||||
|                     self.assert_qmp(event, 'data/len', self.image_len) | ||||
|                     completed = True | ||||
|         self.wait_until_completed() | ||||
|  | ||||
|         self.assert_no_active_block_jobs() | ||||
|  | ||||
|   | ||||
| @@ -57,14 +57,7 @@ class TestSyncModesNoneAndTop(iotests.QMPTestCase): | ||||
|                              format=iotests.imgfmt, target=target_img) | ||||
|         self.assert_qmp(result, 'return', {}) | ||||
|  | ||||
|         # Custom completed check as we are not copying all data. | ||||
|         completed = False | ||||
|         while not completed: | ||||
|             for event in self.vm.get_qmp_events(wait=True): | ||||
|                 if event['event'] == 'BLOCK_JOB_COMPLETED': | ||||
|                     self.assert_qmp(event, 'data/device', 'drive0') | ||||
|                     self.assert_qmp_absent(event, 'data/error') | ||||
|                     completed = True | ||||
|         self.wait_until_completed(check_offset=False) | ||||
|  | ||||
|         self.assert_no_active_block_jobs() | ||||
|         self.vm.shutdown() | ||||
|   | ||||
| @@ -257,7 +257,7 @@ class QMPTestCase(unittest.TestCase): | ||||
|         self.assert_no_active_block_jobs() | ||||
|         return result | ||||
|  | ||||
|     def wait_until_completed(self, drive='drive0'): | ||||
|     def wait_until_completed(self, drive='drive0', check_offset=True): | ||||
|         '''Wait for a block job to finish, returning the event''' | ||||
|         completed = False | ||||
|         while not completed: | ||||
| @@ -265,7 +265,8 @@ class QMPTestCase(unittest.TestCase): | ||||
|                 if event['event'] == 'BLOCK_JOB_COMPLETED': | ||||
|                     self.assert_qmp(event, 'data/device', drive) | ||||
|                     self.assert_qmp_absent(event, 'data/error') | ||||
|                     self.assert_qmp(event, 'data/offset', self.image_len) | ||||
|                     if check_offset: | ||||
|                         self.assert_qmp(event, 'data/offset', self.image_len) | ||||
|                     self.assert_qmp(event, 'data/len', self.image_len) | ||||
|                     completed = True | ||||
|  | ||||
|   | ||||
| @@ -153,7 +153,7 @@ static void test_validate_union_flat(TestInputVisitorData *data, | ||||
|     /* TODO when generator bug is fixed, add 'integer': 41 */ | ||||
|  | ||||
|     visit_type_UserDefFlatUnion(v, &tmp, NULL, &errp); | ||||
|     g_assert(!error_is_set(&errp)); | ||||
|     g_assert(!errp); | ||||
|     qapi_free_UserDefFlatUnion(tmp); | ||||
| } | ||||
|  | ||||
| @@ -167,7 +167,7 @@ static void test_validate_union_anon(TestInputVisitorData *data, | ||||
|     v = validate_test_init(data, "42"); | ||||
|  | ||||
|     visit_type_UserDefAnonUnion(v, &tmp, NULL, &errp); | ||||
|     g_assert(!error_is_set(&errp)); | ||||
|     g_assert(!errp); | ||||
|     qapi_free_UserDefAnonUnion(tmp); | ||||
| } | ||||
|  | ||||
| @@ -240,7 +240,7 @@ static void test_validate_fail_union_flat(TestInputVisitorData *data, | ||||
|     v = validate_test_init(data, "{ 'string': 'c', 'integer': 41, 'boolean': true }"); | ||||
|  | ||||
|     visit_type_UserDefFlatUnion(v, &tmp, NULL, &errp); | ||||
|     g_assert(error_is_set(&errp)); | ||||
|     g_assert(errp); | ||||
|     qapi_free_UserDefFlatUnion(tmp); | ||||
| } | ||||
|  | ||||
| @@ -254,7 +254,7 @@ static void test_validate_fail_union_anon(TestInputVisitorData *data, | ||||
|     v = validate_test_init(data, "3.14"); | ||||
|  | ||||
|     visit_type_UserDefAnonUnion(v, &tmp, NULL, &errp); | ||||
|     g_assert(error_is_set(&errp)); | ||||
|     g_assert(errp); | ||||
|     qapi_free_UserDefAnonUnion(tmp); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -1243,3 +1243,7 @@ xen_pv_mmio_write(uint64_t addr) "WARNING: write to Xen PV Device MMIO space (ad | ||||
| # hw/pci/pci_host.c | ||||
| pci_cfg_read(const char *dev, unsigned devid, unsigned fnid, unsigned offs, unsigned val) "%s %02u:%u @0x%x -> 0x%x" | ||||
| pci_cfg_write(const char *dev, unsigned devid, unsigned fnid, unsigned offs, unsigned val) "%s %02u:%u @0x%x <- 0x%x" | ||||
|  | ||||
| # target-s390/kvm.c | ||||
| kvm_failed_reg_get(uint64_t id, const char *msg) "Warning: Unable to retrieve ONEREG %" PRIu64 " from KVM: %s" | ||||
| kvm_failed_reg_set(uint64_t id, const char *msg) "Warning: Unable to set ONEREG %" PRIu64 " to KVM: %s" | ||||
|   | ||||
							
								
								
									
										88
									
								
								ui/gtk.c
									
									
									
									
									
								
							
							
						
						
									
										88
									
								
								ui/gtk.c
									
									
									
									
									
								
							| @@ -93,13 +93,12 @@ static inline void gdk_drawable_get_size(GdkWindow *w, gint *ww, gint *wh) | ||||
| #define GDK_KEY_2 GDK_2 | ||||
| #define GDK_KEY_f GDK_f | ||||
| #define GDK_KEY_g GDK_g | ||||
| #define GDK_KEY_q GDK_q | ||||
| #define GDK_KEY_plus GDK_plus | ||||
| #define GDK_KEY_minus GDK_minus | ||||
| #endif | ||||
|  | ||||
| #define HOTKEY_MODIFIERS        (GDK_CONTROL_MASK | GDK_MOD1_MASK) | ||||
| #define IGNORE_MODIFIER_MASK \ | ||||
|     (GDK_MODIFIER_MASK & ~(GDK_LOCK_MASK | GDK_MOD2_MASK)) | ||||
|  | ||||
| static const int modifier_keycode[] = { | ||||
|     /* shift, control, alt keys, meta keys, both left & right */ | ||||
| @@ -114,7 +113,6 @@ typedef struct VirtualConsole | ||||
|     GtkWidget *scrolled_window; | ||||
|     CharDriverState *chr; | ||||
| #endif | ||||
|     int fd; | ||||
| } VirtualConsole; | ||||
|  | ||||
| typedef struct GtkDisplayState | ||||
| @@ -489,24 +487,6 @@ static void gd_mouse_mode_change(Notifier *notify, void *data) | ||||
|  | ||||
| /** GTK Events **/ | ||||
|  | ||||
| static gboolean gd_window_key_event(GtkWidget *widget, GdkEventKey *key, void *opaque) | ||||
| { | ||||
|     GtkDisplayState *s = opaque; | ||||
|     gboolean handled = FALSE; | ||||
|  | ||||
|     if (!gd_is_grab_active(s) || | ||||
|         (key->state & IGNORE_MODIFIER_MASK) == HOTKEY_MODIFIERS) { | ||||
|         handled = gtk_window_activate_key(GTK_WINDOW(widget), key); | ||||
|     } | ||||
|     if (handled) { | ||||
|         gtk_release_modifiers(s); | ||||
|     } else { | ||||
|         handled = gtk_window_propagate_key_event(GTK_WINDOW(widget), key); | ||||
|     } | ||||
|  | ||||
|     return handled; | ||||
| } | ||||
|  | ||||
| static gboolean gd_window_close(GtkWidget *widget, GdkEvent *event, | ||||
|                                 void *opaque) | ||||
| { | ||||
| @@ -1161,9 +1141,12 @@ static gboolean gd_focus_out_event(GtkWidget *widget, | ||||
|  | ||||
| static int gd_vc_chr_write(CharDriverState *chr, const uint8_t *buf, int len) | ||||
| { | ||||
| #if defined(CONFIG_VTE) | ||||
|     VirtualConsole *vc = chr->opaque; | ||||
|  | ||||
|     return vc ? write(vc->fd, buf, len) : len; | ||||
|     vte_terminal_feed(VTE_TERMINAL(vc->terminal), (const char *)buf, len); | ||||
| #endif | ||||
|     return len; | ||||
| } | ||||
|  | ||||
| static int nb_vcs; | ||||
| @@ -1189,19 +1172,12 @@ void early_gtk_display_init(void) | ||||
| } | ||||
|  | ||||
| #if defined(CONFIG_VTE) | ||||
| static gboolean gd_vc_in(GIOChannel *chan, GIOCondition cond, void *opaque) | ||||
| static gboolean gd_vc_in(VteTerminal *terminal, gchar *text, guint size, | ||||
|                          gpointer user_data) | ||||
| { | ||||
|     VirtualConsole *vc = opaque; | ||||
|     uint8_t buffer[1024]; | ||||
|     ssize_t len; | ||||
|  | ||||
|     len = read(vc->fd, buffer, sizeof(buffer)); | ||||
|     if (len <= 0) { | ||||
|         return FALSE; | ||||
|     } | ||||
|  | ||||
|     qemu_chr_be_write(vc->chr, buffer, len); | ||||
|     VirtualConsole *vc = user_data; | ||||
|  | ||||
|     qemu_chr_be_write(vc->chr, (uint8_t  *)text, (unsigned int)size); | ||||
|     return TRUE; | ||||
| } | ||||
| #endif | ||||
| @@ -1213,13 +1189,8 @@ static GSList *gd_vc_init(GtkDisplayState *s, VirtualConsole *vc, int index, GSL | ||||
|     const char *label; | ||||
|     char buffer[32]; | ||||
|     char path[32]; | ||||
| #if VTE_CHECK_VERSION(0, 26, 0) | ||||
|     VtePty *pty; | ||||
| #endif | ||||
|     GIOChannel *chan; | ||||
|     GtkWidget *scrolled_window; | ||||
|     GtkAdjustment *vadjustment; | ||||
|     int master_fd, slave_fd; | ||||
|  | ||||
|     snprintf(buffer, sizeof(buffer), "vc%d", index); | ||||
|     snprintf(path, sizeof(path), "<QEMU>/View/VC%d", index); | ||||
| @@ -1238,27 +1209,21 @@ static GSList *gd_vc_init(GtkDisplayState *s, VirtualConsole *vc, int index, GSL | ||||
|     gtk_accel_map_add_entry(path, GDK_KEY_2 + index, HOTKEY_MODIFIERS); | ||||
|  | ||||
|     vc->terminal = vte_terminal_new(); | ||||
|  | ||||
|     master_fd = qemu_openpty_raw(&slave_fd, NULL); | ||||
|     g_assert(master_fd != -1); | ||||
|  | ||||
| #if VTE_CHECK_VERSION(0, 26, 0) | ||||
|     pty = vte_pty_new_foreign(master_fd, NULL); | ||||
|     vte_terminal_set_pty_object(VTE_TERMINAL(vc->terminal), pty); | ||||
| #else | ||||
|     vte_terminal_set_pty(VTE_TERMINAL(vc->terminal), master_fd); | ||||
| #endif | ||||
|     g_signal_connect(vc->terminal, "commit", G_CALLBACK(gd_vc_in), vc); | ||||
|  | ||||
|     vte_terminal_set_scrollback_lines(VTE_TERMINAL(vc->terminal), -1); | ||||
|  | ||||
| #if VTE_CHECK_VERSION(0, 28, 0) && GTK_CHECK_VERSION(3, 0, 0) | ||||
|     vadjustment = gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(vc->terminal)); | ||||
| #else | ||||
|     vadjustment = vte_terminal_get_adjustment(VTE_TERMINAL(vc->terminal)); | ||||
| #endif | ||||
|  | ||||
|     scrolled_window = gtk_scrolled_window_new(NULL, vadjustment); | ||||
|     gtk_container_add(GTK_CONTAINER(scrolled_window), vc->terminal); | ||||
|  | ||||
|     vte_terminal_set_size(VTE_TERMINAL(vc->terminal), 80, 25); | ||||
|  | ||||
|     vc->fd = slave_fd; | ||||
|     vc->chr->opaque = vc; | ||||
|     vc->scrolled_window = scrolled_window; | ||||
|  | ||||
| @@ -1276,9 +1241,6 @@ static GSList *gd_vc_init(GtkDisplayState *s, VirtualConsole *vc, int index, GSL | ||||
|         vc->chr->init(vc->chr); | ||||
|     } | ||||
|  | ||||
|     chan = g_io_channel_unix_new(vc->fd); | ||||
|     g_io_add_watch(chan, G_IO_IN, gd_vc_in, vc); | ||||
|  | ||||
| #endif /* CONFIG_VTE */ | ||||
|     return group; | ||||
| } | ||||
| @@ -1290,8 +1252,6 @@ static void gd_connect_signals(GtkDisplayState *s) | ||||
|     g_signal_connect(s->show_tabs_item, "activate", | ||||
|                      G_CALLBACK(gd_menu_show_tabs), s); | ||||
|  | ||||
|     g_signal_connect(s->window, "key-press-event", | ||||
|                      G_CALLBACK(gd_window_key_event), s); | ||||
|     g_signal_connect(s->window, "delete-event", | ||||
|                      G_CALLBACK(gd_window_close), s); | ||||
|  | ||||
| @@ -1351,7 +1311,6 @@ static GtkWidget *gd_create_menu_machine(GtkDisplayState *s, GtkAccelGroup *acce | ||||
| { | ||||
|     GtkWidget *machine_menu; | ||||
|     GtkWidget *separator; | ||||
|     GtkStockItem item; | ||||
|  | ||||
|     machine_menu = gtk_menu_new(); | ||||
|     gtk_menu_set_accel_group(GTK_MENU(machine_menu), accel_group); | ||||
| @@ -1362,20 +1321,20 @@ static GtkWidget *gd_create_menu_machine(GtkDisplayState *s, GtkAccelGroup *acce | ||||
|     separator = gtk_separator_menu_item_new(); | ||||
|     gtk_menu_shell_append(GTK_MENU_SHELL(machine_menu), separator); | ||||
|  | ||||
|     s->reset_item = gtk_image_menu_item_new_with_mnemonic(_("_Reset")); | ||||
|     s->reset_item = gtk_menu_item_new_with_mnemonic(_("_Reset")); | ||||
|     gtk_menu_shell_append(GTK_MENU_SHELL(machine_menu), s->reset_item); | ||||
|  | ||||
|     s->powerdown_item = gtk_image_menu_item_new_with_mnemonic(_("Power _Down")); | ||||
|     s->powerdown_item = gtk_menu_item_new_with_mnemonic(_("Power _Down")); | ||||
|     gtk_menu_shell_append(GTK_MENU_SHELL(machine_menu), s->powerdown_item); | ||||
|  | ||||
|     separator = gtk_separator_menu_item_new(); | ||||
|     gtk_menu_shell_append(GTK_MENU_SHELL(machine_menu), separator); | ||||
|  | ||||
|     s->quit_item = gtk_image_menu_item_new_from_stock(GTK_STOCK_QUIT, NULL); | ||||
|     gtk_stock_lookup(GTK_STOCK_QUIT, &item); | ||||
|     s->quit_item = gtk_menu_item_new_with_mnemonic(_("_Quit")); | ||||
|     gtk_menu_item_set_accel_path(GTK_MENU_ITEM(s->quit_item), | ||||
|                                  "<QEMU>/Machine/Quit"); | ||||
|     gtk_accel_map_add_entry("<QEMU>/Machine/Quit", item.keyval, item.modifier); | ||||
|     gtk_accel_map_add_entry("<QEMU>/Machine/Quit", | ||||
|                             GDK_KEY_q, HOTKEY_MODIFIERS); | ||||
|     gtk_menu_shell_append(GTK_MENU_SHELL(machine_menu), s->quit_item); | ||||
|  | ||||
|     return machine_menu; | ||||
| @@ -1391,8 +1350,7 @@ static GtkWidget *gd_create_menu_view(GtkDisplayState *s, GtkAccelGroup *accel_g | ||||
|     view_menu = gtk_menu_new(); | ||||
|     gtk_menu_set_accel_group(GTK_MENU(view_menu), accel_group); | ||||
|  | ||||
|     s->full_screen_item = | ||||
|         gtk_image_menu_item_new_from_stock(GTK_STOCK_FULLSCREEN, NULL); | ||||
|     s->full_screen_item = gtk_menu_item_new_with_mnemonic(_("_Fullscreen")); | ||||
|     gtk_menu_item_set_accel_path(GTK_MENU_ITEM(s->full_screen_item), | ||||
|                                  "<QEMU>/View/Full Screen"); | ||||
|     gtk_accel_map_add_entry("<QEMU>/View/Full Screen", GDK_KEY_f, | ||||
| @@ -1402,21 +1360,21 @@ static GtkWidget *gd_create_menu_view(GtkDisplayState *s, GtkAccelGroup *accel_g | ||||
|     separator = gtk_separator_menu_item_new(); | ||||
|     gtk_menu_shell_append(GTK_MENU_SHELL(view_menu), separator); | ||||
|  | ||||
|     s->zoom_in_item = gtk_image_menu_item_new_from_stock(GTK_STOCK_ZOOM_IN, NULL); | ||||
|     s->zoom_in_item = gtk_menu_item_new_with_mnemonic(_("Zoom _In")); | ||||
|     gtk_menu_item_set_accel_path(GTK_MENU_ITEM(s->zoom_in_item), | ||||
|                                  "<QEMU>/View/Zoom In"); | ||||
|     gtk_accel_map_add_entry("<QEMU>/View/Zoom In", GDK_KEY_plus, | ||||
|                             HOTKEY_MODIFIERS); | ||||
|     gtk_menu_shell_append(GTK_MENU_SHELL(view_menu), s->zoom_in_item); | ||||
|  | ||||
|     s->zoom_out_item = gtk_image_menu_item_new_from_stock(GTK_STOCK_ZOOM_OUT, NULL); | ||||
|     s->zoom_out_item = gtk_menu_item_new_with_mnemonic(_("Zoom _Out")); | ||||
|     gtk_menu_item_set_accel_path(GTK_MENU_ITEM(s->zoom_out_item), | ||||
|                                  "<QEMU>/View/Zoom Out"); | ||||
|     gtk_accel_map_add_entry("<QEMU>/View/Zoom Out", GDK_KEY_minus, | ||||
|                             HOTKEY_MODIFIERS); | ||||
|     gtk_menu_shell_append(GTK_MENU_SHELL(view_menu), s->zoom_out_item); | ||||
|  | ||||
|     s->zoom_fixed_item = gtk_image_menu_item_new_from_stock(GTK_STOCK_ZOOM_100, NULL); | ||||
|     s->zoom_fixed_item = gtk_menu_item_new_with_mnemonic(_("Best _Fit")); | ||||
|     gtk_menu_item_set_accel_path(GTK_MENU_ITEM(s->zoom_fixed_item), | ||||
|                                  "<QEMU>/View/Zoom Fixed"); | ||||
|     gtk_accel_map_add_entry("<QEMU>/View/Zoom Fixed", GDK_KEY_0, | ||||
|   | ||||
							
								
								
									
										4
									
								
								ui/vnc.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								ui/vnc.c
									
									
									
									
									
								
							| @@ -996,7 +996,7 @@ static void audio_add(VncState *vs) | ||||
|     struct audio_capture_ops ops; | ||||
|  | ||||
|     if (vs->audio_cap) { | ||||
|         monitor_printf(default_mon, "audio already running\n"); | ||||
|         error_report("audio already running"); | ||||
|         return; | ||||
|     } | ||||
|  | ||||
| @@ -1006,7 +1006,7 @@ static void audio_add(VncState *vs) | ||||
|  | ||||
|     vs->audio_cap = AUD_add_capture(&vs->as, &ops, vs); | ||||
|     if (!vs->audio_cap) { | ||||
|         monitor_printf(default_mon, "Failed to add audio capture\n"); | ||||
|         error_report("Failed to add audio capture"); | ||||
|     } | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -12,10 +12,7 @@ | ||||
|  | ||||
| #include "qemu-common.h" | ||||
| #include "qapi/error.h" | ||||
| #include "qapi/qmp/qjson.h" | ||||
| #include "qapi/qmp/qdict.h" | ||||
| #include "qapi-types.h" | ||||
| #include "qapi/qmp/qerror.h" | ||||
| #include "qemu/error-report.h" | ||||
|  | ||||
| struct Error | ||||
| { | ||||
|   | ||||
| @@ -160,7 +160,9 @@ void init_paths(const char *prefix) | ||||
|     base = new_entry("", NULL, pref_buf); | ||||
|     base = add_dir_maybe(base); | ||||
|     if (base->num_entries == 0) { | ||||
|         free (base); | ||||
|         g_free(base->pathname); | ||||
|         free(base->name); | ||||
|         free(base); | ||||
|         base = NULL; | ||||
|     } else { | ||||
|         set_parents(base, base); | ||||
|   | ||||
| @@ -20,7 +20,7 @@ static QemuOptsList *find_list(QemuOptsList **lists, const char *group, | ||||
|             break; | ||||
|     } | ||||
|     if (lists[i] == NULL) { | ||||
|         error_set(errp, QERR_INVALID_OPTION_GROUP, group); | ||||
|         error_setg(errp, "There is no option group '%s'", group); | ||||
|     } | ||||
|     return lists[i]; | ||||
| } | ||||
| @@ -39,6 +39,20 @@ QemuOptsList *qemu_find_opts(const char *group) | ||||
|     return ret; | ||||
| } | ||||
|  | ||||
| QemuOpts *qemu_find_opts_singleton(const char *group) | ||||
| { | ||||
|     QemuOptsList *list; | ||||
|     QemuOpts *opts; | ||||
|  | ||||
|     list = qemu_find_opts(group); | ||||
|     assert(list); | ||||
|     opts = qemu_opts_find(list, NULL); | ||||
|     if (!opts) { | ||||
|         opts = qemu_opts_create(list, NULL, 0, &error_abort); | ||||
|     } | ||||
|     return opts; | ||||
| } | ||||
|  | ||||
| static CommandLineParameterInfoList *query_option_descs(const QemuOptDesc *desc) | ||||
| { | ||||
|     CommandLineParameterInfoList *param_list = NULL, *entry; | ||||
|   | ||||
| @@ -20,7 +20,7 @@ | ||||
|  */ | ||||
| void error_vprintf(const char *fmt, va_list ap) | ||||
| { | ||||
|     if (cur_mon) { | ||||
|     if (cur_mon && !monitor_cur_is_qmp()) { | ||||
|         monitor_vprintf(cur_mon, fmt, ap); | ||||
|     } else { | ||||
|         vfprintf(stderr, fmt, ap); | ||||
| @@ -165,7 +165,7 @@ const char *error_get_progname(void) | ||||
| /* | ||||
|  * Print current location to current monitor if we have one, else to stderr. | ||||
|  */ | ||||
| void error_print_loc(void) | ||||
| static void error_print_loc(void) | ||||
| { | ||||
|     const char *sep = ""; | ||||
|     int i; | ||||
|   | ||||
| @@ -819,7 +819,7 @@ QemuOpts *qemu_opts_create(QemuOptsList *list, const char *id, | ||||
|         opts = qemu_opts_find(list, id); | ||||
|         if (opts != NULL) { | ||||
|             if (fail_if_exists && !list->merge_lists) { | ||||
|                 error_set(errp, QERR_DUPLICATE_ID, id, list->name); | ||||
|                 error_setg(errp, "Duplicate ID '%s' for %s", id, list->name); | ||||
|                 return NULL; | ||||
|             } else { | ||||
|                 return opts; | ||||
|   | ||||
							
								
								
									
										103
									
								
								vl.c
									
									
									
									
									
								
							
							
						
						
									
										103
									
								
								vl.c
									
									
									
									
									
								
							| @@ -510,6 +510,20 @@ static QemuOptsList qemu_name_opts = { | ||||
|     }, | ||||
| }; | ||||
|  | ||||
| static QemuOptsList qemu_mem_opts = { | ||||
|     .name = "memory", | ||||
|     .implied_opt_name = "size", | ||||
|     .head = QTAILQ_HEAD_INITIALIZER(qemu_mem_opts.head), | ||||
|     .merge_lists = true, | ||||
|     .desc = { | ||||
|         { | ||||
|             .name = "size", | ||||
|             .type = QEMU_OPT_SIZE, | ||||
|         }, | ||||
|         { /* end of list */ } | ||||
|     }, | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * Get machine options | ||||
|  * | ||||
| @@ -517,16 +531,7 @@ static QemuOptsList qemu_name_opts = { | ||||
|  */ | ||||
| QemuOpts *qemu_get_machine_opts(void) | ||||
| { | ||||
|     QemuOptsList *list; | ||||
|     QemuOpts *opts; | ||||
|  | ||||
|     list = qemu_find_opts("machine"); | ||||
|     assert(list); | ||||
|     opts = qemu_opts_find(list, NULL); | ||||
|     if (!opts) { | ||||
|         opts = qemu_opts_create(list, NULL, 0, &error_abort); | ||||
|     } | ||||
|     return opts; | ||||
|     return qemu_find_opts_singleton("machine"); | ||||
| } | ||||
|  | ||||
| const char *qemu_get_vm_name(void) | ||||
| @@ -2964,6 +2969,8 @@ int main(int argc, char **argv, char **envp) | ||||
|     }; | ||||
|     const char *trace_events = NULL; | ||||
|     const char *trace_file = NULL; | ||||
|     const ram_addr_t default_ram_size = (ram_addr_t)DEFAULT_RAM_SIZE * | ||||
|                                         1024 * 1024; | ||||
|  | ||||
|     atexit(qemu_run_exit_notifiers); | ||||
|     error_set_progname(argv[0]); | ||||
| @@ -2987,6 +2994,7 @@ int main(int argc, char **argv, char **envp) | ||||
|     qemu_add_opts(&qemu_trace_opts); | ||||
|     qemu_add_opts(&qemu_option_rom_opts); | ||||
|     qemu_add_opts(&qemu_machine_opts); | ||||
|     qemu_add_opts(&qemu_mem_opts); | ||||
|     qemu_add_opts(&qemu_smp_opts); | ||||
|     qemu_add_opts(&qemu_boot_opts); | ||||
|     qemu_add_opts(&qemu_sandbox_opts); | ||||
| @@ -3011,7 +3019,7 @@ int main(int argc, char **argv, char **envp) | ||||
|     module_call_init(MODULE_INIT_MACHINE); | ||||
|     machine_class = find_default_machine(); | ||||
|     cpu_model = NULL; | ||||
|     ram_size = 0; | ||||
|     ram_size = default_ram_size; | ||||
|     snapshot = 0; | ||||
|     cyls = heads = secs = 0; | ||||
|     translation = BIOS_ATA_TRANSLATION_AUTO; | ||||
| @@ -3034,7 +3042,6 @@ int main(int argc, char **argv, char **envp) | ||||
|         if (argv[optind][0] != '-') { | ||||
|             /* disk image */ | ||||
|             optind++; | ||||
|             continue; | ||||
|         } else { | ||||
|             const QEMUOption *popt; | ||||
|  | ||||
| @@ -3298,20 +3305,48 @@ int main(int argc, char **argv, char **envp) | ||||
|                 exit(0); | ||||
|                 break; | ||||
|             case QEMU_OPTION_m: { | ||||
|                 int64_t value; | ||||
|                 uint64_t sz; | ||||
|                 char *end; | ||||
|                 const char *mem_str; | ||||
|  | ||||
|                 value = strtosz(optarg, &end); | ||||
|                 if (value < 0 || *end) { | ||||
|                     fprintf(stderr, "qemu: invalid ram size: %s\n", optarg); | ||||
|                     exit(1); | ||||
|                 opts = qemu_opts_parse(qemu_find_opts("memory"), | ||||
|                                        optarg, 1); | ||||
|                 if (!opts) { | ||||
|                     exit(EXIT_FAILURE); | ||||
|                 } | ||||
|                 sz = QEMU_ALIGN_UP((uint64_t)value, 8192); | ||||
|  | ||||
|                 mem_str = qemu_opt_get(opts, "size"); | ||||
|                 if (!mem_str) { | ||||
|                     error_report("invalid -m option, missing 'size' option"); | ||||
|                     exit(EXIT_FAILURE); | ||||
|                 } | ||||
|                 if (!*mem_str) { | ||||
|                     error_report("missing 'size' option value"); | ||||
|                     exit(EXIT_FAILURE); | ||||
|                 } | ||||
|  | ||||
|                 sz = qemu_opt_get_size(opts, "size", ram_size); | ||||
|  | ||||
|                 /* Fix up legacy suffix-less format */ | ||||
|                 if (g_ascii_isdigit(mem_str[strlen(mem_str) - 1])) { | ||||
|                     uint64_t overflow_check = sz; | ||||
|  | ||||
|                     sz <<= 20; | ||||
|                     if ((sz >> 20) != overflow_check) { | ||||
|                         error_report("too large 'size' option value"); | ||||
|                         exit(EXIT_FAILURE); | ||||
|                     } | ||||
|                 } | ||||
|  | ||||
|                 /* backward compatibility behaviour for case "-m 0" */ | ||||
|                 if (sz == 0) { | ||||
|                     sz = default_ram_size; | ||||
|                 } | ||||
|  | ||||
|                 sz = QEMU_ALIGN_UP(sz, 8192); | ||||
|                 ram_size = sz; | ||||
|                 if (ram_size != sz) { | ||||
|                     fprintf(stderr, "qemu: ram size too large\n"); | ||||
|                     exit(1); | ||||
|                     error_report("ram size too large"); | ||||
|                     exit(EXIT_FAILURE); | ||||
|                 } | ||||
|                 break; | ||||
|             } | ||||
| @@ -3855,7 +3890,9 @@ int main(int argc, char **argv, char **envp) | ||||
|                         } | ||||
|                     } | ||||
|                     qemu_config_write(fp); | ||||
|                     fclose(fp); | ||||
|                     if (fp != stdout) { | ||||
|                         fclose(fp); | ||||
|                     } | ||||
|                     break; | ||||
|                 } | ||||
|             case QEMU_OPTION_qtest: | ||||
| @@ -4154,10 +4191,8 @@ int main(int argc, char **argv, char **envp) | ||||
|         exit(1); | ||||
|     } | ||||
|  | ||||
|     /* init the memory */ | ||||
|     if (ram_size == 0) { | ||||
|         ram_size = DEFAULT_RAM_SIZE * 1024 * 1024; | ||||
|     } | ||||
|     /* store value for the future use */ | ||||
|     qemu_opt_set_number(qemu_find_opts_singleton("memory"), "size", ram_size); | ||||
|  | ||||
|     if (qemu_opts_foreach(qemu_find_opts("device"), device_help_func, NULL, 0) | ||||
|         != 0) { | ||||
| @@ -4371,15 +4406,15 @@ int main(int argc, char **argv, char **envp) | ||||
|  | ||||
|     qdev_machine_init(); | ||||
|  | ||||
|     QEMUMachineInitArgs args = { .machine = machine, | ||||
|                                  .ram_size = ram_size, | ||||
|                                  .boot_order = boot_order, | ||||
|                                  .kernel_filename = kernel_filename, | ||||
|                                  .kernel_cmdline = kernel_cmdline, | ||||
|                                  .initrd_filename = initrd_filename, | ||||
|                                  .cpu_model = cpu_model }; | ||||
|     current_machine->init_args = (QEMUMachineInitArgs) { | ||||
|         .machine = machine, | ||||
|         .ram_size = ram_size, | ||||
|         .boot_order = boot_order, | ||||
|         .kernel_filename = kernel_filename, | ||||
|         .kernel_cmdline = kernel_cmdline, | ||||
|         .initrd_filename = initrd_filename, | ||||
|         .cpu_model = cpu_model }; | ||||
|  | ||||
|     current_machine->init_args = args; | ||||
|     machine->init(¤t_machine->init_args); | ||||
|  | ||||
|     audio_init(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user