Skip to content

Commit

Permalink
Update our copy of qemu to roll in fix for glibc problem.
Browse files Browse the repository at this point in the history
  • Loading branch information
mvandervoord committed Nov 19, 2019
1 parent 0af83ba commit ace4b08
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
7 changes: 4 additions & 3 deletions assets/qemu/qemu-stable-1.1/trace-events
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@
# The <format-string> should be a sprintf()-compatible format string.

# qemu-malloc.c
g_malloc(size_t size, void *ptr) "size %zu ptr %p"
g_realloc(void *ptr, size_t size, void *newptr) "ptr %p size %zu newptr %p"
g_free(void *ptr) "ptr %p"
# removed to avoid glibc problems
#g_malloc(size_t size, void *ptr) "size %zu ptr %p"
#g_realloc(void *ptr, size_t size, void *newptr) "ptr %p size %zu newptr %p"
#g_free(void *ptr) "ptr %p"

# osdep.c
qemu_memalign(size_t alignment, size_t size, void *ptr) "alignment %zu size %zu ptr %p"
Expand Down
14 changes: 10 additions & 4 deletions assets/qemu/qemu-stable-1.1/vl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2040,7 +2040,7 @@ static int virtcon_parse(const char *devname)
qemu_opt_set(bus_opts, "driver", "virtio-serial-s390");
} else {
qemu_opt_set(bus_opts, "driver", "virtio-serial-pci");
}
}

dev_opts = qemu_opts_create(device, NULL, 0);
qemu_opt_set(dev_opts, "driver", "virtconsole");
Expand All @@ -2059,7 +2059,7 @@ static int virtcon_parse(const char *devname)
}

static int debugcon_parse(const char *devname)
{
{
QemuOpts *opts;

if (!qemu_chr_new("debugcon", devname, NULL)) {
Expand Down Expand Up @@ -2241,6 +2241,7 @@ static const QEMUOption *lookup_opt(int argc, char **argv,
return popt;
}

/* removed to avoid glibc problems
static gpointer malloc_and_trace(gsize n_bytes)
{
void *ptr = malloc(n_bytes);
Expand All @@ -2260,6 +2261,7 @@ static void free_and_trace(gpointer mem)
trace_g_free(mem);
free(mem);
}
*/

int qemu_init_main_loop(void)
{
Expand Down Expand Up @@ -2294,18 +2296,22 @@ int main(int argc, char **argv, char **envp)
bool userconfig = true;
const char *log_mask = NULL;
const char *log_file = NULL;
/* removed to avoid glibc problems
GMemVTable mem_trace = {
.malloc = malloc_and_trace,
.realloc = realloc_and_trace,
.free = free_and_trace,
};
*/
const char *trace_events = NULL;
const char *trace_file = NULL;

atexit(qemu_run_exit_notifiers);
error_set_progname(argv[0]);

/* removed to avoid glibc problems
g_mem_set_vtable(&mem_trace);
*/
if (!g_thread_supported()) {
#if !GLIB_CHECK_VERSION(2, 31, 0)
g_thread_init(NULL);
Expand Down Expand Up @@ -3076,8 +3082,8 @@ int main(int argc, char **argv, char **envp)
}
p += 8;
os_set_proc_name(p);
}
}
}
}
break;
case QEMU_OPTION_prom_env:
if (nb_prom_envs >= MAX_PROM_ENVS) {
Expand Down

0 comments on commit ace4b08

Please sign in to comment.