[PATCH] large file support for lomount (for 32-bit dom0)

View: New views
11 Messages — Rating Filter:   Alert me  

[PATCH] large file support for lomount (for 32-bit dom0)

by Dan Magenheimer-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Give lomount large file support on a 32-bit dom0 so that
file images larger than 4GB can be lomount'ed.

Signed-off-by: Dan Magenheimer <dan.magenheimer@...>

diff -r 23b43708aad6 tools/misc/lomount/lomount.c
--- a/tools/misc/lomount/lomount.c Wed Nov 04 22:32:01 2009 +0000
+++ b/tools/misc/lomount/lomount.c Thu Nov 05 07:41:34 2009 -0700
@@ -34,6 +34,9 @@
  *  bit 7 clear: lomount wrapper ok; mount's return code in low 7 bits
  *  0 success
  */
+
+#define _LARGEFILE_SOURCE
+#define _FILE_OFFSET_BITS 64
 
 enum
 {

_______________________________________________
Xen-devel mailing list
Xen-devel@...
http://lists.xensource.com/xen-devel

lomount.patch (500 bytes) Download Attachment

Re: [PATCH] large file support for lomount (for 32-bit dom0)

by Keir Fraser-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 06/11/2009 16:56, "Dan Magenheimer" <dan.magenheimer@...> wrote:

> Give lomount large file support on a 32-bit dom0 so that
> file images larger than 4GB can be lomount'ed.

tools/misc/lomount/Makefile includes tools/Rules.mk which includes:
ifneq ($(XEN_OS),NetBSD)
# Enable implicit LFS support *and* explicit LFS names.
CFLAGS  += $(shell getconf LFS_CFLAGS)
CFLAGS  += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
LDFLAGS += $(shell getconf LFS_LDFLAGS)
endif

So... lomount is already covered for LFS, and I just confirmed that with an
x86_32 test build. Did you not check that?

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@...
http://lists.xensource.com/xen-devel

RE: [PATCH] large file support for lomount (for 32-bit dom0)

by Dan Magenheimer-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> From: Keir Fraser [mailto:keir.fraser@...]
>
> On 06/11/2009 16:56, "Dan Magenheimer"
> <dan.magenheimer@...> wrote:
>
> > Give lomount large file support on a 32-bit dom0 so that
> > file images larger than 4GB can be lomount'ed.
>
> tools/misc/lomount/Makefile includes tools/Rules.mk which includes:
> ifneq ($(XEN_OS),NetBSD)
> # Enable implicit LFS support *and* explicit LFS names.
> CFLAGS  += $(shell getconf LFS_CFLAGS)
> CFLAGS  += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
> LDFLAGS += $(shell getconf LFS_LDFLAGS)
> endif
>
> So... lomount is already covered for LFS, and I just
> confirmed that with an
> x86_32 test build. Did you not check that?

Hmmm... digging deeper... CONFIG_LOMOUNT isn't enabled
by a default build, so lomount doesn't get built.  Not
finding lomount in the usual places, and knowing that
it is a standalone .c file, I've always built it manually
with a cc command instead of using make.  Oops.

As the Saturday Night Live church lady would say:
"Never mind" :-}  (For those unfamiliar with it:
http://en.wikipedia.org/wiki/Never_mind_(Saturday_Night_Live)

TGIF

_______________________________________________
Xen-devel mailing list
Xen-devel@...
http://lists.xensource.com/xen-devel

Re: [PATCH] large file support for lomount (for 32-bit dom0)

by Keir Fraser-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 06/11/2009 17:33, "Dan Magenheimer" <dan.magenheimer@...> wrote:

>> So... lomount is already covered for LFS, and I just
>> confirmed that with an
>> x86_32 test build. Did you not check that?
>
> Hmmm... digging deeper... CONFIG_LOMOUNT isn't enabled
> by a default build, so lomount doesn't get built.  Not
> finding lomount in the usual places, and knowing that
> it is a standalone .c file, I've always built it manually
> with a cc command instead of using make.  Oops.
>
> As the Saturday Night Live church lady would say:
> "Never mind" :-}  (For those unfamiliar with it:
> http://en.wikipedia.org/wiki/Never_mind_(Saturday_Night_Live)

Easy mistake. :-)

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@...
http://lists.xensource.com/xen-devel

