Page MenuHomeFreeBSD

bhyve: snapshot virtio queues can fail
ClosedPublic

Authored by gusev.vitaliy_gmail.com on Sep 1 2020, 11:23 AM.

Details

Summary

If virtio device is not fully initialized, then suspend fails with:

    
vi_pci_snapshot_queues: invalid address: vq->vq_desc
Failed to snapshot virtio-rnd; ret=14
Test Plan

Suspend and resume VM. VM should suspend w/o error and keep working after resume.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Is the issue specific to virtio-rnd, or why does it appear? I'm wondering why it was not caught earlier.

Is the issue specific to virtio-rnd, or why does it appear? I'm wondering why it was not caught earlier.

I saw the same message also for virtio-net:

vi_pci_snapshot_queues: invalid address: vq->vq_desc
Failed to snapshot virtio-net; ret=14

To reproduce virtio-net fail, you need to suspend VM before vi_vq_init() is called, i.e. before even grub is started. To reproduce for virtio-rnd, you need run suspend exactly after grub and before guest Linux OS initialise virtio random device.

By the code you can see that this patch is required if device is not initialised by guest OS.

Another wording might be: "Only snapshot initialized VirtIO queues."?

This revision is now accepted and ready to land.Nov 28 2020, 4:33 AM
In D26268#612118, @jhb wrote:

Another wording might be: "Only snapshot initialized VirtIO queues."?

Yes, sure.

Should this be committed?

I think yes. Of course if @jhb doesn't mind.

Should this be committed?

I think yes. Can you do it?
Just a side note. Vitaliy is my colleague, and we have been thoroughly testing his patches for several months in our test lab (vstack.com or Serverspace).
We think that these patches are quite stable, and in the near future we are thinking of releasing them into production.

It would be nice if these patches goes to the upstream.

Should this be committed?

I think yes. Can you do it?
Just a side note. Vitaliy is my colleague, and we have been thoroughly testing his patches for several months in our test lab (vstack.com or Serverspace).
We think that these patches are quite stable, and in the near future we are thinking of releasing them into production.

It would be nice if these patches goes to the upstream.

Ok, I'll commit with the subject line proposed by John.

This revision now requires review to proceed.Dec 16 2021, 6:24 PM
This revision was not accepted when it landed; it landed in state Needs Review.Dec 17 2021, 6:12 PM
This revision was automatically updated to reflect the committed changes.