| |
Changeset 62
- Timestamp:
- 02/06/07 03:15:09
(2 years ago)
- Author:
- mike
- Message:
[new] hd aio LED support
[fix] hd/cdrom synchronous LED support
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r61 |
r62 |
|
| | 1 | Q-0.9.0d62 |
|---|
| | 2 | [new] hd aio LED support |
|---|
| | 3 | [fix] hd/cdrom synchronous LED support |
|---|
| | 4 | |
|---|
| 1 | 5 | Q-0.9.0d61 |
|---|
| 2 | 6 | [new] support for VM snapshots |
|---|
| r35 |
r62 |
|
| 2 | 2 | * QEMU Cocoa CpuView |
|---|
| 3 | 3 | * |
|---|
| 4 | | * Copyright (c) 2005, 2006 Mike Kronenberg |
|---|
| | 4 | * Copyright (c) 2005 - 2007 Mike Kronenberg |
|---|
| 5 | 5 | * |
|---|
| 6 | 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
|---|
| … | … | |
| 24 | 24 | |
|---|
| 25 | 25 | #import "cocoaCpuView.h" |
|---|
| 26 | | #import "vl.h" |
|---|
| | 26 | #import "../vl.h" |
|---|
| | 27 | #import "../block_int.h" |
|---|
| 27 | 28 | |
|---|
| 28 | 29 | #include <mach/mach.h> |
|---|
| … | … | |
| 34 | 35 | #include <mach/mach_init.h> |
|---|
| 35 | 36 | |
|---|
| 36 | | struct BlockDriverState { |
|---|
| 37 | | int64_t total_sectors; |
|---|
| 38 | | int read_only; /* if true, the media is read only */ |
|---|
| 39 | | int inserted; /* if true, the media is present */ |
|---|
| 40 | | int removable; /* if true, the media can be removed */ |
|---|
| 41 | | int locked; /* if true, the media cannot temporarily be ejected */ |
|---|
| 42 | | int encrypted; /* if true, the media is encrypted */ |
|---|
| 43 | | int activityLED; /* if true, the media is accessed atm */ |
|---|
| 44 | | /* event callback when inserting/removing */ |
|---|
| 45 | | void (*change_cb)(void *opaque); |
|---|
| 46 | | void *change_opaque; |
|---|
| 47 | | |
|---|
| 48 | | BlockDriver *drv; |
|---|
| 49 | | void *opaque; |
|---|
| 50 | | |
|---|
| 51 | | int boot_sector_enabled; |
|---|
| 52 | | uint8_t boot_sector_data[512]; |
|---|
| 53 | | |
|---|
| 54 | | char filename[1024]; |
|---|
| 55 | | char backing_file[1024]; /* if non zero, the image is a diff of |
|---|
| 56 | | this file image */ |
|---|
| 57 | | int is_temporary; |
|---|
| 58 | | |
|---|
| 59 | | BlockDriverState *backing_hd; |
|---|
| 60 | | |
|---|
| 61 | | /* NOTE: the following infos are only hints for real hardware |
|---|
| 62 | | drivers. They are not used by the block driver */ |
|---|
| 63 | | int cyls, heads, secs, translation; |
|---|
| 64 | | int type; |
|---|
| 65 | | char device_name[32]; |
|---|
| 66 | | BlockDriverState *next; |
|---|
| 67 | | }; |
|---|
| | 37 | |
|---|
| 68 | 38 | |
|---|
| 69 | 39 | @implementation cocoaCpuView |
|---|
| r61 |
r62 |
|
| 1 | | --- block.c 2006-06-21 18:46:53.000000000 +0200 |
|---|
| 2 | | +++ block2.c 2006-07-04 01:43:59.000000000 +0200 |
|---|
| 3 | | @@ -420,6 +420,8 @@ |
|---|
| | 1 | --- block.c 2007-02-06 02:15:39.000000000 +0100 |
|---|
| | 2 | +++ block2.c 2007-02-06 02:24:10.000000000 +0100 |
|---|
| | 3 | @@ -497,6 +497,7 @@ |
|---|
| | 4 | int bdrv_read(BlockDriverState *bs, int64_t sector_num, |
|---|
| | 5 | uint8_t *buf, int nb_sectors) |
|---|
| | 6 | { |
|---|
| | 7 | + bs->activityLED = 1; |
|---|
| | 8 | BlockDriver *drv = bs->drv; |
|---|
| 4 | 9 | |
|---|
| 5 | 10 | if (!drv) |
|---|
| 6 | | return -ENOMEDIUM; |
|---|
| 7 | | + |
|---|
| 8 | | + bs->activityLED = 1; |
|---|
| 9 | | |
|---|
| 10 | | if (sector_num == 0 && bs->boot_sector_enabled && nb_sectors > 0) { |
|---|
| 11 | | memcpy(buf, bs->boot_sector_data, 512); |
|---|
| 12 | | @@ -454,6 +456,7 @@ |
|---|
| | 11 | @@ -534,6 +535,7 @@ |
|---|
| 13 | 12 | int bdrv_write(BlockDriverState *bs, int64_t sector_num, |
|---|
| 14 | 13 | const uint8_t *buf, int nb_sectors) |
|---|
| … | … | |
| 18 | 17 | if (!bs->drv) |
|---|
| 19 | 18 | return -ENOMEDIUM; |
|---|
| | 19 | @@ -1058,6 +1060,7 @@ |
|---|
| | 20 | uint8_t *buf, int nb_sectors, |
|---|
| | 21 | BlockDriverCompletionFunc *cb, void *opaque) |
|---|
| | 22 | { |
|---|
| | 23 | + bs->activityLED = 1; |
|---|
| | 24 | BlockDriver *drv = bs->drv; |
|---|
| | 25 | |
|---|
| | 26 | if (!drv) |
|---|
| | 27 | @@ -1078,6 +1081,7 @@ |
|---|
| | 28 | const uint8_t *buf, int nb_sectors, |
|---|
| | 29 | BlockDriverCompletionFunc *cb, void *opaque) |
|---|
| | 30 | { |
|---|
| | 31 | + bs->activityLED = 1; |
|---|
| | 32 | BlockDriver *drv = bs->drv; |
|---|
| | 33 | |
|---|
| | 34 | if (!drv) |
|---|
Download in other formats:
| |