All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: virtio-fs-list <virtio-fs@redhat.com>
Subject: [Virtio-fs] [RFC][PATCH] init: Allow mounting virtio_fs instance as rootfs
Date: Thu, 25 Jul 2019 16:49:34 -0400	[thread overview]
Message-ID: <20190725204934.GG15543@redhat.com> (raw)

Hi Stefan,

I think following patch might allow you to mount virtio_fs as rootfs
with new syntax.

I have only compiled it and not tested it. Plase have a look.

Thanks
Vivek

virtio_fs passes root=<fs-instance-name> as identifier of virtio_fs instance
to be mounted. None of the existing primitives seems to fit virito_fs needs.

So check rootfstype and if it is "virtio_fs", do not parse root= further
and call mount_block_root().

This is similar to carving out special paths for ubifs. Now virtio_fs
users should be able to pass "root=myfs rootfstype=virtio_fs" and be
able to mount that particular instance of virtio_fs as rootfs.
 
Yet-To-Be-Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
---
 init/do_mounts.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: rhvgoyal-linux-fuse/init/do_mounts.c
===================================================================
--- rhvgoyal-linux-fuse.orig/init/do_mounts.c	2019-04-09 15:42:17.096602971 -0400
+++ rhvgoyal-linux-fuse/init/do_mounts.c	2019-07-25 16:40:29.226348627 -0400
@@ -595,6 +595,10 @@ void __init prepare_namespace(void)
 			mount_block_root(root_device_name, root_mountflags);
 			goto out;
 		}
+		if (root_fs_names && !strncmp(root_fs_names, "virtio_fs", 3)) {
+			mount_block_root(root_device_name, root_mountflags);
+			goto out;
+		}
 		ROOT_DEV = name_to_dev_t(root_device_name);
 		if (strncmp(root_device_name, "/dev/", 5) == 0)
 			root_device_name += 5;


             reply	other threads:[~2019-07-25 20:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-25 20:49 Vivek Goyal [this message]
2019-07-29 10:15 ` [Virtio-fs] [RFC][PATCH] init: Allow mounting virtio_fs instance as rootfs Stefan Hajnoczi
2019-07-29 12:51   ` Vivek Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190725204934.GG15543@redhat.com \
    --to=vgoyal@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=virtio-fs@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.