Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
launch: switch from -nographic to -display none
The latter is a better way to disable the qemu display output as we
need to, without enabling extra devices (which are disabled already,
anyway).

Also, related to the change above, ban the -display parameter from the
ones that can be supplied by the user.
  • Loading branch information
ptoscano authored and rwmjones committed Dec 9, 2013
1 parent c89ffbc commit 7a41f5c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
8 changes: 4 additions & 4 deletions configure.ac
Expand Up @@ -797,16 +797,16 @@ working.
AC_MSG_FAILURE([$QEMU version must be >= 1.0.])
fi

AC_MSG_CHECKING([that $QEMU -nographic -machine accel=kvm:tcg -device ? works])
if $QEMU -nographic -machine accel=kvm:tcg -device \? >&AS_MESSAGE_LOG_FD 2>&1; then
AC_MSG_CHECKING([that $QEMU -display none -machine accel=kvm:tcg -device ? works])
if $QEMU -display none -machine accel=kvm:tcg -device \? >&AS_MESSAGE_LOG_FD 2>&1; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_FAILURE([$QEMU -nographic -machine accel=kvm:tcg -device ? doesn't work.])
AC_MSG_FAILURE([$QEMU -display none -machine accel=kvm:tcg -device ? doesn't work.])
fi

AC_MSG_CHECKING([for virtio-serial support in $QEMU])
if $QEMU $QEMU_OPTIONS -nographic -machine accel=kvm:tcg -device \? 2>&1 | grep -sq virtio-serial; then
if $QEMU $QEMU_OPTIONS -display none -machine accel=kvm:tcg -device \? 2>&1 | grep -sq virtio-serial; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
Expand Down
12 changes: 8 additions & 4 deletions src/launch-direct.c
Expand Up @@ -349,7 +349,8 @@ launch_direct (guestfs_h *g, void *datav, const char *arg)
if (qemu_supports (g, data, "-nodefaults"))
ADD_CMDLINE ("-nodefaults");

ADD_CMDLINE ("-nographic");
ADD_CMDLINE ("-display");
ADD_CMDLINE ("none");

#ifdef MACHINE_TYPE
ADD_CMDLINE ("-M");
Expand Down Expand Up @@ -918,7 +919,8 @@ test_qemu (guestfs_h *g, struct backend_direct_data *data)
data->qemu_devices = NULL;

guestfs___cmd_add_arg (cmd1, g->hv);
guestfs___cmd_add_arg (cmd1, "-nographic");
guestfs___cmd_add_arg (cmd1, "-display");
guestfs___cmd_add_arg (cmd1, "none");
guestfs___cmd_add_arg (cmd1, "-help");
guestfs___cmd_set_stdout_callback (cmd1, read_all, &data->qemu_help,
CMD_STDOUT_FLAG_WHOLE_BUFFER);
Expand All @@ -927,7 +929,8 @@ test_qemu (guestfs_h *g, struct backend_direct_data *data)
goto error;

guestfs___cmd_add_arg (cmd2, g->hv);
guestfs___cmd_add_arg (cmd2, "-nographic");
guestfs___cmd_add_arg (cmd2, "-display");
guestfs___cmd_add_arg (cmd2, "none");
guestfs___cmd_add_arg (cmd2, "-version");
guestfs___cmd_set_stdout_callback (cmd2, read_all, &data->qemu_version,
CMD_STDOUT_FLAG_WHOLE_BUFFER);
Expand All @@ -938,7 +941,8 @@ test_qemu (guestfs_h *g, struct backend_direct_data *data)
parse_qemu_version (g, data);

guestfs___cmd_add_arg (cmd3, g->hv);
guestfs___cmd_add_arg (cmd3, "-nographic");
guestfs___cmd_add_arg (cmd3, "-display");
guestfs___cmd_add_arg (cmd3, "none");
guestfs___cmd_add_arg (cmd3, "-machine");
guestfs___cmd_add_arg (cmd3, "accel=kvm:tcg");
guestfs___cmd_add_arg (cmd3, "-device");
Expand Down
1 change: 1 addition & 0 deletions src/launch.c
Expand Up @@ -295,6 +295,7 @@ guestfs__config (guestfs_h *g,
if (STREQ (hv_param, "-kernel") ||
STREQ (hv_param, "-initrd") ||
STREQ (hv_param, "-nographic") ||
STREQ (hv_param, "-display") ||
STREQ (hv_param, "-serial") ||
STREQ (hv_param, "-full-screen") ||
STREQ (hv_param, "-std-vga") ||
Expand Down

0 comments on commit 7a41f5c

Please sign in to comment.