Commit c747cd1fa26d1ed0cc009302fb9c75a8f03651e2
1 parent
11650e36
raw CDROM access for windows (Filip Navara)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1411 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
6 additions
and
0 deletions
block.c
| @@ -533,6 +533,12 @@ static int raw_open(BlockDriverState *bs, const char *filename) | @@ -533,6 +533,12 @@ static int raw_open(BlockDriverState *bs, const char *filename) | ||
| 533 | bs->read_only = 1; | 533 | bs->read_only = 1; |
| 534 | } | 534 | } |
| 535 | size = lseek(fd, 0, SEEK_END); | 535 | size = lseek(fd, 0, SEEK_END); |
| 536 | +#ifdef _WIN32 | ||
| 537 | + /* On Windows hosts it can happen that we're unable to get file size | ||
| 538 | + for CD-ROM raw device (it's inherent limitation of the CDFS driver). */ | ||
| 539 | + if (size == -1) | ||
| 540 | + size = LONG_LONG_MAX; | ||
| 541 | +#endif | ||
| 536 | bs->total_sectors = size / 512; | 542 | bs->total_sectors = size / 512; |
| 537 | s->fd = fd; | 543 | s->fd = fd; |
| 538 | return 0; | 544 | return 0; |