This is another implementation of https://reviews.freebsd.org/D26387 but with easier way.Current code doesn't work when several similar types are used in VM. For example, two `virtio-blk` or two CD-ROM-s, etc.
This is fixing of that issue.
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
For example: "devices" section in $dumpfile.meta would be:
```
"devices": [
{
"device": "lpc-pci-0-31-0",
"size": 520,
"file_offset": 80418
},
{
"device": "virtio-net-pci-0-4-0",
"size": 66180,
"file_offset": 80938
},
{
"device": "virtio-blk-pci-0-3-0",
"size": 8819,
"file_offset": 147118
},
{
"device": "hostbridge-pci-0-0-0",
"size": 436,
"file_offset": 155937
},
{
"device": "atkbdc",
"size": 141,
"file_offset": 156373
}
]
```
Sponsored by vStack.