Skip to contentSkip to conversation

large file support for lomount (for 32-bit dom0)

PATCH In review Dan Magenheimer 3 participants 11 messages Nov 6, 2009 – Nov 9, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 large file support for lomount (for 32-bit dom0)

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

tools/misc/lomount/lomount.c +3 -0
diff -r 23b43708aad6 tools/misc/lomount/lomount.c
@@ -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
 {
tools/misc/lomount/lomount.c +3 -0
diff -r 23b43708aad6 tools/misc/lomount/lomount.c
@@ -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
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 2 lines · Dan Magenheimer

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

#2 lore raw
Quoted 16 lines

From: Keir Fraser [mailto:[email protected]]

Quoted 2 lines · Dan Magenheimer

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

Quoted 3 lines

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

#3 lore raw
Quoted 10 lines · Dan Magenheimer
Quoted 3 lines

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.

Quoted 3 lines

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

#4 lore raw
Quoted 13 lines
Quoted 10 lines · Dan Magenheimer
Quoted 3 lines

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.

Quoted 7 lines
Quoted 3 lines

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

#5 lore raw
Quoted 11 lines · Dan Magenheimer
Quoted 7 lines
Quoted 3 lines

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

#6 lore raw
Quoted 23 lines
Quoted 11 lines · Dan Magenheimer
Quoted 7 lines
Quoted 3 lines

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.

Quoted 1 line

-- Keir

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

http://www.mail-archive.com/[email protected]/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.

#7 lore raw
Quoted 5 lines · Dan Magenheimer

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

#8 lore raw
Quoted 9 lines · Keir Fraser
Quoted 5 lines

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

#9 lore raw
Quoted 10 lines · Keir Fraser
Quoted 8 lines
Quoted 6 lines

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

Quoted 8 lines
Quoted 2 lines

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... :-)

#10 lore raw
In reply to Keir Fraser

Keir Fraser writes ("Re: [Xen-devel] [PATCH] large file support for lomount (for 32-bit dom0)"):

Quoted 3 lines

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.