Current snapshot implementation doesn't support multiple devices with similar type. For example, two virtio-blk or two CD-ROM-s, etc.
So the following configuration cannot be restored.
bhyve -s 3:0,virtio-blk,disk.img -s 4,virtio-blk,disk2.img
In some cases it is restored silently, but doesn't work. In some cases it gets failed during restore stage.
This patch fixes that.
Idea is: using unique name as identifier. For PCI devices it would be, for example, virtio-blk-pci-$bus-$slot-$func
Changes:
- Use unique name to identify device.
- Add simple register_snapshot_dev() function, for any type of device.
- Changed some function names and defs related to "user devices" and renamed to "devices"
- Renamed "struct" section to "kern_structs"
- Removed pci_find_slotted_dev function
- Added printing error number if pause/snapshot/resume fail
Sponsored by vStack.