linux-um archives
 help / color / mirror / Atom feed
* [uml-devel] uml_moo
@ 2005-01-15 10:45 stian
  2005-03-06 19:16 ` Blaisorblade
  0 siblings, 1 reply; 3+ messages in thread
From: stian @ 2005-01-15 10:45 UTC (permalink / raw)
  To: user-mode-linux-devel

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. Also I see that it is
compiled with 64bit file support, but shouldn't you define _GNU_SOURCE as
well? 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.


Stian


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [uml-devel] uml_moo
  2005-01-15 10:45 [uml-devel] uml_moo stian
@ 2005-03-06 19:16 ` Blaisorblade
  2005-03-12  3:08   ` Jeff Dike
  0 siblings, 1 reply; 3+ messages in thread
From: Blaisorblade @ 2005-03-06 19:16 UTC (permalink / raw)
  To: user-mode-linux-devel, Jeff Dike; +Cc: stian, Gigie Lertriniva

[-- Attachment #1: Type: text/plain, Size: 1100 bytes --]

On Saturday 15 January 2005 11:45, stian@nixia.no 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

[-- Attachment #2: moo-little-fixes.patch --]
[-- Type: text/x-diff, Size: 1786 bytes --]



Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
---

 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);
 	}
_

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [uml-devel] uml_moo
  2005-03-06 19:16 ` Blaisorblade
@ 2005-03-12  3:08   ` Jeff Dike
  0 siblings, 0 replies; 3+ messages in thread
From: Jeff Dike @ 2005-03-12  3:08 UTC (permalink / raw)
  To: Blaisorblade; +Cc: user-mode-linux-devel, stian, Gigie Lertriniva

blaisorblade@yahoo.it said:
> Try the patch. 

Just merged it, thanks.

			Jeff



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-03-12  2:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-15 10:45 [uml-devel] uml_moo stian
2005-03-06 19:16 ` Blaisorblade
2005-03-12  3:08   ` Jeff Dike

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox