From bb5ffd7497ac503e1e85d08b0810dd99d288a52d Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 27 Apr 2017 10:42:19 +0100 Subject: [PATCH] configure: Drop --with-qemu-options / QEMU_OPTIONS. In its current form this is very hard to implement because it requires us to "unparse" the options, including removing any shell quoting. It wasn't implemented at all for the libvirt backend. Also contrary to the documentation, the configure script did not use these options for testing, but constructed its own set of qemu test options. --- configure.ac | 2 +- docs/guestfs-building.pod | 5 --- lib/launch-direct.c | 66 --------------------------------------- m4/guestfs_qemu.m4 | 16 ---------- 4 files changed, 1 insertion(+), 88 deletions(-) diff --git a/configure.ac b/configure.ac index 17668ff0b..56aa05d3e 100644 --- a/configure.ac +++ b/configure.ac @@ -321,7 +321,7 @@ echo "This is how we have configured the optional components for you today:" echo echo "Daemon .............................. $enable_daemon" echo "Appliance ........................... $ENABLE_APPLIANCE" -echo "QEMU ................................ $QEMU $QEMU_OPTIONS" +echo "QEMU ................................ $QEMU" echo "guestfish and C-based virt tools .... yes" echo "FUSE filesystem ..................... $enable_fuse" AS_ECHO_N(["GNU gettext for i18n ................ "]) diff --git a/docs/guestfs-building.pod b/docs/guestfs-building.pod index 6e89acfc8..0f9ed2893 100644 --- a/docs/guestfs-building.pod +++ b/docs/guestfs-building.pod @@ -667,11 +667,6 @@ Provide an alternate qemu binary (or list of binaries). This can be overridden at runtime by setting the C environment variable. -=item B<--with-qemu-options=">-M ... -cpu ...B<"> - -If qemu requires extra options to work on this platform, you can pass -them here, and they will be used both when testing and running qemu. - =item B<--with-supermin-packager-config=>I This passes the I<--packager-config> option to L. diff --git a/lib/launch-direct.c b/lib/launch-direct.c index b0038c6a9..aa9c292d0 100644 --- a/lib/launch-direct.c +++ b/lib/launch-direct.c @@ -97,64 +97,6 @@ create_cow_overlay_direct (guestfs_h *g, void *datav, struct drive *drv) return overlay; } -#ifdef QEMU_OPTIONS -/* Like 'add_cmdline' but allowing a shell-quoted string of zero or - * more options. XXX The unquoting is not very clever. - */ -static void -add_cmdline_shell_unquoted (guestfs_h *g, struct stringsbuf *sb, - const char *options) -{ - char quote; - const char *startp, *endp, *nextp; - - while (*options) { - quote = *options; - if (quote == '\'' || quote == '"') - startp = options+1; - else { - startp = options; - quote = ' '; - } - - endp = strchr (options, quote); - if (endp == NULL) { - if (quote != ' ') { - fprintf (stderr, - _("unclosed quote character (%c) in command line near: %s"), - quote, options); - _exit (EXIT_FAILURE); - } - endp = options + strlen (options); - } - - if (quote == ' ') { - if (endp[0] == '\0') - nextp = endp; - else - nextp = endp+1; - } - else { - if (!endp[1]) - nextp = endp+1; - else if (endp[1] == ' ') - nextp = endp+2; - else { - fprintf (stderr, _("cannot parse quoted string near: %s"), options); - _exit (EXIT_FAILURE); - } - } - while (*nextp && *nextp == ' ') - nextp++; - - guestfs_int_add_string_nodup (g, sb, - safe_strndup (g, startp, endp-startp)); - - options = nextp; - } -} -#endif /* defined QEMU_OPTIONS */ - /* On Debian, /dev/kvm is mode 0660 and group kvm, so users need to * add themselves to the kvm group otherwise things are going to be * very slow (this is Debian bug 640328). Warn about this. @@ -604,14 +546,6 @@ launch_direct (guestfs_h *g, void *datav, const char *arg) * qemu -set parameters can modify previously added options. */ - /* Add the extra options for the qemu command line specified - * at configure time. - */ -#ifdef QEMU_OPTIONS - if (STRNEQ (QEMU_OPTIONS, "")) - add_cmdline_shell_unquoted (g, &cmdline, QEMU_OPTIONS); -#endif - /* Add any qemu parameters. */ for (hp = g->hv_params; hp; hp = hp->next) { ADD_CMDLINE (hp->hv_param); diff --git a/m4/guestfs_qemu.m4 b/m4/guestfs_qemu.m4 index fb02854f4..e07e9800f 100644 --- a/m4/guestfs_qemu.m4 +++ b/m4/guestfs_qemu.m4 @@ -43,22 +43,6 @@ AS_IF([test "x$with_qemu" = "xno"],[ AC_DEFINE_UNQUOTED([QEMU],["$QEMU"],[Location of qemu binary.]) - dnl Does the user wish to specify -M, -cpu or other qemu options? - AC_MSG_CHECKING([if the user specified extra options for qemu command line]) - AC_ARG_WITH([qemu-options], - [AS_HELP_STRING([--with-qemu-options="-M ... -cpu ... etc"], - [pass extra options for qemu command line @<:@default=no@:>@])], - [QEMU_OPTIONS="$withval"], - [QEMU_OPTIONS=no]) - AS_IF([test "x$QEMU_OPTIONS" = "xno"],[ - AC_MSG_RESULT([no]) - QEMU_OPTIONS= - ],[ - AC_MSG_RESULT([$QEMU_OPTIONS]) - ]) - AC_DEFINE_UNQUOTED([QEMU_OPTIONS],["$QEMU_OPTIONS"], - [Extra options for qemu command line.]) - dnl Check that the chosen qemu has virtio-serial support. dnl For historical reasons this can be disabled by setting dnl vmchannel_test=no.