qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] some confusion on qemu i/o pocess and the qcow2 format
@ 2015-11-20  3:21 =?gb18030?B?usa3rrCh?=
  2015-11-25  9:44 ` Stefan Hajnoczi
  0 siblings, 1 reply; 5+ messages in thread
From: =?gb18030?B?usa3rrCh?= @ 2015-11-20  3:21 UTC (permalink / raw)
  To: =?gb18030?B?cWVtdS1kZXZlbA==?=

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb18030", Size: 207 bytes --]

1.what is the difference of bdrv_co_readv and bdrv_aio_readv£¿
2.I am confused about the I/O pocess of qcow2, i find. Can anybody tell me the detail pocess? or arethere any useful tools to trace the pocess?

[-- Attachment #2: Type: text/html, Size: 232 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] some confusion on qemu i/o pocess and the qcow2 format
  2015-11-20  3:21 [Qemu-devel] some confusion on qemu i/o pocess and the qcow2 format =?gb18030?B?usa3rrCh?=
@ 2015-11-25  9:44 ` Stefan Hajnoczi
       [not found]   ` <tencent_04C6AF085D5F3396311ECC83@qq.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Hajnoczi @ 2015-11-25  9:44 UTC (permalink / raw)
  To: 浩樊啊; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1031 bytes --]

On Fri, Nov 20, 2015 at 11:21:14AM +0800, 浩樊啊 wrote:
> 1.what is the difference of bdrv_co_readv and bdrv_aio_readv?

bdrv_aio_readv() takes a callback function pointer and returns a request
struct.  The callback will be invoked when the request has completed.

bdrv_co_readv() must be called from coroutine context.  It performs the
request and then returns.  This is similar to traditional preadv(2)
except the coroutine will yield back to the QEMU event loop instead of
blocking the thread.

Please take a look at include/qemu/coroutine.h if you'd like to learn
more about coroutines.

I have also written about coroutines here:
http://blog.vmsplice.net/2014/01/coroutines-in-qemu-basics.html

> 2.I am confused about the I/O pocess of qcow2, i find. Can anybody tell me the detail pocess? or arethere any useful tools to trace the pocess?

Unless you have more specific questions, the only advice I can give is
to read the source code and/or add printfs to help you understand the
code execution.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] 回复:  some confusion on qemu i/o pocess and the qcow2format
       [not found]   ` <tencent_04C6AF085D5F3396311ECC83@qq.com>
@ 2015-12-02 13:29     ` Stefan Hajnoczi
  2015-12-21  2:48       ` [Qemu-devel] =?gb18030?b?u9i4tKO6ICC72Li0o7ogIHNvbWVjb25mdXNpb24g?= =?gb18030?q?on_qemu_i/o_pocess_and_the_qcow2format?= =?gb18030?B?usa3rrCh?=
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Hajnoczi @ 2015-12-02 13:29 UTC (permalink / raw)
  To: 浩樊啊; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 878 bytes --]

On Tue, Dec 01, 2015 at 03:14:14PM +0800, 浩樊啊 wrote:
> I read the source code of qcow2.
> I can see   bdrv_co_do_readv---bdrv_co_do_preadv---bdrv_aligned_preadv---drv->bdrv_co_readv (here drv.bdrv_co_readv=qcow2_co_readv)
> but when I read qcow2_co_readv->bdrv_co_readv->bdrv_co_do_readv->bdrv_co_do_preadv
> I am confused about this. qcow2_co_readv use bdrv_co_do_preadv again?

The qcow2 BlockDriverState uses a file BlockDriverState to do the actual
I/O.  This way the qcow2 image format can be used on POSIX files, iSCSI
LUNs, Gluster files, etc.

It means that qcow2 code does not call preadv(2)/pwritev(2) directly but
instead uses another BlockDriverState to perform the actual I/O.  In
QEMU we keep "image format" block drivers (e.g. qcow2, vmdk, vhdx)
separate from "protocol" block drivers (e.g. POSIX, Win32, Gluster,
Sheepdog, iSCSI).

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] =?gb18030?b?u9i4tKO6ICC72Li0o7ogIHNvbWVjb25mdXNpb24g?= =?gb18030?q?on_qemu_i/o_pocess_and_the_qcow2format?=
  2015-12-02 13:29     ` [Qemu-devel] 回复: some confusion on qemu i/o pocess and the qcow2format Stefan Hajnoczi
@ 2015-12-21  2:48       ` =?gb18030?B?usa3rrCh?=
  2015-12-22  6:35         ` [Qemu-devel] 回复: 回复: someconfusion on qemu i/o pocess and the qcow2format Stefan Hajnoczi
  0 siblings, 1 reply; 5+ messages in thread
From: =?gb18030?B?usa3rrCh?= @ 2015-12-21  2:48 UTC (permalink / raw)
  To: =?gb18030?B?cWVtdS1kZXZlbA==?=; +Cc: =?gb18030?B?U3RlZmFuIEhham5vY3pp?=

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb18030", Size: 203 bytes --]

I want to change the queue_size of virtio-blk ring from 128 to 1024, so I  change here:
s->vq = virtio_add_queue(vdev, 128, virtio_blk_handle_output);
but the vm will not work. Are any thing i missed ?

[-- Attachment #2: Type: text/html, Size: 255 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] 回复:  回复:  someconfusion on qemu i/o pocess and the qcow2format
  2015-12-21  2:48       ` [Qemu-devel] =?gb18030?b?u9i4tKO6ICC72Li0o7ogIHNvbWVjb25mdXNpb24g?= =?gb18030?q?on_qemu_i/o_pocess_and_the_qcow2format?= =?gb18030?B?usa3rrCh?=
@ 2015-12-22  6:35         ` Stefan Hajnoczi
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2015-12-22  6:35 UTC (permalink / raw)
  To: 浩樊啊; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 404 bytes --]

On Mon, Dec 21, 2015 at 10:48:07AM +0800, 浩樊啊 wrote:
> I want to change the queue_size of virtio-blk ring from 128 to 1024, so I  change here:
> s->vq = virtio_add_queue(vdev, 128, virtio_blk_handle_output);
> but the vm will not work. Are any thing i missed ?

I think 1024 should work in theory (it's the max supported virtqueue
size).  You'd have to debug it to figure out why.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-12-22  6:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-20  3:21 [Qemu-devel] some confusion on qemu i/o pocess and the qcow2 format =?gb18030?B?usa3rrCh?=
2015-11-25  9:44 ` Stefan Hajnoczi
     [not found]   ` <tencent_04C6AF085D5F3396311ECC83@qq.com>
2015-12-02 13:29     ` [Qemu-devel] 回复: some confusion on qemu i/o pocess and the qcow2format Stefan Hajnoczi
2015-12-21  2:48       ` [Qemu-devel] =?gb18030?b?u9i4tKO6ICC72Li0o7ogIHNvbWVjb25mdXNpb24g?= =?gb18030?q?on_qemu_i/o_pocess_and_the_qcow2format?= =?gb18030?B?usa3rrCh?=
2015-12-22  6:35         ` [Qemu-devel] 回复: 回复: someconfusion on qemu i/o pocess and the qcow2format Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).