[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC] introduce a dynamic library to expose qemu block

From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [RFC] introduce a dynamic library to expose qemu block API
Date: Wed, 18 Jul 2012 10:41:30 +0100

On Wed, Jul 18, 2012 at 9:51 AM, Wenchao Xia <address@hidden> wrote:
> /* sync access */
> int qbdrvs_read(BlockDriverState *bs, int64_t sector_num,
>               uint8_t *buf, int nb_sectors);
> int qbdrvs_write(BlockDriverState *bs, int64_t sector_num,
>                const uint8_t *buf, int nb_sectors);

Whether to provide sync and/or async access is a key question.

Synchronous APIs are great for writing dedicated tools like dd, cp,
convert, etc.

Asynchronous APIs are essential for integrating image file I/O into
event-driven programs like libvirt.  Here, the ability to do other
things while image file I/O is in progress is a requirement.  It may
also be necessary to cancel or timeout if an operation is not making
progress or the user decides to stop it.

I think we need to provide both sync and async.  Libraries like
libssh2 and libcurl already do this so their APIs can be used as a
starting point for async I/O.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]