mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00
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
This commit is contained in:
parent
28c5af54c6
commit
faf07963cb
21 changed files with 307 additions and 271 deletions
12
block.c
12
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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue