From patchwork Thu Oct 22 15:59:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleg Nesterov X-Patchwork-Id: 7465711 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 29478BEEA4 for ; Thu, 22 Oct 2015 16:03:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5ACFF20649 for ; Thu, 22 Oct 2015 16:03:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 671322065A for ; Thu, 22 Oct 2015 16:03:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965150AbbJVQDR (ORCPT ); Thu, 22 Oct 2015 12:03:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36021 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752250AbbJVQDQ (ORCPT ); Thu, 22 Oct 2015 12:03:16 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id AE0E4223; Thu, 22 Oct 2015 16:03:16 +0000 (UTC) Received: from tranklukator.brq.redhat.com (dhcp-1-102.brq.redhat.com [10.34.1.102]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id t9MG3E1Z000727; Thu, 22 Oct 2015 12:03:15 -0400 Received: by tranklukator.brq.redhat.com (nbSMTP-1.00) for uid 500 oleg@redhat.com; Thu, 22 Oct 2015 17:59:44 +0200 (CEST) Date: Thu, 22 Oct 2015 17:59:42 +0200 From: Oleg Nesterov To: Andre Przywara , Aneesh Kumar , Sasha Levin , Pekka Enberg , Will Deacon Cc: kvm@vger.kernel.org Subject: [PATCH 2/3] kvmtool/run: don't abuse "root=" parameter, don't pass "rw" to v9fs_mount() Message-ID: <20151022155942.GA15548@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20151022155921.GA15527@redhat.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 1. kvm_cmd_run_init() appends "root=/dev/root" to real_cmdline if cfg.using_rootfs == T. This doesn't hurt but makes no sense and looks confusing. We do not need to initialiaze the kernel's saved_root_name[] and "/dev/root" means nothing to name_to_dev_t(). We only need to pass this mount-tag to 9p but the kernel always uses dev_name="/dev/root" in mount_root() path, so we can safely remove this option from the command line. 2. "rw" in rootflags looks confusing too, it is silently ignored by v9fs_parse_options() and has no effect. We need to clear MS_RDONLY from root_mountflags, this is what the "standalone" kernel parameter correctly does. Signed-off-by: Oleg Nesterov --- builtin-run.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin-run.c b/builtin-run.c index ab1fc2a..6e4491c 100644 --- a/builtin-run.c +++ b/builtin-run.c @@ -590,7 +590,7 @@ static struct kvm *kvm_cmd_run_init(int argc, const char **argv) } if (kvm->cfg.using_rootfs) { - strcat(real_cmdline, " root=/dev/root rw rootflags=rw,trans=virtio,version=9p2000.L rootfstype=9p"); + strcat(real_cmdline, " rw rootflags=trans=virtio,version=9p2000.L rootfstype=9p"); if (kvm->cfg.custom_rootfs) { kvm_run_set_sandbox(kvm);