#ifdef CONFIG_SDL
#ifdef __APPLE__
-#include <SDL/SDL.h>
+#include <SDL.h>
int qemu_main(int argc, char **argv, char **envp);
int main(int argc, char **argv)
{
const char *vnc_display;
int acpi_enabled = 1;
int no_hpet = 0;
+int no_virtio_balloon = 0;
int fd_bootchk = 1;
int no_reboot = 0;
int no_shutdown = 0;
static int qemu_calculate_timeout(void)
{
+#ifndef CONFIG_IOTHREAD
int timeout;
if (!vm_running)
}
return timeout;
+#else /* CONFIG_IOTHREAD */
+ return 1000;
+#endif
}
static int vm_can_run(void)
#ifdef CONFIG_PROFILER
ti = profile_getclock();
#endif
-#ifdef CONFIG_IOTHREAD
- main_loop_wait(1000);
-#else
main_loop_wait(qemu_calculate_timeout());
-#endif
#ifdef CONFIG_PROFILER
dev_time += profile_getclock() - ti;
#endif
len = GetModuleFileName(NULL, buf, sizeof(buf) - 1);
if (len == 0) {
- return len;
+ return NULL;
}
buf[len] = 0;
#ifdef PATH_MAX
char buf[PATH_MAX];
#endif
+ size_t max_len;
#if defined(__linux__)
{
dir = dirname(p);
dir = dirname(dir);
- res = qemu_mallocz(strlen(dir) +
- MAX(strlen(SHARE_SUFFIX), strlen(BUILD_SUFFIX)) + 1);
- sprintf(res, "%s%s", dir, SHARE_SUFFIX);
+ max_len = strlen(dir) +
+ MAX(strlen(SHARE_SUFFIX), strlen(BUILD_SUFFIX)) + 1;
+ res = qemu_mallocz(max_len);
+ snprintf(res, max_len, "%s%s", dir, SHARE_SUFFIX);
if (access(res, R_OK)) {
- sprintf(res, "%s%s", dir, BUILD_SUFFIX);
+ snprintf(res, max_len, "%s%s", dir, BUILD_SUFFIX);
if (access(res, R_OK)) {
qemu_free(res);
res = NULL;
}
len = strlen(data_dir) + strlen(name) + strlen(subdir) + 2;
buf = qemu_mallocz(len);
- sprintf(buf, "%s/%s%s", data_dir, subdir, name);
+ snprintf(buf, len, "%s/%s%s", data_dir, subdir, name);
if (access(buf, R_OK)) {
qemu_free(buf);
return NULL;
case QEMU_OPTION_no_hpet:
no_hpet = 1;
break;
+ case QEMU_OPTION_no_virtio_balloon:
+ no_virtio_balloon = 1;
+ break;
#endif
case QEMU_OPTION_no_reboot:
no_reboot = 1;