All of lore.kernel.org
 help / color / mirror / Atom feed
* Block I/O in the middle of guest code execution
@ 2021-07-13  4:52 Arnabjyoti Kalita
  0 siblings, 0 replies; only message in thread
From: Arnabjyoti Kalita @ 2021-07-13  4:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi

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

Hello Stefan/all,

I was reading your blog post on the QEMU overall architecture (link - "
http://blog.vmsplice.net/2011/03/qemu-internals-overall-architecture-and.html")
and I have a few questions with regards to executing I/O operations (block
I/O) in the middle of guest code execution.

I am running QEMU version 5.0.1 and my target and host architecture is
x86-64. I am using the virtio-blk block driver frontend with a qcow2 image
file as a backing file storage.

I want to do something like below (in TCG) -

static inline tcg_target_ulong cpu_tb_exec(CPUState *cpu, TranslationBlock
*itb)
{
           log_cpu_state(cpu, flags);
           qemu_log_unlock(logfile);
    }
           #endif /* DEBUG_DISAS */
           if (cond is true) {
               virtio_blk_data_plane_handle_output(vdev, vq);  <- calling
block I/O function here
           }
           ret = tcg_qemu_tb_exec(env, tb_ptr);
           cpu->can_do_io = 1;
           last_tb = (TranslationBlock *)(ret & ~TB_EXIT_MASK);
           .......
}

I have a few questions regarding this.

- Is it possible to call block I/O functions like this? Or do I have to
"call" it from the event loop (main_loop_wait) ?

- Making a change like this requires me to actually finish the block
operation first before I start executing the next TCG block. I see that
"virtio_blk_data_plane_handle_output" makes a lot of aio thread usages and
coroutines. How do I make this call synchronous and essentially run it in
the same thread?

Thank you very much.

Best Regards,
Arnabjyoti Kalita

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-13  4:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-13  4:52 Block I/O in the middle of guest code execution Arnabjyoti Kalita

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.