diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2016-11-11 12:51:50 +0000 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2016-11-11 12:51:50 +0000 |
commit | 83c83f9a5266ff113060f887f106a47920fa6974 (patch) | |
tree | e25f16e32d59b52f04206f2ea5037854417d06dd | |
parent | 6bbcb76301a72dc80c8d29af13d40bb9a759c9c6 (diff) | |
parent | a5068244b4f0c994791303b6186b6f732adab6c2 (diff) |
Merge remote-tracking branch 'bonzini/tags/for-upstream' into staging
Small fixes for hard freeze.
# gpg: Signature made Thu 10 Nov 2016 03:34:24 PM GMT
# gpg: using RSA key 0xBFFBD25F78C7AE83
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>"
# gpg: aka "Paolo Bonzini <pbonzini@redhat.com>"
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1
# Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83
* bonzini/tags/for-upstream:
nbd: Don't inf-loop on early EOF
target-i386: document how x86 gdb_num_core_regs is computed.
qdev: fix use-after-free regression from becdfa00cfa
target-i386/machine: fix migrate faile because of Hyper-V HV_X64_MSR_VP_RUNTIME
vl.c: move pidfile creation up the line
target-i386: fix typo
Message-id: 1478800362-18138-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
-rw-r--r-- | hw/core/qdev-properties-system.c | 8 | ||||
-rw-r--r-- | nbd/client.c | 13 | ||||
-rw-r--r-- | target-i386/cpu.c | 3 | ||||
-rw-r--r-- | target-i386/kvm.c | 2 | ||||
-rw-r--r-- | target-i386/machine.c | 4 | ||||
-rw-r--r-- | vl.c | 10 |
6 files changed, 22 insertions, 18 deletions
diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c index c35f0f59d6..1b7ea50e9f 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -200,18 +200,14 @@ static void set_chr(Object *obj, Visitor *v, const char *name, void *opaque, } s = qemu_chr_find(str); - g_free(str); if (s == NULL) { error_setg(errp, "Property '%s.%s' can't find value '%s'", object_get_typename(obj), prop->name, str); - return; - } - - if (!qemu_chr_fe_init(be, s, errp)) { + } else if (!qemu_chr_fe_init(be, s, errp)) { error_prepend(errp, "Property '%s.%s' can't take value '%s': ", object_get_typename(obj), prop->name, str); - return; } + g_free(str); } static void release_chr(Object *obj, const char *name, void *opaque) diff --git a/nbd/client.c b/nbd/client.c index 7db4301d29..ffb0743bce 100644 --- a/nbd/client.c +++ b/nbd/client.c @@ -90,20 +90,21 @@ static QTAILQ_HEAD(, NBDExport) exports = QTAILQ_HEAD_INITIALIZER(exports); * the amount of bytes consumed. */ static ssize_t drop_sync(QIOChannel *ioc, size_t size) { - ssize_t ret, dropped = size; + ssize_t ret = 0; char small[1024]; char *buffer; buffer = sizeof(small) < size ? small : g_malloc(MIN(65536, size)); while (size > 0) { - ret = read_sync(ioc, buffer, MIN(65536, size)); - if (ret < 0) { + ssize_t count = read_sync(ioc, buffer, MIN(65536, size)); + + if (count <= 0) { goto cleanup; } - assert(ret <= size); - size -= ret; + assert(count <= size); + size -= count; + ret += count; } - ret = dropped; cleanup: if (buffer != small) { diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 14c5186fe7..6eec5dc86d 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -3721,6 +3721,9 @@ static void x86_cpu_common_class_init(ObjectClass *oc, void *data) cc->write_elf32_qemunote = x86_cpu_write_elf32_qemunote; cc->vmsd = &vmstate_x86_cpu; #endif + /* CPU_NB_REGS * 2 = general regs + xmm regs + * 25 = eip, eflags, 6 seg regs, st[0-7], fctrl,...,fop, mxcsr. + */ cc->gdb_num_core_regs = CPU_NB_REGS * 2 + 25; #ifndef CONFIG_USER_ONLY cc->debug_excp_handler = breakpoint_handler; diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 1c0864ed16..f62264a7a8 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -2855,7 +2855,7 @@ MemTxAttrs kvm_arch_post_run(CPUState *cpu, struct kvm_run *run) if (run->flags & KVM_RUN_X86_SMM) { env->hflags |= HF_SMM_MASK; } else { - env->hflags &= HF_SMM_MASK; + env->hflags &= ~HF_SMM_MASK; } if (run->if_flag) { env->eflags |= IF_MASK; diff --git a/target-i386/machine.c b/target-i386/machine.c index 48037f1575..760f82b6c7 100644 --- a/target-i386/machine.c +++ b/target-i386/machine.c @@ -709,6 +709,10 @@ static bool hyperv_runtime_enable_needed(void *opaque) X86CPU *cpu = opaque; CPUX86State *env = &cpu->env; + if (!cpu->hyperv_runtime) { + return false; + } + return env->msr_hv_runtime != 0; } @@ -4063,6 +4063,11 @@ int main(int argc, char **argv, char **envp) os_daemonize(); + if (pid_file && qemu_create_pidfile(pid_file) != 0) { + error_report("could not acquire pid file: %s", strerror(errno)); + exit(1); + } + if (qemu_init_main_loop(&main_loop_err)) { error_report_err(main_loop_err); exit(1); @@ -4340,11 +4345,6 @@ int main(int argc, char **argv, char **envp) } #endif - if (pid_file && qemu_create_pidfile(pid_file) != 0) { - error_report("could not acquire pid file: %s", strerror(errno)); - exit(1); - } - if (qemu_opts_foreach(qemu_find_opts("device"), device_help_func, NULL, NULL)) { exit(0); |