RE: [PATCH] large file support for lomount (for 32-bit dom0)

by Dan Magenheimer-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> On 06/11/2009 17:33, "Dan Magenheimer"
> <dan.magenheimer@...> wrote:
>
> >> So... lomount is already covered for LFS, and I just
> >> confirmed that with an
> >> x86_32 test build. Did you not check that?
> >
> > Hmmm... digging deeper... CONFIG_LOMOUNT isn't enabled
> > by a default build, so lomount doesn't get built.  Not
> > finding lomount in the usual places, and knowing that
> > it is a standalone .c file, I've always built it manually
> > with a cc command instead of using make.  Oops.
> >
> > As the Saturday Night Live church lady would say:
> > "Never mind" :-}  (For those unfamiliar with it:
> > http://en.wikipedia.org/wiki/Never_mind_(Saturday_Night_Live)
>
> Easy mistake. :-)
>
>  -- Keir

Just out of interest, what is the reason that CONFIG_LOMOUNT
is not enabled?  Are there known environments (SUSE?) where
it would break the build?

Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@...
http://lists.xensource.com/xen-devel

Re: [PATCH] large file support for lomount (for 32-bit dom0)

by Keir Fraser-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 06/11/2009 20:18, "Dan Magenheimer" <dan.magenheimer@...> wrote:

>>> As the Saturday Night Live church lady would say:
>>> "Never mind" :-}  (For those unfamiliar with it:
>>> http://en.wikipedia.org/wiki/Never_mind_(Saturday_Night_Live)
>>
>> Easy mistake. :-)
>>
>>  -- Keir
>
> Just out of interest, what is the reason that CONFIG_LOMOUNT
> is not enabled?  Are there known environments (SUSE?) where
> it would break the build?

Not very Xen-specific tool with not very Xen-specific name, which I guess
may also already be installed in some distros? I'm also not sure how
generally useful it is to users at large. Overall I'm not certain, as I
don't think I added the tool to the tree, nor decided our policy for
building it.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@...
http://lists.xensource.com/xen-devel

RE: [PATCH] large file support for lomount (for 32-bit dom0)

by Dan Magenheimer-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> On 06/11/2009 20:18, "Dan Magenheimer"
> <dan.magenheimer@...> wrote:
>
> >>> As the Saturday Night Live church lady would say:
> >>> "Never mind" :-}  (For those unfamiliar with it:
> >>> http://en.wikipedia.org/wiki/Never_mind_(Saturday_Night_Live)
> >>
> >> Easy mistake. :-)
> >>
> >>  -- Keir
> >
> > Just out of interest, what is the reason that CONFIG_LOMOUNT
> > is not enabled?  Are there known environments (SUSE?) where
> > it would break the build?
>
> Not very Xen-specific tool with not very Xen-specific name,
> which I guess
> may also already be installed in some distros? I'm also not sure how
> generally useful it is to users at large. Overall I'm not
> certain, as I
> don't think I added the tool to the tree, nor decided our policy for
> building it.
>
>  -- Keir

Well googling for "lomount" yields a lot of people looking
for it, and this site:

http://www.mail-archive.com/gentoo-user@.../msg70745.html

says:

  "According to this very useful site:

   http://www.portagefilelist.de/index.php/Special:PFLQuery

   the only package that provides lomount is xen. Which seems odd."

Since it is very helpful for recovering from an update to
an in-guest kernel (which is often useful in xen development
but probably also periodically useful to support xen distros), I'd
propose that CONFIG_LOMOUNT get turned on by default in Config.mk.
If we get complaints, it's easy enough to turn it back off later.

_______________________________________________
Xen-devel mailing list
Xen-devel@...
http://lists.xensource.com/xen-devel

Re: [PATCH] large file support for lomount (for 32-bit dom0)

