qemu-discuss
[Top][All Lists]
Advanced

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

Block I/O record and replay questions


From: Arnabjyoti Kalita
Subject: Block I/O record and replay questions
Date: Thu, 5 Aug 2021 11:36:02 +0530

Hello all,

I was following the docs on QEMU replay
(https://github.com/qemu/qemu/blob/master/docs/replay.txt) and I had a
few questions about the implementation of block I/O record and replay
in QEMU.

All my questions are numbered. And for context, I am running QEMU
5.0.1 where both the host and target architecture is x86_64. I am
using the virtio-blk-pci device in QCOW2 format as my backing storage
for the guest.

The below code snippet -

uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags)
{
    uint64_t reqid = blkreplay_next_id();
    int ret = bdrv_co_preadv(bs->file, offset, bytes, qiov, flags);
    block_request_create(reqid, bs, qemu_coroutine_self());
    qemu_coroutine_yield();

    return ret;
}

The "reqid" local variable is being used inside block_request_create
where we record the "reqid" to a file.

replay_block_event(req->bh, reqid);

1) Is the "reqid" generated during/before a disk request is completed
and then recorded after completion of the disk request? Does this
mean, we are actually only recording the order of completion of disk
requests here?

I also see that these request ids that are recorded are later replayed
before a checkpoint.

if (replay_state.read_event_id == -1) {
    replay_state.read_event_id = replay_get_qword();
}

2) Is it correct to say that during replay, we try to follow the same
order of completions of the disk requests as it happened during
record? Can these checkpoints be any deterministic event, like say, a
disk interrupt?

3) How do we separate disk requests that are actually generated by the
guest from the ones generated by QEMU (for eg. with operations like
loadvm/savevm)?

Thank you very much.

Best Regards,
Arnabjyoti Kalita



reply via email to

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