I just saw Fabrice did commit a slightly changed version of the BSD block.c patch, but its a bit broken (imbalanced brackets). Here's a fix:
Index: block.c =================================================================== RCS file: /cvsroot/qemu/qemu/block.c,v retrieving revision 1.19 diff -u -r1.19 block.c --- block.c 26 Apr 2005 21:59:26 -0000 1.19 +++ block.c 27 Apr 2005 17:04:23 -0000 @@ -548,6 +548,9 @@ BDRVRawState *s = bs->opaque; int fd; int64_t size; +#ifdef _BSD + struct stat sb; +#endif fd = open(filename, O_RDWR | O_BINARY | O_LARGEFILE); if (fd < 0) { @@ -557,13 +560,11 @@ bs->read_only = 1; } #ifdef _BSD - { - struct stat sb; - if (!fstat(fd, &sb) && (S_IFCHR & sb.st_mode)) { + if (!fstat(fd, &sb) && (S_IFCHR & sb.st_mode)) { #ifdef DIOCGMEDIASIZE - if (ioctl(fd, DIOCGMEDIASIZE, (off_t *)&size)) + if (ioctl(fd, DIOCGMEDIASIZE, (off_t *)&size)) #endif - size = lseek(fd, 0LL, SEEK_END); + size = lseek(fd, 0LL, SEEK_END); } else #endif { _______________________________________________ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel