"Assertion `!r->req.sg' failed." during live migration with VirtIO
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Expired
|
Undecided
|
Unassigned |
Bug Description
We've hit this issue twice so far, but don't have an obvious repro yet. It's pretty rare for us to hit it but I'm still trying so I can get a core and backtrace. The guest was Windows running a constant workload. We were using VirtIO SCSI drivers in both cases.
In both cases we hit the assert here:
hw/scsi/
static void scsi_generic_
{
SCSIGenericReq *r = DO_UPCAST(
qemu_
if (r->buflen && r->req.cmd.mode == SCSI_XFER_TO_DEV) {
*** assert(!r->req.sg);
}
}
From code inspection, it seems that this will always happen if scsi_req_
static void scsi_req_
{
assert(
scsi_
if (req->bus-
req->sg = req->bus-
} else {
req->sg = NULL;
}
req->enqueued = true;
QTAILQ_
}
req->bus-
I think this can only happen if scsi_dma_restart_bh in hw/scsi/scsi-bus.c is called. The only other location I see scsi_req_
static void scsi_dma_
{
SCSIDevice *s = opaque;
SCSIRequest *req, *next;
qemu_
s->bh = NULL;
QTAILQ_
if (req->retry) {
switch (req->cmd.mode) {
case SCSI_XFER_FROM_DEV:
case SCSI_XFER_TO_DEV:
case SCSI_XFER_NONE:
}
}
}
}
Finally when put_scsi_requests is called for migration, it seems like it will call both virtio_
I searched for a bit, but didn't find anyone else reporting this. Has anyone else seen this? It seems to me like that assert should check that the sg list is empty instead of checking that it exists. Is this an appropriate assessment? Assuming I find a repro, I'll try to test this solution.
Thanks!
Which version of QEMU are you using?