by Keir Fraser-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 06/11/2009 21:56, "Dan Magenheimer" <dan.magenheimer@...> wrote:

> Since it is very helpful for recovering from an update to
> an in-guest kernel (which is often useful in xen development
> but probably also periodically useful to support xen distros), I'd
> propose that CONFIG_LOMOUNT get turned on by default in Config.mk.
> If we get complaints, it's easy enough to turn it back off later.

Another point is that it's almost certainly Linux-specific; at least the bit
that sets up the loopback mount. We could perhaps just get rid of
CONFIG_LOMOUNT and unconditionally build lomount on Linux only.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@...
http://lists.xensource.com/xen-devel

Re: [PATCH] large file support for lomount (for 32-bit dom0)

by Keir Fraser-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 06/11/2009 22:11, "Keir Fraser" <keir.fraser@...> wrote:

>> Since it is very helpful for recovering from an update to
>> an in-guest kernel (which is often useful in xen development
>> but probably also periodically useful to support xen distros), I'd
>> propose that CONFIG_LOMOUNT get turned on by default in Config.mk.
>> If we get complaints, it's easy enough to turn it back off later.
>
> Another point is that it's almost certainly Linux-specific; at least the bit
> that sets up the loopback mount. We could perhaps just get rid of
> CONFIG_LOMOUNT and unconditionally build lomount on Linux only.

Ah, now I see lomount was disabled by default in c/s 16742, which was by Ian
Jackson and has a detailed changeset comment. It seems he thinks there are
fine alternatives to lomount these days.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@...
http://lists.xensource.com/xen-devel

RE: [PATCH] large file support for lomount (for 32-bit dom0)

by Dan Magenheimer-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> On 06/11/2009 22:11, "Keir Fraser" <keir.fraser@...> wrote:
>
> >> Since it is very helpful for recovering from an update to
> >> an in-guest kernel (which is often useful in xen development
> >> but probably also periodically useful to support xen distros), I'd
> >> propose that CONFIG_LOMOUNT get turned on by default in Config.mk.
> >> If we get complaints, it's easy enough to turn it back off later.
> >
> > Another point is that it's almost certainly Linux-specific;
> at least the bit
> > that sets up the loopback mount. We could perhaps just get rid of
> > CONFIG_LOMOUNT and unconditionally build lomount on Linux only.
>
> Ah, now I see lomount was disabled by default in c/s 16742,
> which was by Ian
> Jackson and has a detailed changeset comment. It seems he
> thinks there are
> fine alternatives to lomount these days.

Well perhaps it is 22 months too late to argue the point but
that never stopped me:

Lomount is:
1) Documented in xen books
2) The answer to MANY "how do I..." questions posted
   on many web pages (including vendor support sites).
3) Far simpler than the alternative obscure and complex
   sequence of arcane magic commands that only a filesystem
   expert is able to remember or safely use.
4) Very useful for dev activities where multiple kernels
   are being tested within a single VM.

Now clearly I can enable it whenever I install a
clean version of Xen.  I can also probably enable it
for every future Oracle VM distro release (though it's
too late for our recent 3.4-based release now).

But isn't this just another case of ultra-alpha-developers
making it as difficult as possible for mortal developers
to contribute to Xen?  Surely it should be fine to
enable it for the xen-unstable tree?

Time for a weekend... :-)

_______________________________________________
Xen-devel mailing list
Xen-devel@...
http://lists.xensource.com/xen-devel

Re: [PATCH] large file support for lomount (for 32-bit dom0)

by Ian Jackson-11 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Keir Fraser writes ("Re: [Xen-devel] [PATCH] large file support for lomount (for 32-bit dom0)"):
> Ah, now I see lomount was disabled by default in c/s 16742, which was by Ian
> Jackson and has a detailed changeset comment. It seems he thinks there are
> fine alternatives to lomount these days.

It's quite possible that although the alternatives to lomount work
better, they are less easy to use for a naive command line user.

If something with a better UI than kpartx is needed, a simple shell
script wrapper should be easy to write.  I'd be happy to review such a
thing if someone would care to write it.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@...
http://lists.xensource.com/xen-devel