Commit c747cd1fa26d1ed0cc009302fb9c75a8f03651e2

Authored by bellard
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
... ... @@ -533,6 +533,12 @@ static int raw_open(BlockDriverState *bs, const char *filename)
533 533 bs->read_only = 1;
534 534 }
535 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 542 bs->total_sectors = size / 512;
537 543 s->fd = fd;
538 544 return 0;
... ...