From patchwork Thu Sep 2 16:17:59 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 63506 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A72D8B7187 for ; Fri, 3 Sep 2010 02:26:21 +1000 (EST) Received: from localhost ([127.0.0.1]:40555 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OrCcD-0000hH-Pd for incoming@patchwork.ozlabs.org; Thu, 02 Sep 2010 12:26:17 -0400 Received: from [140.186.70.92] (port=42543 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OrCUS-0005PS-TS for qemu-devel@nongnu.org; Thu, 02 Sep 2010 12:18:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OrCUJ-0000v3-LK for qemu-devel@nongnu.org; Thu, 02 Sep 2010 12:18:11 -0400 Received: from e28smtp04.in.ibm.com ([122.248.162.4]:53549) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OrCUJ-0000uI-0Z for qemu-devel@nongnu.org; Thu, 02 Sep 2010 12:18:07 -0400 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by e28smtp04.in.ibm.com (8.14.4/8.13.1) with ESMTP id o82GI3dR009651 for ; Thu, 2 Sep 2010 21:48:03 +0530 Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o82GI31L4595720 for ; Thu, 2 Sep 2010 21:48:03 +0530 Received: from d28av01.in.ibm.com (loopback [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o82GI2qk008676 for ; Thu, 2 Sep 2010 21:48:02 +0530 Received: from localhost.localdomain ([9.77.208.252]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id o82GI2ZJ008597; Thu, 2 Sep 2010 21:48:02 +0530 From: "Aneesh Kumar K.V" To: qemu-devel@nongnu.org Date: Thu, 2 Sep 2010 21:47:59 +0530 Message-Id: <1283444279-17241-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.0.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: aliguori@us.ibm.com, "Aneesh Kumar K.V" Subject: [Qemu-devel] [PATCH] virtio-9p: Make sure -virtfs option works correctly X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org When making copy of arguments we were doing partial copy Signed-off-by: Aneesh Kumar K.V --- vl.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vl.c b/vl.c index 9f7358e..df11ab3 100644 --- a/vl.c +++ b/vl.c @@ -2332,7 +2332,7 @@ int main(int argc, char **argv, char **envp) len += strlen(qemu_opt_get(opts, "security_model")); arg_fsdev = qemu_malloc((len + 1) * sizeof(*arg_fsdev)); - snprintf(arg_fsdev, len * sizeof(*arg_fsdev), + snprintf(arg_fsdev, (len + 1) * sizeof(*arg_fsdev), "%s,id=%s,path=%s,security_model=%s", qemu_opt_get(opts, "fstype"), qemu_opt_get(opts, "mount_tag"), @@ -2343,7 +2343,7 @@ int main(int argc, char **argv, char **envp) len += 2*strlen(qemu_opt_get(opts, "mount_tag")); arg_9p = qemu_malloc((len + 1) * sizeof(*arg_9p)); - snprintf(arg_9p, len * sizeof(*arg_9p), + snprintf(arg_9p, (len + 1) * sizeof(*arg_9p), "virtio-9p-pci,fsdev=%s,mount_tag=%s", qemu_opt_get(opts, "mount_tag"), qemu_opt_get(opts, "mount_tag"));