qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] qemu io path


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] qemu io path
Date: Thu, 28 Jan 2016 10:49:39 +0000
User-agent: Mutt/1.5.24 (2015-08-30)

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: signature.asc
Description: PGP signature


reply via email to

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