virtio-rng: use virtqueue_get_avail_bytes, fix migration
commit14417039653d3293a795646730a7bf5055d78709
authorAmit Shah <amit.shah@redhat.com>
Wed, 21 Nov 2012 05:51:18 +0000 (21 11:21 +0530)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 26 Nov 2012 20:26:37 +0000 (26 14:26 -0600)
tree4c32716c715f9dbc1a8b547fef715d3ec30d2706
parent25d87288b150032fedcf7b5380fb54fdbdd6788d
virtio-rng: use virtqueue_get_avail_bytes, fix migration

Popping an elem from the vq just to find out its length causes problems
with save/load later on.  Use the new virtqueue_get_avail_bytes()
function instead, saves us the complexity in the migration code, as well
as makes the migration endian-safe.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/virtio-rng.c