From patchwork Mon Apr 25 01:38:26 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brad Hards X-Patchwork-Id: 92691 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9F97DB6F68 for ; Mon, 25 Apr 2011 11:38:49 +1000 (EST) Received: from localhost ([::1]:44880 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEAlA-00041Z-GQ for incoming@patchwork.ozlabs.org; Sun, 24 Apr 2011 21:38:44 -0400 Received: from eggs.gnu.org ([140.186.70.92]:50504) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEAl1-00041S-6D for qemu-devel@nongnu.org; Sun, 24 Apr 2011 21:38:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QEAl0-0003k1-Be for qemu-devel@nongnu.org; Sun, 24 Apr 2011 21:38:35 -0400 Received: from ipmail05.adl6.internode.on.net ([150.101.137.143]:8294) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEAl0-0003j6-0h for qemu-devel@nongnu.org; Sun, 24 Apr 2011 21:38:34 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhQGAGLPtE2WZXPNgWdsb2JhbACYDI0/AQEWJiXDaoV2BA Received: from ppp115-205.static.internode.on.net (HELO incana.localnet) ([150.101.115.205]) by ipmail05.adl6.internode.on.net with ESMTP; 25 Apr 2011 11:08:28 +0930 From: Brad Hards To: qemu-devel@nongnu.org Date: Mon, 25 Apr 2011 11:38:26 +1000 User-Agent: KMail/1.13.5 (Linux/2.6.35-28-generic; KDE/4.5.1; x86_64; ; ) MIME-Version: 1.0 Message-Id: <201104251138.26790.bradh@frogmouth.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 150.101.137.143 Subject: [Qemu-devel] [RFC] Removing old command line options X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org I've been trying to update the documentation (currently on neworking), and one of the things that makes it hard is that there are a few old (legacy) command line options (e.g. --tftp). Removing them is easy, but not really nice to users who depend on them. So I was thinking about a migration approach. I came up with two alternatives. Simplest approach is just to add a warning for the next release, and remove the option in the next+1 release. The other alternative is to add an intermediate state, so its a warning in the next release, and requires an --enable-legacy-options command line argument to get it back in next+1. Then its gone in next+2. Thoughts? Comments? Brad diff --git a/vl.c b/vl.c index 68c3b53..a972712 100644 --- a/vl.c +++ b/vl.c @@ -1941,6 +1941,13 @@ static const QEMUOption *lookup_opt(int argc, char **argv, return popt; } +static void display_legacy_warning(const char *option_name) +{ + fprintf(stderr, "%s is a legacy option, which will be removed in a future " + "version of QEMU. Consult the manual for replacement.\n", + option_name); +} + int main(int argc, char **argv, char **envp) { const char *gdbstub_dev = NULL; @@ -2277,12 +2284,15 @@ int main(int argc, char **argv, char **envp) break; #ifdef CONFIG_SLIRP case QEMU_OPTION_tftp: + display_legacy_warning("--tftp"); legacy_tftp_prefix = optarg; break; case QEMU_OPTION_bootp: + display_legacy_warning("--bootp"); legacy_bootp_filename = optarg; break; case QEMU_OPTION_redir: + display_legacy_warning("--redir"); if (net_slirp_redir(optarg) < 0) exit(1); break;