]> git.baikalelectronics.ru Git - kernel.git/commit
virtio: console: Add freeze and restore handlers to support S4
authorAmit Shah <amit.shah@redhat.com>
Thu, 22 Dec 2011 11:28:28 +0000 (16:58 +0530)
committerRusty Russell <rusty@rustcorp.com.au>
Thu, 12 Jan 2012 05:14:45 +0000 (15:44 +1030)
commit2658f9f2ffa4d2e43a3ffb310ed34d54a86deafc
treea3dbf456eb359650db0487d66d3594f1fa7be6c0
parent6c0bfc354711be037779dac2fd95e5557b912183
virtio: console: Add freeze and restore handlers to support S4

Remove all vqs and associated buffers in the freeze callback which
prepares us to go into hibernation state.  On restore, re-create all the
vqs and populate the input vqs with buffers to get to the pre-hibernate
state.

Note: Any outstanding unconsumed buffers are discarded; which means
there's a possibility of data loss in case the host or the guest didn't
consume any data already present in the vqs.  This can be addressed in a
later patch series, perhaps in virtio common code.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/char/virtio_console.c