Small fixes for hard freeze.

-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQExBAABCAAbBQJYJJOAFBxwYm9uemluaUByZWRoYXQuY29tAAoJEL/70l94x66D
 lDkH/iLwh7X1m3cKAW1NPrfgIc8nJ9w9wNjzvw+e/DbkE1SoNFL8qEm9XBFjuqTu
 DWGnnLOyLQ5MPTcow+hgbAshUqbkbhGTTSSU1oDSGAoap9MDeT93UJYpvd/zwwxZ
 03G0A5Ot/KdaJscvfiu+ILmnLtCLOzsx2Z13c7fuHAErekM0OaG/sFR3GtCYL91r
 HA3PVIDBpvk14KIQQiImtSK+SJv73xPfGyGxSutK8T5wYYSBeXXL06+ITGtaX5ik
 Da4J0SS2w4H6lQCy7YqkhJ7l3eHjYqglRZ7EzgIaqkyIYWoGkjDr/1wmsozYAy/G
 R5VxNjiScgZ8DdHJ9XdJ2s5gwoA=
 =Tq9k
 -----END PGP SIGNATURE-----

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 becdfa00cf
  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>
This commit is contained in:
Stefan Hajnoczi 2016-11-11 12:51:50 +00:00
commit 83c83f9a52
6 changed files with 22 additions and 18 deletions

View File

@ -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)

View File

@ -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) {

View File

@ -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;

View File

@ -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;

View File

@ -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;
}

10
vl.c
View File

@ -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);