Bug: When HD image file is stored on a distributed filesystem, if fails to load because st_rdev is non-zero and (incorrectly) perceived by bochs to be an special device file.
Fix: When loading an image file, consult st_mode rather than st_rdev to determine if the file is a block device.
Patch:
--- bochs-20150710/iodev/hdimage/hdimage.cc 2015-03-29 10:27:32.000000000 -0400 +++ bochs-fixed/iodev/hdimage/hdimage.cc 2015-07-13 12:43:34.041858670 -0400 @@ -49,10 +49,11 @@ #endif #ifdef linux #include <linux/fs.h> #include <sys/ioctl.h> #include <sys/wait.h> +#include <fcntl.h> #endif #define LOG_THIS theHDImageCtl-> #ifndef BXIMAGE @@ -221,11 +222,11 @@ if (fstat(fd, &stat_buf)) { BX_PANIC(("fstat() returns error!")); return -1; } #ifdef linux - if (stat_buf.st_rdev) { // Is this a special device file (e.g. /dev/sde) ? + if (S_ISBLK(stat_buf.st_mode)) { // Is this a special device file (e.g. /dev/sde) ? ioctl(fd, BLKGETSIZE64, fsize); // yes it's! } else #endif
Fixed in SVN now.