aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-09-04 17:39:07 +0100
committerPeter Maydell <peter.maydell@linaro.org>2014-09-04 17:39:07 +0100
commit8cf8c92e7775b9c5e811c55c9b8814168c46c34b (patch)
tree09b57396fc0a5fb7bab1341b11f62851fd678fd6 /hw/virtio
parent01eb313907dda97313b8fea62e5632fca64f069c (diff)
parent086abc1ccd0fa5103345adda819e6c6436949579 (diff)
downloadqemu-8cf8c92e7775b9c5e811c55c9b8814168c46c34b.zip
qemu-8cf8c92e7775b9c5e811c55c9b8814168c46c34b.tar.gz
qemu-8cf8c92e7775b9c5e811c55c9b8814168c46c34b.tar.bz2
Merge remote-tracking branch 'remotes/stefanha/tags/net-pull-request' into staging
Net patches # gpg: Signature made Thu 04 Sep 2014 17:32:44 BST using RSA key ID 81AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" * remotes/stefanha/tags/net-pull-request: virtio-net: purge outstanding packets when starting vhost net: complete all queued packets on VM stop net: invoke callback when purging queue virtio: don't call device on !vm_running virtio-net: don't run bh on vm stopped net: Forbid dealing with packets when VM is not running Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/virtio')
-rw-r--r--hw/virtio/virtio.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 5c98180..ac22238 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -1108,7 +1108,10 @@ static void virtio_vmstate_change(void *opaque, int running, RunState state)
BusState *qbus = qdev_get_parent_bus(DEVICE(vdev));
VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus);
bool backend_run = running && (vdev->status & VIRTIO_CONFIG_S_DRIVER_OK);
- vdev->vm_running = running;
+
+ if (running) {
+ vdev->vm_running = running;
+ }
if (backend_run) {
virtio_set_status(vdev, vdev->status);
@@ -1121,6 +1124,10 @@ static void virtio_vmstate_change(void *opaque, int running, RunState state)
if (!backend_run) {
virtio_set_status(vdev, vdev->status);
}
+
+ if (!running) {
+ vdev->vm_running = running;
+ }
}
void virtio_init(VirtIODevice *vdev, const char *name,