Clean up around error_get_pretty(), qerror_report_err()
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJU5GT/AAoJEDhwtADrkYZT6H8QAJSdCnymglYhsJ0L8Pn+mFbw ukAxSBjZ+XJXwSBCjSLB9e2Tb6PJZAbAdQJjmI1Ijb+3cXqjRURErTsp+Caz1pjj Zw4v4whxNedXl+WeZEwX7sU6WlDhMEk51E1NHssd9dyZ/noEqHiw/XzoqimaYlPK nrSTBZ94N+F+Daw1d/cjbRMHHGVSjpVraDEPvZIkC6Mv43dGhSdCT529FXthMpUd OhoaQvEdy/75RqFwd4gbjHzA2qHVVsKdq8EfDdHAlcg2LSGB8zM4LlRmYxMKmy2g ylZLXtm6v7Pm+tYFVdLc7xWnRIh4vFXBHFJ8O9jFXziV4Nkj7s7qXdLJXxYWfRXU KC4/vw9IEkHWWUtn1A69ktyPFjEcnW0ieiEOA7/2FXiH7RARnWTl/YChlQrSgSAM zh+/01UhHvKBkxmkJIWpHzR+70A/GyubvlrcSd0g6L+g1hXEw78aryivCoFTKocl MNTlI7AcaGW2qpSUn5kr99aBdKD1sSdGPbNqqZMOzUekGQHeUuNNrFlvsTibMo5G OikdrgygmoLHBcMCgVykYoHen5lMcz+PS5aGFoGwvMV3DQZAsAwltXGeJSNck143 WuEatwA0PhuA0S/dZMELC27kUdsbvpBUhboHuShz4pvytihWu0HmVAWDeShd9uPB r/WSqvETUcdSOqExGEP2 =g7dZ -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2015-02-18' into staging Clean up around error_get_pretty(), qerror_report_err() # gpg: Signature made Wed Feb 18 10:10:07 2015 GMT using RSA key ID EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" * remotes/armbru/tags/pull-error-2015-02-18: qemu-char: Avoid qerror_report_err() outside QMP command handlers qemu-img: Avoid qerror_report_err() outside QMP command handlers vl: Avoid qerror_report_err() outside QMP command handlers tpm: Avoid qerror_report_err() outside QMP command handlers numa: Avoid qerror_report_err() outside QMP command handlers net: Avoid qerror_report_err() outside QMP command handlers monitor: Avoid qerror_report_err() outside QMP command handlers monitor: Clean up around monitor_handle_fd_param() error: Use error_report_err() where appropriate error: New convenience function error_report_err() vhost-scsi: Improve error reporting for invalid vhostfd Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
		
						commit
						c5c6d7f81a
					
				| 
						 | 
					@ -1124,8 +1124,7 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            ret = qemu_ram_resize(block->offset, length, &local_err);
 | 
					                            ret = qemu_ram_resize(block->offset, length, &local_err);
 | 
				
			||||||
                            if (local_err) {
 | 
					                            if (local_err) {
 | 
				
			||||||
                                error_report("%s", error_get_pretty(local_err));
 | 
					                                error_report_err(local_err);
 | 
				
			||||||
                                error_free(local_err);
 | 
					 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        break;
 | 
					                        break;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -726,8 +726,7 @@ static coroutine_fn void reconnect_to_sdog(void *opaque)
 | 
				
			||||||
        s->fd = get_sheep_fd(s, &local_err);
 | 
					        s->fd = get_sheep_fd(s, &local_err);
 | 
				
			||||||
        if (s->fd < 0) {
 | 
					        if (s->fd < 0) {
 | 
				
			||||||
            DPRINTF("Wait for connection to be established\n");
 | 
					            DPRINTF("Wait for connection to be established\n");
 | 
				
			||||||
            error_report("%s", error_get_pretty(local_err));
 | 
					            error_report_err(local_err);
 | 
				
			||||||
            error_free(local_err);
 | 
					 | 
				
			||||||
            co_aio_sleep_ns(bdrv_get_aio_context(s->bs), QEMU_CLOCK_REALTIME,
 | 
					            co_aio_sleep_ns(bdrv_get_aio_context(s->bs), QEMU_CLOCK_REALTIME,
 | 
				
			||||||
                            1000000000ULL);
 | 
					                            1000000000ULL);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -1283,8 +1282,7 @@ static int reload_inode(BDRVSheepdogState *s, uint32_t snapid, const char *tag)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    fd = connect_to_sdog(s, &local_err);
 | 
					    fd = connect_to_sdog(s, &local_err);
 | 
				
			||||||
    if (fd < 0) {
 | 
					    if (fd < 0) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(local_err));;
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
        return -EIO;
 | 
					        return -EIO;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1292,8 +1290,7 @@ static int reload_inode(BDRVSheepdogState *s, uint32_t snapid, const char *tag)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ret = find_vdi_name(s, s->name, snapid, tag, &vid, false, &local_err);
 | 
					    ret = find_vdi_name(s, s->name, snapid, tag, &vid, false, &local_err);
 | 
				
			||||||
    if (ret) {
 | 
					    if (ret) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(local_err));;
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
        goto out;
 | 
					        goto out;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1785,8 +1782,7 @@ static void sd_close(BlockDriverState *bs)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    fd = connect_to_sdog(s, &local_err);
 | 
					    fd = connect_to_sdog(s, &local_err);
 | 
				
			||||||
    if (fd < 0) {
 | 
					    if (fd < 0) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(local_err));;
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1838,8 +1834,7 @@ static int sd_truncate(BlockDriverState *bs, int64_t offset)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    fd = connect_to_sdog(s, &local_err);
 | 
					    fd = connect_to_sdog(s, &local_err);
 | 
				
			||||||
    if (fd < 0) {
 | 
					    if (fd < 0) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(local_err));;
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
        return fd;
 | 
					        return fd;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1912,8 +1907,7 @@ static bool sd_delete(BDRVSheepdogState *s)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    fd = connect_to_sdog(s, &local_err);
 | 
					    fd = connect_to_sdog(s, &local_err);
 | 
				
			||||||
    if (fd < 0) {
 | 
					    if (fd < 0) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(local_err));;
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
        return false;
 | 
					        return false;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1960,8 +1954,7 @@ static int sd_create_branch(BDRVSheepdogState *s)
 | 
				
			||||||
    deleted = sd_delete(s);
 | 
					    deleted = sd_delete(s);
 | 
				
			||||||
    ret = do_sd_create(s, &vid, !deleted, &local_err);
 | 
					    ret = do_sd_create(s, &vid, !deleted, &local_err);
 | 
				
			||||||
    if (ret) {
 | 
					    if (ret) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(local_err));;
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
        goto out;
 | 
					        goto out;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1969,8 +1962,7 @@ static int sd_create_branch(BDRVSheepdogState *s)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    fd = connect_to_sdog(s, &local_err);
 | 
					    fd = connect_to_sdog(s, &local_err);
 | 
				
			||||||
    if (fd < 0) {
 | 
					    if (fd < 0) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(local_err));;
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
        ret = fd;
 | 
					        ret = fd;
 | 
				
			||||||
        goto out;
 | 
					        goto out;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -2218,8 +2210,7 @@ static int sd_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
 | 
				
			||||||
    /* refresh inode. */
 | 
					    /* refresh inode. */
 | 
				
			||||||
    fd = connect_to_sdog(s, &local_err);
 | 
					    fd = connect_to_sdog(s, &local_err);
 | 
				
			||||||
    if (fd < 0) {
 | 
					    if (fd < 0) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(local_err));;
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
        ret = fd;
 | 
					        ret = fd;
 | 
				
			||||||
        goto cleanup;
 | 
					        goto cleanup;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -2234,8 +2225,7 @@ static int sd_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ret = do_sd_create(s, &new_vid, 1, &local_err);
 | 
					    ret = do_sd_create(s, &new_vid, 1, &local_err);
 | 
				
			||||||
    if (ret < 0) {
 | 
					    if (ret < 0) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(local_err));;
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
        error_report("failed to create inode for snapshot. %s",
 | 
					        error_report("failed to create inode for snapshot. %s",
 | 
				
			||||||
                     strerror(errno));
 | 
					                     strerror(errno));
 | 
				
			||||||
        goto cleanup;
 | 
					        goto cleanup;
 | 
				
			||||||
| 
						 | 
					@ -2336,8 +2326,7 @@ static int sd_snapshot_list(BlockDriverState *bs, QEMUSnapshotInfo **psn_tab)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    fd = connect_to_sdog(s, &local_err);
 | 
					    fd = connect_to_sdog(s, &local_err);
 | 
				
			||||||
    if (fd < 0) {
 | 
					    if (fd < 0) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(local_err));;
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
        ret = fd;
 | 
					        ret = fd;
 | 
				
			||||||
        goto out;
 | 
					        goto out;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -2366,8 +2355,7 @@ static int sd_snapshot_list(BlockDriverState *bs, QEMUSnapshotInfo **psn_tab)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    fd = connect_to_sdog(s, &local_err);
 | 
					    fd = connect_to_sdog(s, &local_err);
 | 
				
			||||||
    if (fd < 0) {
 | 
					    if (fd < 0) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(local_err));;
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
        ret = fd;
 | 
					        ret = fd;
 | 
				
			||||||
        goto out;
 | 
					        goto out;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -2429,8 +2417,7 @@ static int do_load_save_vmstate(BDRVSheepdogState *s, uint8_t *data,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    fd = connect_to_sdog(s, &local_err);
 | 
					    fd = connect_to_sdog(s, &local_err);
 | 
				
			||||||
    if (fd < 0) {
 | 
					    if (fd < 0) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(local_err));;
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
        return fd;
 | 
					        return fd;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										12
									
								
								blockdev.c
								
								
								
								
							
							
						
						
									
										12
									
								
								blockdev.c
								
								
								
								
							| 
						 | 
					@ -720,8 +720,7 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type)
 | 
				
			||||||
        qemu_opt_rename(all_opts, opt_renames[i].from, opt_renames[i].to,
 | 
					        qemu_opt_rename(all_opts, opt_renames[i].from, opt_renames[i].to,
 | 
				
			||||||
                        &local_err);
 | 
					                        &local_err);
 | 
				
			||||||
        if (local_err) {
 | 
					        if (local_err) {
 | 
				
			||||||
            error_report("%s", error_get_pretty(local_err));
 | 
					            error_report_err(local_err);
 | 
				
			||||||
            error_free(local_err);
 | 
					 | 
				
			||||||
            return NULL;
 | 
					            return NULL;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -759,8 +758,7 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type)
 | 
				
			||||||
                                   &error_abort);
 | 
					                                   &error_abort);
 | 
				
			||||||
    qemu_opts_absorb_qdict(legacy_opts, bs_opts, &local_err);
 | 
					    qemu_opts_absorb_qdict(legacy_opts, bs_opts, &local_err);
 | 
				
			||||||
    if (local_err) {
 | 
					    if (local_err) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(local_err));
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
        goto fail;
 | 
					        goto fail;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -975,8 +973,7 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type)
 | 
				
			||||||
    bs_opts = NULL;
 | 
					    bs_opts = NULL;
 | 
				
			||||||
    if (!blk) {
 | 
					    if (!blk) {
 | 
				
			||||||
        if (local_err) {
 | 
					        if (local_err) {
 | 
				
			||||||
            error_report("%s", error_get_pretty(local_err));
 | 
					            error_report_err(local_err);
 | 
				
			||||||
            error_free(local_err);
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        goto fail;
 | 
					        goto fail;
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
| 
						 | 
					@ -1970,8 +1967,7 @@ int hmp_drive_del(Monitor *mon, const QDict *qdict, QObject **ret_data)
 | 
				
			||||||
    aio_context_acquire(aio_context);
 | 
					    aio_context_acquire(aio_context);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_DRIVE_DEL, &local_err)) {
 | 
					    if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_DRIVE_DEL, &local_err)) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(local_err));
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
        aio_context_release(aio_context);
 | 
					        aio_context_release(aio_context);
 | 
				
			||||||
        return -1;
 | 
					        return -1;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -158,7 +158,7 @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem,
 | 
				
			||||||
        if (object_property_find(cpuobj, "has_el3", NULL)) {
 | 
					        if (object_property_find(cpuobj, "has_el3", NULL)) {
 | 
				
			||||||
            object_property_set_bool(cpuobj, false, "has_el3", &err);
 | 
					            object_property_set_bool(cpuobj, false, "has_el3", &err);
 | 
				
			||||||
            if (err) {
 | 
					            if (err) {
 | 
				
			||||||
                error_report("%s", error_get_pretty(err));
 | 
					                error_report_err(err);
 | 
				
			||||||
                exit(1);
 | 
					                exit(1);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -168,7 +168,7 @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem,
 | 
				
			||||||
                                "reset-cbar", &error_abort);
 | 
					                                "reset-cbar", &error_abort);
 | 
				
			||||||
        object_property_set_bool(cpuobj, true, "realized", &err);
 | 
					        object_property_set_bool(cpuobj, true, "realized", &err);
 | 
				
			||||||
        if (err) {
 | 
					        if (err) {
 | 
				
			||||||
            error_report("%s", error_get_pretty(err));
 | 
					            error_report_err(err);
 | 
				
			||||||
            exit(1);
 | 
					            exit(1);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -248,7 +248,7 @@ static void calxeda_init(MachineState *machine, enum cxmachines machine_id)
 | 
				
			||||||
        if (object_property_find(cpuobj, "has_el3", NULL)) {
 | 
					        if (object_property_find(cpuobj, "has_el3", NULL)) {
 | 
				
			||||||
            object_property_set_bool(cpuobj, false, "has_el3", &err);
 | 
					            object_property_set_bool(cpuobj, false, "has_el3", &err);
 | 
				
			||||||
            if (err) {
 | 
					            if (err) {
 | 
				
			||||||
                error_report("%s", error_get_pretty(err));
 | 
					                error_report_err(err);
 | 
				
			||||||
                exit(1);
 | 
					                exit(1);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -259,7 +259,7 @@ static void calxeda_init(MachineState *machine, enum cxmachines machine_id)
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        object_property_set_bool(cpuobj, true, "realized", &err);
 | 
					        object_property_set_bool(cpuobj, true, "realized", &err);
 | 
				
			||||||
        if (err) {
 | 
					        if (err) {
 | 
				
			||||||
            error_report("%s", error_get_pretty(err));
 | 
					            error_report_err(err);
 | 
				
			||||||
            exit(1);
 | 
					            exit(1);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        cpu_irq[n] = qdev_get_gpio_in(DEVICE(cpu), ARM_CPU_IRQ);
 | 
					        cpu_irq[n] = qdev_get_gpio_in(DEVICE(cpu), ARM_CPU_IRQ);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -500,14 +500,14 @@ static void integratorcp_init(MachineState *machine)
 | 
				
			||||||
    if (object_property_find(cpuobj, "has_el3", NULL)) {
 | 
					    if (object_property_find(cpuobj, "has_el3", NULL)) {
 | 
				
			||||||
        object_property_set_bool(cpuobj, false, "has_el3", &err);
 | 
					        object_property_set_bool(cpuobj, false, "has_el3", &err);
 | 
				
			||||||
        if (err) {
 | 
					        if (err) {
 | 
				
			||||||
            error_report("%s", error_get_pretty(err));
 | 
					            error_report_err(err);
 | 
				
			||||||
            exit(1);
 | 
					            exit(1);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    object_property_set_bool(cpuobj, true, "realized", &err);
 | 
					    object_property_set_bool(cpuobj, true, "realized", &err);
 | 
				
			||||||
    if (err) {
 | 
					    if (err) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(err));
 | 
					        error_report_err(err);
 | 
				
			||||||
        exit(1);
 | 
					        exit(1);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -108,7 +108,7 @@ static void realview_init(MachineState *machine,
 | 
				
			||||||
        if (object_property_find(cpuobj, "has_el3", NULL)) {
 | 
					        if (object_property_find(cpuobj, "has_el3", NULL)) {
 | 
				
			||||||
            object_property_set_bool(cpuobj, false, "has_el3", &err);
 | 
					            object_property_set_bool(cpuobj, false, "has_el3", &err);
 | 
				
			||||||
            if (err) {
 | 
					            if (err) {
 | 
				
			||||||
                error_report("%s", error_get_pretty(err));
 | 
					                error_report_err(err);
 | 
				
			||||||
                exit(1);
 | 
					                exit(1);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -116,14 +116,14 @@ static void realview_init(MachineState *machine,
 | 
				
			||||||
        if (is_pb && is_mpcore) {
 | 
					        if (is_pb && is_mpcore) {
 | 
				
			||||||
            object_property_set_int(cpuobj, periphbase, "reset-cbar", &err);
 | 
					            object_property_set_int(cpuobj, periphbase, "reset-cbar", &err);
 | 
				
			||||||
            if (err) {
 | 
					            if (err) {
 | 
				
			||||||
                error_report("%s", error_get_pretty(err));
 | 
					                error_report_err(err);
 | 
				
			||||||
                exit(1);
 | 
					                exit(1);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        object_property_set_bool(cpuobj, true, "realized", &err);
 | 
					        object_property_set_bool(cpuobj, true, "realized", &err);
 | 
				
			||||||
        if (err) {
 | 
					        if (err) {
 | 
				
			||||||
            error_report("%s", error_get_pretty(err));
 | 
					            error_report_err(err);
 | 
				
			||||||
            exit(1);
 | 
					            exit(1);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -213,14 +213,14 @@ static void versatile_init(MachineState *machine, int board_id)
 | 
				
			||||||
    if (object_property_find(cpuobj, "has_el3", NULL)) {
 | 
					    if (object_property_find(cpuobj, "has_el3", NULL)) {
 | 
				
			||||||
        object_property_set_bool(cpuobj, false, "has_el3", &err);
 | 
					        object_property_set_bool(cpuobj, false, "has_el3", &err);
 | 
				
			||||||
        if (err) {
 | 
					        if (err) {
 | 
				
			||||||
            error_report("%s", error_get_pretty(err));
 | 
					            error_report_err(err);
 | 
				
			||||||
            exit(1);
 | 
					            exit(1);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    object_property_set_bool(cpuobj, true, "realized", &err);
 | 
					    object_property_set_bool(cpuobj, true, "realized", &err);
 | 
				
			||||||
    if (err) {
 | 
					    if (err) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(err));
 | 
					        error_report_err(err);
 | 
				
			||||||
        exit(1);
 | 
					        exit(1);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -223,7 +223,7 @@ static void init_cpus(const char *cpu_model, const char *privdev,
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        object_property_set_bool(cpuobj, true, "realized", &err);
 | 
					        object_property_set_bool(cpuobj, true, "realized", &err);
 | 
				
			||||||
        if (err) {
 | 
					        if (err) {
 | 
				
			||||||
            error_report("%s", error_get_pretty(err));
 | 
					            error_report_err(err);
 | 
				
			||||||
            exit(1);
 | 
					            exit(1);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -133,25 +133,25 @@ static void zynq_init(MachineState *machine)
 | 
				
			||||||
    if (object_property_find(OBJECT(cpu), "has_el3", NULL)) {
 | 
					    if (object_property_find(OBJECT(cpu), "has_el3", NULL)) {
 | 
				
			||||||
        object_property_set_bool(OBJECT(cpu), false, "has_el3", &err);
 | 
					        object_property_set_bool(OBJECT(cpu), false, "has_el3", &err);
 | 
				
			||||||
        if (err) {
 | 
					        if (err) {
 | 
				
			||||||
            error_report("%s", error_get_pretty(err));
 | 
					            error_report_err(err);
 | 
				
			||||||
            exit(1);
 | 
					            exit(1);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    object_property_set_int(OBJECT(cpu), ZYNQ_BOARD_MIDR, "midr", &err);
 | 
					    object_property_set_int(OBJECT(cpu), ZYNQ_BOARD_MIDR, "midr", &err);
 | 
				
			||||||
    if (err) {
 | 
					    if (err) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(err));
 | 
					        error_report_err(err);
 | 
				
			||||||
        exit(1);
 | 
					        exit(1);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    object_property_set_int(OBJECT(cpu), MPCORE_PERIPHBASE, "reset-cbar", &err);
 | 
					    object_property_set_int(OBJECT(cpu), MPCORE_PERIPHBASE, "reset-cbar", &err);
 | 
				
			||||||
    if (err) {
 | 
					    if (err) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(err));
 | 
					        error_report_err(err);
 | 
				
			||||||
        exit(1);
 | 
					        exit(1);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    object_property_set_bool(OBJECT(cpu), true, "realized", &err);
 | 
					    object_property_set_bool(OBJECT(cpu), true, "realized", &err);
 | 
				
			||||||
    if (err) {
 | 
					    if (err) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(err));
 | 
					        error_report_err(err);
 | 
				
			||||||
        exit(1);
 | 
					        exit(1);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -858,8 +858,7 @@ static void virtio_blk_migration_state_changed(Notifier *notifier, void *data)
 | 
				
			||||||
        virtio_blk_data_plane_create(VIRTIO_DEVICE(s), &s->conf,
 | 
					        virtio_blk_data_plane_create(VIRTIO_DEVICE(s), &s->conf,
 | 
				
			||||||
                                     &s->dataplane, &err);
 | 
					                                     &s->dataplane, &err);
 | 
				
			||||||
        if (err != NULL) {
 | 
					        if (err != NULL) {
 | 
				
			||||||
            error_report("%s", error_get_pretty(err));
 | 
					            error_report_err(err);
 | 
				
			||||||
            error_free(err);
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -906,8 +906,7 @@ SerialState *serial_init(int base, qemu_irq irq, int baudbase,
 | 
				
			||||||
    s->chr = chr;
 | 
					    s->chr = chr;
 | 
				
			||||||
    serial_realize_core(s, &err);
 | 
					    serial_realize_core(s, &err);
 | 
				
			||||||
    if (err != NULL) {
 | 
					    if (err != NULL) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(err));
 | 
					        error_report_err(err);
 | 
				
			||||||
        error_free(err);
 | 
					 | 
				
			||||||
        exit(1);
 | 
					        exit(1);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -970,8 +969,7 @@ SerialState *serial_mm_init(MemoryRegion *address_space,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    serial_realize_core(s, &err);
 | 
					    serial_realize_core(s, &err);
 | 
				
			||||||
    if (err != NULL) {
 | 
					    if (err != NULL) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(err));
 | 
					        error_report_err(err);
 | 
				
			||||||
        error_free(err);
 | 
					 | 
				
			||||||
        exit(1);
 | 
					        exit(1);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    vmstate_register(NULL, base, &vmstate_serial, s);
 | 
					    vmstate_register(NULL, base, &vmstate_serial, s);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -552,9 +552,8 @@ static void get_real_device(AssignedDevice *pci_dev, Error **errp)
 | 
				
			||||||
    snprintf(name, sizeof(name), "%sconfig", dir);
 | 
					    snprintf(name, sizeof(name), "%sconfig", dir);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (pci_dev->configfd_name && *pci_dev->configfd_name) {
 | 
					    if (pci_dev->configfd_name && *pci_dev->configfd_name) {
 | 
				
			||||||
        dev->config_fd = monitor_handle_fd_param2(cur_mon,
 | 
					        dev->config_fd = monitor_fd_param(cur_mon, pci_dev->configfd_name,
 | 
				
			||||||
                                                  pci_dev->configfd_name,
 | 
					                                          &local_err);
 | 
				
			||||||
                                                  &local_err);
 | 
					 | 
				
			||||||
        if (local_err) {
 | 
					        if (local_err) {
 | 
				
			||||||
            error_propagate(errp, local_err);
 | 
					            error_propagate(errp, local_err);
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
| 
						 | 
					@ -953,8 +952,7 @@ static void assigned_dev_update_irq_routing(PCIDevice *dev)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    r = assign_intx(assigned_dev, &err);
 | 
					    r = assign_intx(assigned_dev, &err);
 | 
				
			||||||
    if (r < 0) {
 | 
					    if (r < 0) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(err));
 | 
					        error_report_err(err);
 | 
				
			||||||
        error_free(err);
 | 
					 | 
				
			||||||
        err = NULL;
 | 
					        err = NULL;
 | 
				
			||||||
        qdev_unplug(&dev->qdev, &err);
 | 
					        qdev_unplug(&dev->qdev, &err);
 | 
				
			||||||
        assert(!err);
 | 
					        assert(!err);
 | 
				
			||||||
| 
						 | 
					@ -1010,8 +1008,7 @@ static void assigned_dev_update_msi(PCIDevice *pci_dev)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        assign_intx(assigned_dev, &local_err);
 | 
					        assign_intx(assigned_dev, &local_err);
 | 
				
			||||||
        if (local_err) {
 | 
					        if (local_err) {
 | 
				
			||||||
            error_report("%s", error_get_pretty(local_err));
 | 
					            error_report_err(local_err);
 | 
				
			||||||
            error_free(local_err);
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -1158,8 +1155,7 @@ static void assigned_dev_update_msix(PCIDevice *pci_dev)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        assign_intx(assigned_dev, &local_err);
 | 
					        assign_intx(assigned_dev, &local_err);
 | 
				
			||||||
        if (local_err) {
 | 
					        if (local_err) {
 | 
				
			||||||
            error_report("%s", error_get_pretty(local_err));
 | 
					            error_report_err(local_err);
 | 
				
			||||||
            error_free(local_err);
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -414,7 +414,7 @@ void pc_cmos_init(ram_addr_t ram_size, ram_addr_t above_4g_mem_size,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    set_boot_dev(s, boot_device, &local_err);
 | 
					    set_boot_dev(s, boot_device, &local_err);
 | 
				
			||||||
    if (local_err) {
 | 
					    if (local_err) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(local_err));
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        exit(1);
 | 
					        exit(1);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1040,8 +1040,7 @@ void pc_cpus_init(const char *cpu_model, DeviceState *icc_bridge)
 | 
				
			||||||
        cpu = pc_new_cpu(cpu_model, x86_cpu_apic_id_from_index(i),
 | 
					        cpu = pc_new_cpu(cpu_model, x86_cpu_apic_id_from_index(i),
 | 
				
			||||||
                         icc_bridge, &error);
 | 
					                         icc_bridge, &error);
 | 
				
			||||||
        if (error) {
 | 
					        if (error) {
 | 
				
			||||||
            error_report("%s", error_get_pretty(error));
 | 
					            error_report_err(error);
 | 
				
			||||||
            error_free(error);
 | 
					 | 
				
			||||||
            exit(1);
 | 
					            exit(1);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -908,7 +908,7 @@ void smbios_entry_add(QemuOpts *opts)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        qemu_opts_validate(opts, qemu_smbios_file_opts, &local_err);
 | 
					        qemu_opts_validate(opts, qemu_smbios_file_opts, &local_err);
 | 
				
			||||||
        if (local_err) {
 | 
					        if (local_err) {
 | 
				
			||||||
            error_report("%s", error_get_pretty(local_err));
 | 
					            error_report_err(local_err);
 | 
				
			||||||
            exit(1);
 | 
					            exit(1);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -994,7 +994,7 @@ void smbios_entry_add(QemuOpts *opts)
 | 
				
			||||||
        case 0:
 | 
					        case 0:
 | 
				
			||||||
            qemu_opts_validate(opts, qemu_smbios_type0_opts, &local_err);
 | 
					            qemu_opts_validate(opts, qemu_smbios_type0_opts, &local_err);
 | 
				
			||||||
            if (local_err) {
 | 
					            if (local_err) {
 | 
				
			||||||
                error_report("%s", error_get_pretty(local_err));
 | 
					                error_report_err(local_err);
 | 
				
			||||||
                exit(1);
 | 
					                exit(1);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            save_opt(&type0.vendor, opts, "vendor");
 | 
					            save_opt(&type0.vendor, opts, "vendor");
 | 
				
			||||||
| 
						 | 
					@ -1014,7 +1014,7 @@ void smbios_entry_add(QemuOpts *opts)
 | 
				
			||||||
        case 1:
 | 
					        case 1:
 | 
				
			||||||
            qemu_opts_validate(opts, qemu_smbios_type1_opts, &local_err);
 | 
					            qemu_opts_validate(opts, qemu_smbios_type1_opts, &local_err);
 | 
				
			||||||
            if (local_err) {
 | 
					            if (local_err) {
 | 
				
			||||||
                error_report("%s", error_get_pretty(local_err));
 | 
					                error_report_err(local_err);
 | 
				
			||||||
                exit(1);
 | 
					                exit(1);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            save_opt(&type1.manufacturer, opts, "manufacturer");
 | 
					            save_opt(&type1.manufacturer, opts, "manufacturer");
 | 
				
			||||||
| 
						 | 
					@ -1036,7 +1036,7 @@ void smbios_entry_add(QemuOpts *opts)
 | 
				
			||||||
        case 2:
 | 
					        case 2:
 | 
				
			||||||
            qemu_opts_validate(opts, qemu_smbios_type2_opts, &local_err);
 | 
					            qemu_opts_validate(opts, qemu_smbios_type2_opts, &local_err);
 | 
				
			||||||
            if (local_err) {
 | 
					            if (local_err) {
 | 
				
			||||||
                error_report("%s", error_get_pretty(local_err));
 | 
					                error_report_err(local_err);
 | 
				
			||||||
                exit(1);
 | 
					                exit(1);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            save_opt(&type2.manufacturer, opts, "manufacturer");
 | 
					            save_opt(&type2.manufacturer, opts, "manufacturer");
 | 
				
			||||||
| 
						 | 
					@ -1049,7 +1049,7 @@ void smbios_entry_add(QemuOpts *opts)
 | 
				
			||||||
        case 3:
 | 
					        case 3:
 | 
				
			||||||
            qemu_opts_validate(opts, qemu_smbios_type3_opts, &local_err);
 | 
					            qemu_opts_validate(opts, qemu_smbios_type3_opts, &local_err);
 | 
				
			||||||
            if (local_err) {
 | 
					            if (local_err) {
 | 
				
			||||||
                error_report("%s", error_get_pretty(local_err));
 | 
					                error_report_err(local_err);
 | 
				
			||||||
                exit(1);
 | 
					                exit(1);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            save_opt(&type3.manufacturer, opts, "manufacturer");
 | 
					            save_opt(&type3.manufacturer, opts, "manufacturer");
 | 
				
			||||||
| 
						 | 
					@ -1061,7 +1061,7 @@ void smbios_entry_add(QemuOpts *opts)
 | 
				
			||||||
        case 4:
 | 
					        case 4:
 | 
				
			||||||
            qemu_opts_validate(opts, qemu_smbios_type4_opts, &local_err);
 | 
					            qemu_opts_validate(opts, qemu_smbios_type4_opts, &local_err);
 | 
				
			||||||
            if (local_err) {
 | 
					            if (local_err) {
 | 
				
			||||||
                error_report("%s", error_get_pretty(local_err));
 | 
					                error_report_err(local_err);
 | 
				
			||||||
                exit(1);
 | 
					                exit(1);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            save_opt(&type4.sock_pfx, opts, "sock_pfx");
 | 
					            save_opt(&type4.sock_pfx, opts, "sock_pfx");
 | 
				
			||||||
| 
						 | 
					@ -1074,7 +1074,7 @@ void smbios_entry_add(QemuOpts *opts)
 | 
				
			||||||
        case 17:
 | 
					        case 17:
 | 
				
			||||||
            qemu_opts_validate(opts, qemu_smbios_type17_opts, &local_err);
 | 
					            qemu_opts_validate(opts, qemu_smbios_type17_opts, &local_err);
 | 
				
			||||||
            if (local_err) {
 | 
					            if (local_err) {
 | 
				
			||||||
                error_report("%s", error_get_pretty(local_err));
 | 
					                error_report_err(local_err);
 | 
				
			||||||
                exit(1);
 | 
					                exit(1);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            save_opt(&type17.loc_pfx, opts, "loc_pfx");
 | 
					            save_opt(&type17.loc_pfx, opts, "loc_pfx");
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -172,8 +172,7 @@ static int ide_dev_initfn(IDEDevice *dev, IDEDriveKind kind)
 | 
				
			||||||
    if (kind != IDE_CD) {
 | 
					    if (kind != IDE_CD) {
 | 
				
			||||||
        blkconf_geometry(&dev->conf, &dev->chs_trans, 65536, 16, 255, &err);
 | 
					        blkconf_geometry(&dev->conf, &dev->chs_trans, 65536, 16, 255, &err);
 | 
				
			||||||
        if (err) {
 | 
					        if (err) {
 | 
				
			||||||
            error_report("%s", error_get_pretty(err));
 | 
					            error_report_err(err);
 | 
				
			||||||
            error_free(err);
 | 
					 | 
				
			||||||
            return -1;
 | 
					            return -1;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -132,8 +132,7 @@ static int scsi_hot_add(Monitor *mon, DeviceState *adapter,
 | 
				
			||||||
                                        dinfo->unit, false, -1, NULL,
 | 
					                                        dinfo->unit, false, -1, NULL,
 | 
				
			||||||
                                        &local_err);
 | 
					                                        &local_err);
 | 
				
			||||||
    if (!scsidev) {
 | 
					    if (!scsidev) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(local_err));
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
        return -1;
 | 
					        return -1;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    dinfo->unit = scsidev->id;
 | 
					    dinfo->unit = scsidev->id;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2038,8 +2038,7 @@ int pci_add_capability(PCIDevice *pdev, uint8_t cap_id,
 | 
				
			||||||
    ret = pci_add_capability2(pdev, cap_id, offset, size, &local_err);
 | 
					    ret = pci_add_capability2(pdev, cap_id, offset, size, &local_err);
 | 
				
			||||||
    if (local_err) {
 | 
					    if (local_err) {
 | 
				
			||||||
        assert(ret < 0);
 | 
					        assert(ret < 0);
 | 
				
			||||||
        error_report("%s", error_get_pretty(local_err));
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
        /* success implies a positive offset in config space */
 | 
					        /* success implies a positive offset in config space */
 | 
				
			||||||
        assert(ret > 0);
 | 
					        assert(ret > 0);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -215,9 +215,11 @@ static void vhost_scsi_realize(DeviceState *dev, Error **errp)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (vs->conf.vhostfd) {
 | 
					    if (vs->conf.vhostfd) {
 | 
				
			||||||
        vhostfd = monitor_handle_fd_param(cur_mon, vs->conf.vhostfd);
 | 
					        vhostfd = monitor_fd_param(cur_mon, vs->conf.vhostfd, &err);
 | 
				
			||||||
        if (vhostfd == -1) {
 | 
					        if (vhostfd == -1) {
 | 
				
			||||||
            error_setg(errp, "vhost-scsi: unable to parse vhostfd");
 | 
					            error_setg(errp, "vhost-scsi: unable to parse vhostfd: %s",
 | 
				
			||||||
 | 
					                       error_get_pretty(err));
 | 
				
			||||||
 | 
					            error_free(err);
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1399,8 +1399,7 @@ static USBDevice *usb_net_init(USBBus *bus, const char *cmdline)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    idx = net_client_init(opts, 0, &local_err);
 | 
					    idx = net_client_init(opts, 0, &local_err);
 | 
				
			||||||
    if (local_err) {
 | 
					    if (local_err) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(local_err));
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
        return NULL;
 | 
					        return NULL;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -878,8 +878,7 @@ static int usb_host_open(USBHostDevice *s, libusb_device *dev)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    usb_device_attach(udev, &local_err);
 | 
					    usb_device_attach(udev, &local_err);
 | 
				
			||||||
    if (local_err) {
 | 
					    if (local_err) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(local_err));
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
        goto fail;
 | 
					        goto fail;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1273,8 +1273,7 @@ static void usbredir_do_attach(void *opaque)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    usb_device_attach(&dev->dev, &local_err);
 | 
					    usb_device_attach(&dev->dev, &local_err);
 | 
				
			||||||
    if (local_err) {
 | 
					    if (local_err) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(local_err));
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
        WARNING("rejecting device due to speed mismatch\n");
 | 
					        WARNING("rejecting device due to speed mismatch\n");
 | 
				
			||||||
        usbredir_reject_device(dev);
 | 
					        usbredir_reject_device(dev);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -34,8 +34,7 @@ int monitor_read_block_device_key(Monitor *mon, const char *device,
 | 
				
			||||||
                                  void *opaque);
 | 
					                                  void *opaque);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int monitor_get_fd(Monitor *mon, const char *fdname, Error **errp);
 | 
					int monitor_get_fd(Monitor *mon, const char *fdname, Error **errp);
 | 
				
			||||||
int monitor_handle_fd_param(Monitor *mon, const char *fdname);
 | 
					int monitor_fd_param(Monitor *mon, const char *fdname, Error **errp);
 | 
				
			||||||
int monitor_handle_fd_param2(Monitor *mon, const char *fdname, Error **errp);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap)
 | 
					void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap)
 | 
				
			||||||
    GCC_FMT_ATTR(2, 0);
 | 
					    GCC_FMT_ATTR(2, 0);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -82,6 +82,11 @@ Error *error_copy(const Error *err);
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
const char *error_get_pretty(Error *err);
 | 
					const char *error_get_pretty(Error *err);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Convenience function to error_report() and free an error object.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					void error_report_err(Error *);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * Propagate an error to an indirect pointer to an error.  This function will
 | 
					 * Propagate an error to an indirect pointer to an error.  This function will
 | 
				
			||||||
 * always transfer ownership of the error reference and handles the case where
 | 
					 * always transfer ownership of the error reference and handles the case where
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										18
									
								
								monitor.c
								
								
								
								
							
							
						
						
									
										18
									
								
								monitor.c
								
								
								
								
							| 
						 | 
					@ -889,8 +889,7 @@ static void hmp_trace_event(Monitor *mon, const QDict *qdict)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    qmp_trace_event_set_state(tp_name, new_state, true, true, &local_err);
 | 
					    qmp_trace_event_set_state(tp_name, new_state, true, true, &local_err);
 | 
				
			||||||
    if (local_err) {
 | 
					    if (local_err) {
 | 
				
			||||||
        qerror_report_err(local_err);
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2570,20 +2569,7 @@ void monitor_fdset_dup_fd_remove(int dup_fd)
 | 
				
			||||||
    monitor_fdset_dup_fd_find_remove(dup_fd, true);
 | 
					    monitor_fdset_dup_fd_find_remove(dup_fd, true);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int monitor_handle_fd_param(Monitor *mon, const char *fdname)
 | 
					int monitor_fd_param(Monitor *mon, const char *fdname, Error **errp)
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    int fd;
 | 
					 | 
				
			||||||
    Error *local_err = NULL;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    fd = monitor_handle_fd_param2(mon, fdname, &local_err);
 | 
					 | 
				
			||||||
    if (local_err) {
 | 
					 | 
				
			||||||
        qerror_report_err(local_err);
 | 
					 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    return fd;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
int monitor_handle_fd_param2(Monitor *mon, const char *fdname, Error **errp)
 | 
					 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    int fd;
 | 
					    int fd;
 | 
				
			||||||
    Error *local_err = NULL;
 | 
					    Error *local_err = NULL;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -974,8 +974,7 @@ void hmp_host_net_add(Monitor *mon, const QDict *qdict)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    net_client_init(opts, 0, &local_err);
 | 
					    net_client_init(opts, 0, &local_err);
 | 
				
			||||||
    if (local_err) {
 | 
					    if (local_err) {
 | 
				
			||||||
        qerror_report_err(local_err);
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
        monitor_printf(mon, "adding host network device %s failed\n", device);
 | 
					        monitor_printf(mon, "adding host network device %s failed\n", device);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -1270,8 +1269,7 @@ static int net_init_client(QemuOpts *opts, void *dummy)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    net_client_init(opts, 0, &local_err);
 | 
					    net_client_init(opts, 0, &local_err);
 | 
				
			||||||
    if (local_err) {
 | 
					    if (local_err) {
 | 
				
			||||||
        qerror_report_err(local_err);
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
        return -1;
 | 
					        return -1;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1285,8 +1283,7 @@ static int net_init_netdev(QemuOpts *opts, void *dummy)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ret = net_client_init(opts, 1, &local_err);
 | 
					    ret = net_client_init(opts, 1, &local_err);
 | 
				
			||||||
    if (local_err) {
 | 
					    if (local_err) {
 | 
				
			||||||
        qerror_report_err(local_err);
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
        return -1;
 | 
					        return -1;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -695,6 +695,7 @@ static int net_socket_udp_init(NetClientState *peer,
 | 
				
			||||||
int net_init_socket(const NetClientOptions *opts, const char *name,
 | 
					int net_init_socket(const NetClientOptions *opts, const char *name,
 | 
				
			||||||
                    NetClientState *peer)
 | 
					                    NetClientState *peer)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    Error *err = NULL;
 | 
				
			||||||
    const NetdevSocketOptions *sock;
 | 
					    const NetdevSocketOptions *sock;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    assert(opts->kind == NET_CLIENT_OPTIONS_KIND_SOCKET);
 | 
					    assert(opts->kind == NET_CLIENT_OPTIONS_KIND_SOCKET);
 | 
				
			||||||
| 
						 | 
					@ -715,8 +716,9 @@ int net_init_socket(const NetClientOptions *opts, const char *name,
 | 
				
			||||||
    if (sock->has_fd) {
 | 
					    if (sock->has_fd) {
 | 
				
			||||||
        int fd;
 | 
					        int fd;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        fd = monitor_handle_fd_param(cur_mon, sock->fd);
 | 
					        fd = monitor_fd_param(cur_mon, sock->fd, &err);
 | 
				
			||||||
        if (fd == -1) {
 | 
					        if (fd == -1) {
 | 
				
			||||||
 | 
					            error_report_err(err);
 | 
				
			||||||
            return -1;
 | 
					            return -1;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        qemu_set_nonblock(fd);
 | 
					        qemu_set_nonblock(fd);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										11
									
								
								net/tap.c
								
								
								
								
							
							
						
						
									
										11
									
								
								net/tap.c
								
								
								
								
							| 
						 | 
					@ -605,6 +605,7 @@ static int net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer,
 | 
				
			||||||
                            const char *downscript, const char *vhostfdname,
 | 
					                            const char *downscript, const char *vhostfdname,
 | 
				
			||||||
                            int vnet_hdr, int fd)
 | 
					                            int vnet_hdr, int fd)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    Error *err = NULL;
 | 
				
			||||||
    TAPState *s;
 | 
					    TAPState *s;
 | 
				
			||||||
    int vhostfd;
 | 
					    int vhostfd;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -643,8 +644,9 @@ static int net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer,
 | 
				
			||||||
        options.force = tap->has_vhostforce && tap->vhostforce;
 | 
					        options.force = tap->has_vhostforce && tap->vhostforce;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (tap->has_vhostfd || tap->has_vhostfds) {
 | 
					        if (tap->has_vhostfd || tap->has_vhostfds) {
 | 
				
			||||||
            vhostfd = monitor_handle_fd_param(cur_mon, vhostfdname);
 | 
					            vhostfd = monitor_fd_param(cur_mon, vhostfdname, &err);
 | 
				
			||||||
            if (vhostfd == -1) {
 | 
					            if (vhostfd == -1) {
 | 
				
			||||||
 | 
					                error_report_err(err);
 | 
				
			||||||
                return -1;
 | 
					                return -1;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
| 
						 | 
					@ -704,6 +706,7 @@ int net_init_tap(const NetClientOptions *opts, const char *name,
 | 
				
			||||||
    /* for the no-fd, no-helper case */
 | 
					    /* for the no-fd, no-helper case */
 | 
				
			||||||
    const char *script = NULL; /* suppress wrong "uninit'd use" gcc warning */
 | 
					    const char *script = NULL; /* suppress wrong "uninit'd use" gcc warning */
 | 
				
			||||||
    const char *downscript = NULL;
 | 
					    const char *downscript = NULL;
 | 
				
			||||||
 | 
					    Error *err = NULL;
 | 
				
			||||||
    const char *vhostfdname;
 | 
					    const char *vhostfdname;
 | 
				
			||||||
    char ifname[128];
 | 
					    char ifname[128];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -729,8 +732,9 @@ int net_init_tap(const NetClientOptions *opts, const char *name,
 | 
				
			||||||
            return -1;
 | 
					            return -1;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        fd = monitor_handle_fd_param(cur_mon, tap->fd);
 | 
					        fd = monitor_fd_param(cur_mon, tap->fd, &err);
 | 
				
			||||||
        if (fd == -1) {
 | 
					        if (fd == -1) {
 | 
				
			||||||
 | 
					            error_report_err(err);
 | 
				
			||||||
            return -1;
 | 
					            return -1;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -768,8 +772,9 @@ int net_init_tap(const NetClientOptions *opts, const char *name,
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for (i = 0; i < nfds; i++) {
 | 
					        for (i = 0; i < nfds; i++) {
 | 
				
			||||||
            fd = monitor_handle_fd_param(cur_mon, fds[i]);
 | 
					            fd = monitor_fd_param(cur_mon, fds[i], &err);
 | 
				
			||||||
            if (fd == -1) {
 | 
					            if (fd == -1) {
 | 
				
			||||||
 | 
					                error_report_err(err);
 | 
				
			||||||
                return -1;
 | 
					                return -1;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										8
									
								
								numa.c
								
								
								
								
							
							
						
						
									
										8
									
								
								numa.c
								
								
								
								
							| 
						 | 
					@ -146,8 +146,7 @@ int numa_init_func(QemuOpts *opts, void *opaque)
 | 
				
			||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
error:
 | 
					error:
 | 
				
			||||||
    qerror_report_err(err);
 | 
					    error_report_err(err);
 | 
				
			||||||
    error_free(err);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (object) {
 | 
					    if (object) {
 | 
				
			||||||
        QapiDeallocVisitor *dv = qapi_dealloc_visitor_new();
 | 
					        QapiDeallocVisitor *dv = qapi_dealloc_visitor_new();
 | 
				
			||||||
| 
						 | 
					@ -262,8 +261,7 @@ static void allocate_system_memory_nonnuma(MemoryRegion *mr, Object *owner,
 | 
				
			||||||
         * regular RAM allocation.
 | 
					         * regular RAM allocation.
 | 
				
			||||||
         */
 | 
					         */
 | 
				
			||||||
        if (err) {
 | 
					        if (err) {
 | 
				
			||||||
            qerror_report_err(err);
 | 
					            error_report_err(err);
 | 
				
			||||||
            error_free(err);
 | 
					 | 
				
			||||||
            memory_region_init_ram(mr, owner, name, ram_size, &error_abort);
 | 
					            memory_region_init_ram(mr, owner, name, ram_size, &error_abort);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
| 
						 | 
					@ -298,7 +296,7 @@ void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner,
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        MemoryRegion *seg = host_memory_backend_get_memory(backend, &local_err);
 | 
					        MemoryRegion *seg = host_memory_backend_get_memory(backend, &local_err);
 | 
				
			||||||
        if (local_err) {
 | 
					        if (local_err) {
 | 
				
			||||||
            qerror_report_err(local_err);
 | 
					            error_report_err(local_err);
 | 
				
			||||||
            exit(1);
 | 
					            exit(1);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3306,8 +3306,7 @@ QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    opts = qemu_opts_create(qemu_find_opts("chardev"), label, 1, &local_err);
 | 
					    opts = qemu_opts_create(qemu_find_opts("chardev"), label, 1, &local_err);
 | 
				
			||||||
    if (local_err) {
 | 
					    if (local_err) {
 | 
				
			||||||
        qerror_report_err(local_err);
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
        return NULL;
 | 
					        return NULL;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3753,8 +3752,7 @@ CharDriverState *qemu_chr_new(const char *label, const char *filename, void (*in
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    chr = qemu_chr_new_from_opts(opts, init, &err);
 | 
					    chr = qemu_chr_new_from_opts(opts, init, &err);
 | 
				
			||||||
    if (err) {
 | 
					    if (err) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(err));
 | 
					        error_report_err(err);
 | 
				
			||||||
        error_free(err);
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (chr && qemu_opt_get_bool(opts, "mux", 0)) {
 | 
					    if (chr && qemu_opt_get_bool(opts, "mux", 0)) {
 | 
				
			||||||
        qemu_chr_fe_claim_no_fail(chr);
 | 
					        qemu_chr_fe_claim_no_fail(chr);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -883,8 +883,7 @@ done:
 | 
				
			||||||
    blk_unref(blk);
 | 
					    blk_unref(blk);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (local_err) {
 | 
					    if (local_err) {
 | 
				
			||||||
        qerror_report_err(local_err);
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
        return 1;
 | 
					        return 1;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2001,8 +2000,7 @@ static ImageInfoList *collect_image_info_list(const char *filename,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        bdrv_query_image_info(bs, &info, &err);
 | 
					        bdrv_query_image_info(bs, &info, &err);
 | 
				
			||||||
        if (err) {
 | 
					        if (err) {
 | 
				
			||||||
            error_report("%s", error_get_pretty(err));
 | 
					            error_report_err(err);
 | 
				
			||||||
            error_free(err);
 | 
					 | 
				
			||||||
            blk_unref(blk);
 | 
					            blk_unref(blk);
 | 
				
			||||||
            goto err;
 | 
					            goto err;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -3043,8 +3041,7 @@ int main(int argc, char **argv)
 | 
				
			||||||
    qemu_init_exec_dir(argv[0]);
 | 
					    qemu_init_exec_dir(argv[0]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (qemu_init_main_loop(&local_error)) {
 | 
					    if (qemu_init_main_loop(&local_error)) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(local_error));
 | 
					        error_report_err(local_error);
 | 
				
			||||||
        error_free(local_error);
 | 
					 | 
				
			||||||
        exit(EXIT_FAILURE);
 | 
					        exit(EXIT_FAILURE);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -440,8 +440,7 @@ int main(int argc, char **argv)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (qemu_init_main_loop(&local_error)) {
 | 
					    if (qemu_init_main_loop(&local_error)) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(local_error));
 | 
					        error_report_err(local_error);
 | 
				
			||||||
        error_free(local_error);
 | 
					 | 
				
			||||||
        exit(1);
 | 
					        exit(1);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										12
									
								
								qemu-nbd.c
								
								
								
								
							
							
						
						
									
										12
									
								
								qemu-nbd.c
								
								
								
								
							| 
						 | 
					@ -228,8 +228,7 @@ static int tcp_socket_incoming(const char *address, uint16_t port)
 | 
				
			||||||
    int fd = inet_listen(address_and_port, NULL, 0, SOCK_STREAM, 0, &local_err);
 | 
					    int fd = inet_listen(address_and_port, NULL, 0, SOCK_STREAM, 0, &local_err);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (local_err != NULL) {
 | 
					    if (local_err != NULL) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(local_err));
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    return fd;
 | 
					    return fd;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -240,8 +239,7 @@ static int unix_socket_incoming(const char *path)
 | 
				
			||||||
    int fd = unix_listen(path, NULL, 0, &local_err);
 | 
					    int fd = unix_listen(path, NULL, 0, &local_err);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (local_err != NULL) {
 | 
					    if (local_err != NULL) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(local_err));
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    return fd;
 | 
					    return fd;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -252,8 +250,7 @@ static int unix_socket_outgoing(const char *path)
 | 
				
			||||||
    int fd = unix_connect(path, &local_err);
 | 
					    int fd = unix_connect(path, &local_err);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (local_err != NULL) {
 | 
					    if (local_err != NULL) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(local_err));
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    return fd;
 | 
					    return fd;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -681,8 +678,7 @@ int main(int argc, char **argv)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (qemu_init_main_loop(&local_err)) {
 | 
					    if (qemu_init_main_loop(&local_err)) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(local_err));
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
        exit(EXIT_FAILURE);
 | 
					        exit(EXIT_FAILURE);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    bdrv_init();
 | 
					    bdrv_init();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -71,8 +71,7 @@ CPUState *cpu_generic_init(const char *typename, const char *cpu_model)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
out:
 | 
					out:
 | 
				
			||||||
    if (err != NULL) {
 | 
					    if (err != NULL) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(err));
 | 
					        error_report_err(err);
 | 
				
			||||||
        error_free(err);
 | 
					 | 
				
			||||||
        object_unref(OBJECT(cpu));
 | 
					        object_unref(OBJECT(cpu));
 | 
				
			||||||
        return NULL;
 | 
					        return NULL;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2163,8 +2163,7 @@ X86CPU *cpu_x86_init(const char *cpu_model)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
out:
 | 
					out:
 | 
				
			||||||
    if (error) {
 | 
					    if (error) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(error));
 | 
					        error_report_err(error);
 | 
				
			||||||
        error_free(error);
 | 
					 | 
				
			||||||
        if (cpu != NULL) {
 | 
					        if (cpu != NULL) {
 | 
				
			||||||
            object_unref(OBJECT(cpu));
 | 
					            object_unref(OBJECT(cpu));
 | 
				
			||||||
            cpu = NULL;
 | 
					            cpu = NULL;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -111,8 +111,7 @@ static int cpu_sparc_register(SPARCCPU *cpu, const char *cpu_model)
 | 
				
			||||||
    cc->parse_features(CPU(cpu), featurestr, &err);
 | 
					    cc->parse_features(CPU(cpu), featurestr, &err);
 | 
				
			||||||
    g_free(s);
 | 
					    g_free(s);
 | 
				
			||||||
    if (err) {
 | 
					    if (err) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(err));
 | 
					        error_report_err(err);
 | 
				
			||||||
        error_free(err);
 | 
					 | 
				
			||||||
        return -1;
 | 
					        return -1;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										6
									
								
								tpm.c
								
								
								
								
							
							
						
						
									
										6
									
								
								tpm.c
								
								
								
								
							| 
						 | 
					@ -162,8 +162,7 @@ static int configure_tpm(QemuOpts *opts)
 | 
				
			||||||
    /* validate backend specific opts */
 | 
					    /* validate backend specific opts */
 | 
				
			||||||
    qemu_opts_validate(opts, be->opts, &local_err);
 | 
					    qemu_opts_validate(opts, be->opts, &local_err);
 | 
				
			||||||
    if (local_err) {
 | 
					    if (local_err) {
 | 
				
			||||||
        qerror_report_err(local_err);
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
        return 1;
 | 
					        return 1;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -174,8 +173,7 @@ static int configure_tpm(QemuOpts *opts)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    tpm_backend_open(drv, &local_err);
 | 
					    tpm_backend_open(drv, &local_err);
 | 
				
			||||||
    if (local_err) {
 | 
					    if (local_err) {
 | 
				
			||||||
        qerror_report_err(local_err);
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
        return 1;
 | 
					        return 1;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										14
									
								
								util/error.c
								
								
								
								
							
							
						
						
									
										14
									
								
								util/error.c
								
								
								
								
							| 
						 | 
					@ -41,7 +41,7 @@ void error_set(Error **errp, ErrorClass err_class, const char *fmt, ...)
 | 
				
			||||||
    err->err_class = err_class;
 | 
					    err->err_class = err_class;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (errp == &error_abort) {
 | 
					    if (errp == &error_abort) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(err));
 | 
					        error_report_err(err);
 | 
				
			||||||
        abort();
 | 
					        abort();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -77,7 +77,7 @@ void error_set_errno(Error **errp, int os_errno, ErrorClass err_class,
 | 
				
			||||||
    err->err_class = err_class;
 | 
					    err->err_class = err_class;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (errp == &error_abort) {
 | 
					    if (errp == &error_abort) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(err));
 | 
					        error_report_err(err);
 | 
				
			||||||
        abort();
 | 
					        abort();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -122,7 +122,7 @@ void error_set_win32(Error **errp, int win32_err, ErrorClass err_class,
 | 
				
			||||||
    err->err_class = err_class;
 | 
					    err->err_class = err_class;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (errp == &error_abort) {
 | 
					    if (errp == &error_abort) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(err));
 | 
					        error_report_err(err);
 | 
				
			||||||
        abort();
 | 
					        abort();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -152,6 +152,12 @@ const char *error_get_pretty(Error *err)
 | 
				
			||||||
    return err->msg;
 | 
					    return err->msg;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void error_report_err(Error *err)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    error_report("%s", error_get_pretty(err));
 | 
				
			||||||
 | 
					    error_free(err);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void error_free(Error *err)
 | 
					void error_free(Error *err)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    if (err) {
 | 
					    if (err) {
 | 
				
			||||||
| 
						 | 
					@ -163,7 +169,7 @@ void error_free(Error *err)
 | 
				
			||||||
void error_propagate(Error **dst_errp, Error *local_err)
 | 
					void error_propagate(Error **dst_errp, Error *local_err)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    if (local_err && dst_errp == &error_abort) {
 | 
					    if (local_err && dst_errp == &error_abort) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(local_err));
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        abort();
 | 
					        abort();
 | 
				
			||||||
    } else if (dst_errp && !*dst_errp) {
 | 
					    } else if (dst_errp && !*dst_errp) {
 | 
				
			||||||
        *dst_errp = local_err;
 | 
					        *dst_errp = local_err;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -32,8 +32,7 @@ QemuOptsList *qemu_find_opts(const char *group)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ret = find_list(vm_config_groups, group, &local_err);
 | 
					    ret = find_list(vm_config_groups, group, &local_err);
 | 
				
			||||||
    if (local_err) {
 | 
					    if (local_err) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(local_err));
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return ret;
 | 
					    return ret;
 | 
				
			||||||
| 
						 | 
					@ -314,8 +313,7 @@ int qemu_config_parse(FILE *fp, QemuOptsList **lists, const char *fname)
 | 
				
			||||||
            /* group with id */
 | 
					            /* group with id */
 | 
				
			||||||
            list = find_list(lists, group, &local_err);
 | 
					            list = find_list(lists, group, &local_err);
 | 
				
			||||||
            if (local_err) {
 | 
					            if (local_err) {
 | 
				
			||||||
                error_report("%s", error_get_pretty(local_err));
 | 
					                error_report_err(local_err);
 | 
				
			||||||
                error_free(local_err);
 | 
					 | 
				
			||||||
                goto out;
 | 
					                goto out;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            opts = qemu_opts_create(list, id, 1, NULL);
 | 
					            opts = qemu_opts_create(list, id, 1, NULL);
 | 
				
			||||||
| 
						 | 
					@ -325,8 +323,7 @@ int qemu_config_parse(FILE *fp, QemuOptsList **lists, const char *fname)
 | 
				
			||||||
            /* group without id */
 | 
					            /* group without id */
 | 
				
			||||||
            list = find_list(lists, group, &local_err);
 | 
					            list = find_list(lists, group, &local_err);
 | 
				
			||||||
            if (local_err) {
 | 
					            if (local_err) {
 | 
				
			||||||
                error_report("%s", error_get_pretty(local_err));
 | 
					                error_report_err(local_err);
 | 
				
			||||||
                error_free(local_err);
 | 
					 | 
				
			||||||
                goto out;
 | 
					                goto out;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            opts = qemu_opts_create(list, NULL, 0, &error_abort);
 | 
					            opts = qemu_opts_create(list, NULL, 0, &error_abort);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										21
									
								
								vl.c
								
								
								
								
							
							
						
						
									
										21
									
								
								vl.c
								
								
								
								
							| 
						 | 
					@ -2137,8 +2137,7 @@ static int chardev_init_func(QemuOpts *opts, void *opaque)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    qemu_chr_new_from_opts(opts, NULL, &local_err);
 | 
					    qemu_chr_new_from_opts(opts, NULL, &local_err);
 | 
				
			||||||
    if (local_err) {
 | 
					    if (local_err) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(local_err));
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
        return -1;
 | 
					        return -1;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
| 
						 | 
					@ -2218,8 +2217,7 @@ static void monitor_parse(const char *optarg, const char *mode, bool pretty)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    opts = qemu_opts_create(qemu_find_opts("mon"), label, 1, &local_err);
 | 
					    opts = qemu_opts_create(qemu_find_opts("mon"), label, 1, &local_err);
 | 
				
			||||||
    if (!opts) {
 | 
					    if (!opts) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(local_err));
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
        exit(1);
 | 
					        exit(1);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    qemu_opt_set(opts, "mode", mode);
 | 
					    qemu_opt_set(opts, "mode", mode);
 | 
				
			||||||
| 
						 | 
					@ -2583,8 +2581,7 @@ static int machine_set_property(const char *name, const char *value,
 | 
				
			||||||
    g_free(qom_name);
 | 
					    g_free(qom_name);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (local_err) {
 | 
					    if (local_err) {
 | 
				
			||||||
        qerror_report_err(local_err);
 | 
					        error_report_err(local_err);
 | 
				
			||||||
        error_free(local_err);
 | 
					 | 
				
			||||||
        return -1;
 | 
					        return -1;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2637,8 +2634,7 @@ out:
 | 
				
			||||||
    g_free(type);
 | 
					    g_free(type);
 | 
				
			||||||
    g_free(dummy);
 | 
					    g_free(dummy);
 | 
				
			||||||
    if (err) {
 | 
					    if (err) {
 | 
				
			||||||
        qerror_report_err(err);
 | 
					        error_report_err(err);
 | 
				
			||||||
        error_free(err);
 | 
					 | 
				
			||||||
        return -1;
 | 
					        return -1;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
| 
						 | 
					@ -3766,7 +3762,7 @@ int main(int argc, char **argv, char **envp)
 | 
				
			||||||
    os_daemonize();
 | 
					    os_daemonize();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (qemu_init_main_loop(&main_loop_err)) {
 | 
					    if (qemu_init_main_loop(&main_loop_err)) {
 | 
				
			||||||
        error_report("%s", error_get_pretty(main_loop_err));
 | 
					        error_report_err(main_loop_err);
 | 
				
			||||||
        exit(1);
 | 
					        exit(1);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4033,8 +4029,7 @@ int main(int argc, char **argv, char **envp)
 | 
				
			||||||
        Error *local_err = NULL;
 | 
					        Error *local_err = NULL;
 | 
				
			||||||
        qtest_init(qtest_chrdev, qtest_log, &local_err);
 | 
					        qtest_init(qtest_chrdev, qtest_log, &local_err);
 | 
				
			||||||
        if (local_err) {
 | 
					        if (local_err) {
 | 
				
			||||||
            error_report("%s", error_get_pretty(local_err));
 | 
					            error_report_err(local_err);
 | 
				
			||||||
            error_free(local_err);
 | 
					 | 
				
			||||||
            exit(1);
 | 
					            exit(1);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -4056,7 +4051,7 @@ int main(int argc, char **argv, char **envp)
 | 
				
			||||||
        if (order) {
 | 
					        if (order) {
 | 
				
			||||||
            validate_bootdevices(order, &local_err);
 | 
					            validate_bootdevices(order, &local_err);
 | 
				
			||||||
            if (local_err) {
 | 
					            if (local_err) {
 | 
				
			||||||
                error_report("%s", error_get_pretty(local_err));
 | 
					                error_report_err(local_err);
 | 
				
			||||||
                exit(1);
 | 
					                exit(1);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            boot_order = order;
 | 
					            boot_order = order;
 | 
				
			||||||
| 
						 | 
					@ -4066,7 +4061,7 @@ int main(int argc, char **argv, char **envp)
 | 
				
			||||||
        if (once) {
 | 
					        if (once) {
 | 
				
			||||||
            validate_bootdevices(once, &local_err);
 | 
					            validate_bootdevices(once, &local_err);
 | 
				
			||||||
            if (local_err) {
 | 
					            if (local_err) {
 | 
				
			||||||
                error_report("%s", error_get_pretty(local_err));
 | 
					                error_report_err(local_err);
 | 
				
			||||||
                exit(1);
 | 
					                exit(1);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            normal_boot_order = g_strdup(boot_order);
 | 
					            normal_boot_order = g_strdup(boot_order);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue