On Saturday 15 January 2005 11:45, [EMAIL PROTECTED] wrote: > I have one issue with uml_moo. > > uml_moo and the kernel cow drivers doesn't seem to use the same method > when calculating the size of the backing file. > > I used /dev/hdc1 which was an block device (147 GB partition) > > uml kernel perfectely finds the correct size. uml_moo uses stat on the > device which gives size 0, og uml_moo fails. Try the patch. > Also I see that it is > compiled with 64bit file support, but shouldn't you define _GNU_SOURCE as > well? Well, it works, and no idea. Did you notice _XOPEN_SOURCE defined in moo/uml_moo.c? I'm in a hurry so I'm not checking the exact various situations. > Since off_t didn't need %lld in the printf, but %ld as the > source-code now uses which is 32bit on i386 atleast. The last thingy was > just a question. Where? > > Stian Somebody also complained about wrong text messages (no version 3 support is declared in the help). So I'm working also on the above.
-- Paolo Giarrusso, aka Blaisorblade Linux registered user n. 292729 http://www.user-mode-linux.org/~blaisorblade
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <[EMAIL PROTECTED]> --- tools-paolo/moo/cow.c | 2 +- tools-paolo/moo/cow_sys.h | 4 ++-- tools-paolo/moo/uml_moo.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff -puN moo/cow.c~moo-little-fixes moo/cow.c --- tools/moo/cow.c~moo-little-fixes 2005-03-06 19:42:38.580011064 +0100 +++ tools-paolo/moo/cow.c 2005-03-06 19:43:41.456452392 +0100 @@ -298,7 +298,7 @@ int read_cow_header(int (*reader)(__u64, } else if(version == 3){ if(n < sizeof(header->v3)){ - cow_printf("read_cow_header - failed to read V2 " + cow_printf("read_cow_header - failed to read V3 " "header\n"); goto out; } diff -puN moo/uml_moo.c~moo-little-fixes moo/uml_moo.c --- tools/moo/uml_moo.c~moo-little-fixes 2005-03-06 19:44:34.553380432 +0100 +++ tools-paolo/moo/uml_moo.c 2005-03-06 19:44:45.431726672 +0100 @@ -203,7 +203,7 @@ static char *usage_string = "its current backing file\n" "Specifying -b overrides the backing_file specified in the COW file. This is\n" "needed when dealing with a COW file that was created inside a chroot jail.\n" -"%s supports version 1 and 2 COW files.\n" +"%s supports version 1,2 and 3 COW files.\n" ""; static int Usage(char *prog) { diff -puN moo/cow_sys.h~moo-little-fixes moo/cow_sys.h --- tools/moo/cow_sys.h~moo-little-fixes 2005-03-06 20:08:18.120965264 +0100 +++ tools-paolo/moo/cow_sys.h 2005-03-06 20:08:20.556594992 +0100 @@ -48,9 +48,9 @@ static inline int cow_seek_file(int fd, static inline int cow_file_size(char *file, long long *size_out) { - struct stat buf; + struct stat64 buf; - if(stat(file, &buf) == -1){ + if (stat64(file, &buf) == -1) { cow_printf("Couldn't stat \"%s\" : errno = %d\n", file, errno); return(-errno); } _