From patchwork Fri Jan 11 18:15:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 211410 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 586192C032D for ; Sat, 12 Jan 2013 06:08:33 +1100 (EST) Received: from localhost ([::1]:39971 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ttj7c-0002vb-54 for incoming@patchwork.ozlabs.org; Fri, 11 Jan 2013 13:14:28 -0500 Received: from eggs.gnu.org ([208.118.235.92]:46059) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ttj6y-0001Tw-C0 for qemu-devel@nongnu.org; Fri, 11 Jan 2013 13:13:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ttj6q-00032t-U0 for qemu-devel@nongnu.org; Fri, 11 Jan 2013 13:13:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:17874) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ttj6q-00032O-Mm for qemu-devel@nongnu.org; Fri, 11 Jan 2013 13:13:40 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0BIDcYO017887 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 11 Jan 2013 13:13:38 -0500 Received: from blackpad.lan.raisama.net (vpn1-7-42.gru2.redhat.com [10.97.7.42]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r0BIDb0c012745; Fri, 11 Jan 2013 13:13:38 -0500 Received: by blackpad.lan.raisama.net (Postfix, from userid 500) id 7355D202B69; Fri, 11 Jan 2013 16:15:20 -0200 (BRST) From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Fri, 11 Jan 2013 16:15:08 -0200 Message-Id: <1357928108-21066-11-git-send-email-ehabkost@redhat.com> In-Reply-To: <1357928108-21066-1-git-send-email-ehabkost@redhat.com> References: <1357928108-21066-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: libvir-list@redhat.com, Chegu Vinod , Anthony Liguori Subject: [Qemu-devel] [RFC 10/10] vl.c: Handle legacy "-numa node, cpus=A, B, C, D" format 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 As libvirt already uses this format and expects it to work, add a small hack to the legacy -numa option parsing code to make the "cpus=A,B,C,D" format work. Signed-off-by: Eduardo Habkost --- vl.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/vl.c b/vl.c index 14bf9b6..cf30d44 100644 --- a/vl.c +++ b/vl.c @@ -1194,6 +1194,17 @@ static void parse_legacy_numa_node(const char *optarg) p++; } qemu_opt_set(opts, option, value); + + /* special case for "cpus", as it can contain "," */ + if (!strcmp(option, "cpus")) { + while (isdigit(*p)) { + p = get_opt_value(value, 128, p); + if (*p == ',') { + p++; + } + qemu_opt_set(opts, "cpus", value); + } + } } }