All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] qemu io path
@ 2016-01-25 13:31 Ata Fatahi baarzi
  2016-01-28 10:49 ` Stefan Hajnoczi
  0 siblings, 1 reply; 3+ messages in thread
From: Ata Fatahi baarzi @ 2016-01-25 13:31 UTC (permalink / raw)
  To: qemu-devel

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

hi dear  all.
im searching for qemu io (storage) stack. i searched a lot but just found
some slides which does not present so much.is there any text explanation or
article or blog post which describes precisely qemu io stack?
I would be grateful if you provide something for me.and have some question
hope you answer them.
before ask my question its worth noting that i have an excellent background
about Linux io stack and read qemu source code for main iothread and know
about qemu structure, guest os ,...
I read [hw/block/virtio-blk.c]  and started fromvirtio_blk_handle_output
function and trace it until reached toio_submit! that great we reached host
kernel libaio syscalls.but what made me confuesd, is what and where and
when th stuffs fordoing a typical io request from a typical guest os
starts?!
now here is my questions:
1- i wanna know codes which doing so.(start an io request untilio_submit
get called)
2- can you give me th exact path of an io request from app in guest
osthrough qemu until get to real disk?
3- does it possible to determin bellow featers for an io request:a- which
guest os sent this io request?b- address which io request  points to?c-
request type read/write?d- request size?
4- if there is multiple disks in system, where it is define iorequest is
corresponds to which disk?thank a lot

-- 
Best Regrads
Ata Fatahi Baarzi <http://ce.sharif.edu/~fatahibarzi>

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

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

* Re: [Qemu-devel] qemu io path
  2016-01-25 13:31 [Qemu-devel] qemu io path Ata Fatahi baarzi
@ 2016-01-28 10:49 ` Stefan Hajnoczi
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2016-01-28 10:49 UTC (permalink / raw)
  To: Ata Fatahi baarzi; +Cc: qemu-devel

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

On Mon, Jan 25, 2016 at 05:01:05PM +0330, Ata Fatahi baarzi wrote:
> 1- i wanna know codes which doing so.(start an io request untilio_submit
> get called)
> 2- can you give me th exact path of an io request from app in guest
> osthrough qemu until get to real disk?

You have already looked at the most important parts of the I/O code
path.

If you want to understand it better, start going into more detail.  For
example, add a breakpoint on virtio_blk_handle_request() so you can see
how it gets called.  Also breakpoint on virtio_blk_rw_complete() so you
can see the request completion code path.

If you want to understand the code at the "exact path" level of detail
you are asking for, you'll need to put in the effort yourself.  Use
grep, use printf, use gdb, etc and read code.

> 3- does it possible to determin bellow featers for an io request:a- which
> guest os sent this io request?b- address which io request  points to?c-
> request type read/write?d- request size?

a. Not really, QEMU emulates a disk.  The disk doesn't know or care
which operating system submitted a request.

b. Sure, you've already seen the I/O buffers and disk Logical Block
Address (LBA, which QEMU calls the sector number) in the code you looked
at.

c. Again, you've already seen this in the code you looked at.

d. Ditto.

> 4- if there is multiple disks in system, where it is define iorequest is
> corresponds to which disk?thank a lot

It depends on the emulated storage controller that the guest interacts
with.  Each virtio-blk PCI adapter controls a single disk, so multiple
disks means multiple PCI adapters are required.  For SCSI Host Bus
Adapters the guest can reach multiple disks by talking to a single Host
Bus Adapter device and the SCSI specs define how disks are addressed by
Logical Unit Number (LUN).

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

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

* [Qemu-devel] qemu io path
@ 2016-01-25 13:27 Ata Fatahi baarzi
  0 siblings, 0 replies; 3+ messages in thread
From: Ata Fatahi baarzi @ 2016-01-25 13:27 UTC (permalink / raw)
  To: qemu-devel

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

hi dear  all.
im searching for qemu io (storage) stack. i searched a lot but just
found some slides which does not present so much.
is there any text explanation or article or blog post which describes
precisely qemu io stack?
I would be grateful if you provide something for me.
and have some question hope you answer them.
before ask my question its worth noting that i have an excellent
background about Linux io stack and read qemu source code for main io
thread and know about qemu structure, guest os ,...
i read [hw/block/virtio-blk.c]  and started from
virtio_blk_handle_output function and trace it until reached to
io_submit! that great we reached host kernel libaio syscalls.
but what made me confuesd, is what and where and when th stuffs for
doing a typical io request from a typical guest os starts?!
now here is my questions:
1- i wanna know codes which doing so.(start an io request until
io_submit get called)
2- can you give me th exact path of an io request from app in guest os
through qemu until get to real disk?
3- does it possible to determin bellow featers for an io request:
a- which guest os sent this io request?
b- address which io request  points to?
c- request type read/write?
d- request size?
e- if there is multiple disks in system, where it is define io
request is corresponds to which disk?
thank a lot



-- 
Best Regrads
Ata Fatahi Baarzi <http://ce.sharif.edu/~fatahibarzi>

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

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

end of thread, other threads:[~2016-01-28 10:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-25 13:31 [Qemu-devel] qemu io path Ata Fatahi baarzi
2016-01-28 10:49 ` Stefan Hajnoczi
  -- strict thread matches above, loose matches on Subject: below --
2016-01-25 13:27 Ata Fatahi baarzi

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.