aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2007-11-11 02:51:17 +0000
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2007-11-11 02:51:17 +0000
commitfaf07963cb03f98d52ca1f7fde7482a3cb309bcc (patch)
tree77b5f598c4492fde2093dab3bca77b69e03c6654 /block.c
parent28c5af54c661e73e5596918fa67a22b5e87c2022 (diff)
downloadqemu-faf07963cb03f98d52ca1f7fde7482a3cb309bcc.zip
qemu-faf07963cb03f98d52ca1f7fde7482a3cb309bcc.tar.gz
qemu-faf07963cb03f98d52ca1f7fde7482a3cb309bcc.tar.bz2
Split block API from vl.h.
Remove QEMU_TOOL. Replace with QEMU_IMG and NEED_CPU_H. Avoid linking qemu-img against whole system emulatior. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3578 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'block.c')
-rw-r--r--block.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/block.c b/block.c
index 3c70399..1cb943b 100644
--- a/block.c
+++ b/block.c
@@ -21,7 +21,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+#ifdef QEMU_IMG
+#include "qemu-common.h"
+#else
#include "vl.h"
+#endif
#include "block_int.h"
#ifdef _BSD
@@ -53,7 +57,7 @@ static int bdrv_read_em(BlockDriverState *bs, int64_t sector_num,
static int bdrv_write_em(BlockDriverState *bs, int64_t sector_num,
const uint8_t *buf, int nb_sectors);
-static BlockDriverState *bdrv_first;
+BlockDriverState *bdrv_first;
static BlockDriver *first_drv;
int path_is_absolute(const char *path)
@@ -859,6 +863,7 @@ void bdrv_flush(BlockDriverState *bs)
bdrv_flush(bs->backing_hd);
}
+#ifndef QEMU_IMG
void bdrv_info(void)
{
BlockDriverState *bs;
@@ -898,6 +903,7 @@ void bdrv_info(void)
term_printf("\n");
}
}
+#endif
void bdrv_get_backing_filename(BlockDriverState *bs,
char *filename, int filename_size)
@@ -1102,7 +1108,7 @@ void bdrv_aio_cancel(BlockDriverAIOCB *acb)
/**************************************************************/
/* async block device emulation */
-#ifdef QEMU_TOOL
+#ifdef QEMU_IMG
static BlockDriverAIOCB *bdrv_aio_read_em(BlockDriverState *bs,
int64_t sector_num, uint8_t *buf, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque)
@@ -1172,7 +1178,7 @@ static void bdrv_aio_cancel_em(BlockDriverAIOCB *blockacb)
qemu_bh_cancel(acb->bh);
qemu_aio_release(acb);
}
-#endif /* !QEMU_TOOL */
+#endif /* !QEMU_IMG */
/**************************************************************/
/* sync block device emulation */