diff options
author | nork <nork@FreeBSD.org> | 2004-11-04 22:26:08 +0800 |
---|---|---|
committer | nork <nork@FreeBSD.org> | 2004-11-04 22:26:08 +0800 |
commit | 6a5c4424e58c7aea1e338d7b346855c7db671fa4 (patch) | |
tree | 54ec9aa73246db746f76fc1ac0b11d65fcb0387a /emulators/qemu-devel | |
parent | 1864ee9521862fe20d3df78ee049125e48cc6eeb (diff) | |
download | freebsd-ports-graphics-6a5c4424e58c7aea1e338d7b346855c7db671fa4.tar.gz freebsd-ports-graphics-6a5c4424e58c7aea1e338d7b346855c7db671fa4.tar.zst freebsd-ports-graphics-6a5c4424e58c7aea1e338d7b346855c7db671fa4.zip |
Add support raw disk device access.
Submitted by: Juergen Lock <nox@jelal.kn-bremen.de> (maintainer)
Diffstat (limited to 'emulators/qemu-devel')
-rw-r--r-- | emulators/qemu-devel/Makefile | 2 | ||||
-rw-r--r-- | emulators/qemu-devel/files/patch-block.c | 36 |
2 files changed, 37 insertions, 1 deletions
diff --git a/emulators/qemu-devel/Makefile b/emulators/qemu-devel/Makefile index 68d83f91cf9..31015da3dab 100644 --- a/emulators/qemu-devel/Makefile +++ b/emulators/qemu-devel/Makefile @@ -7,7 +7,7 @@ PORTNAME= qemu PORTVERSION= 0.6.0s.20041020 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= emulators MASTER_SITES= http://www.fuqn.ca/distfiles/ \ http://dad-answers.com/qemu/ diff --git a/emulators/qemu-devel/files/patch-block.c b/emulators/qemu-devel/files/patch-block.c new file mode 100644 index 00000000000..d174d8f96e2 --- /dev/null +++ b/emulators/qemu-devel/files/patch-block.c @@ -0,0 +1,36 @@ +--- qemu/block.c.orig Thu Sep 30 06:27:57 2004 ++++ qemu/block.c Thu Nov 4 23:19:37 2004 +@@ -21,6 +21,17 @@ + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ ++ ++#include "config-host.h" ++ ++#ifdef _BSD ++#include <sys/types.h> ++#include <sys/stat.h> ++#include <sys/ioctl.h> ++#include <sys/queue.h> ++#include <sys/disk.h> ++#endif ++ + #include "vl.h" + #include "block_int.h" + +@@ -522,6 +533,15 @@ + return -1; + bs->read_only = 1; + } ++#ifdef _BSD ++ struct stat sb; ++ if (!fstat(fd,&sb) && (S_IFCHR & sb.st_mode)) { ++#ifdef DIOCGMEDIASIZE ++ if (ioctl(fd, DIOCGMEDIASIZE, (off_t *)&size)) ++#endif ++ size = lseek(fd, 0LL, SEEK_END); ++ } else ++#endif + size = lseek(fd, 0, SEEK_END); + bs->total_sectors = size / 512; + s->fd = fd; |