From: Anthony Liguori <anthony@codemonkey.ws>
To: Avi Kivity <avi@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH 3/3] Drop internal bdrv_pread()/bdrv_pwrite() APIs
Date: Sun, 08 Feb 2009 13:10:22 -0600 [thread overview]
Message-ID: <498F2E1E.8030605@codemonkey.ws> (raw)
In-Reply-To: <1234115947-31622-4-git-send-email-avi@redhat.com>
Avi Kivity wrote:
> Now that scsi generic no longer uses bdrv_pread() and bdrv_pwrite(), we can
> drop the corresponding internal APIs, which overlap bdrv_read()/bdrv_write()
> and, being byte oriented, are unnatural for a block device.
>
> Signed-off-by: Avi Kivity <avi@redhat.com>
>
> int bdrv_truncate(BlockDriverState *bs, int64_t offset)
> diff --git a/block_int.h b/block_int.h
> index e4630f0..cc9966b 100644
> --- a/block_int.h
> +++ b/block_int.h
> @@ -58,10 +58,6 @@ struct BlockDriver {
> int aiocb_size;
>
> const char *protocol_name;
> - int (*bdrv_pread)(BlockDriverState *bs, int64_t offset,
> - uint8_t *buf, int count);
> - int (*bdrv_pwrite)(BlockDriverState *bs, int64_t offset,
> - const uint8_t *buf, int count);
>
$ grep -l bdrv_pwrite *.c hw/*.c
block.c
block-qcow2.c
block-qcow.c
block-raw-posix.c
block-raw-win32.c
block-vmdk.c
block-vpc.c
savevm.c
hw/scsi-generic.c
So there's a lot of users other than scsi-generic. Usually, these
callers are in the block layer to read/write metadata that isn't always
block aligned. Some buffer adjustment could fix savevm.c to ensure
alignment.
These users are now relegated to using emulated pread/pwrite? Won't
that have a noticable impact on performance if updating small bits of
metadata. For instance, I think updating qcow2 refcounts would look bad
since you have to read/write the full block to update 4 bytes of data.
Granted it'll be cached, but...
Regards,
Anthony Liguori
> int (*bdrv_truncate)(BlockDriverState *bs, int64_t offset);
> int64_t (*bdrv_getlength)(BlockDriverState *bs);
> int (*bdrv_write_compressed)(BlockDriverState *bs, int64_t sector_num,
>
next prev parent reply other threads:[~2009-02-08 19:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-08 17:59 [Qemu-devel] [PATCH 0/3] Remove ->bdrv_pread() internal block layer API Avi Kivity
2009-02-08 17:59 ` [Qemu-devel] [PATCH 1/3] Add specialized block driver scsi generic API Avi Kivity
2009-02-08 17:59 ` [Qemu-devel] [PATCH 2/3] Add internal scsi generic block API Avi Kivity
2009-02-08 17:59 ` [Qemu-devel] [PATCH 3/3] Drop internal bdrv_pread()/bdrv_pwrite() APIs Avi Kivity
2009-02-08 19:10 ` Anthony Liguori [this message]
2009-02-08 19:36 ` [Qemu-devel] " Avi Kivity
2009-02-08 19:37 ` Avi Kivity
2009-02-08 19:05 ` [Qemu-devel] Re: [PATCH 0/3] Remove ->bdrv_pread() internal block layer API Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=498F2E1E.8030605@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=avi@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.