Skip to contentSkip to conversation

virtio-net: stop vhost backend on vmstop

PATCH Applied Michael S. Tsirkin 3 participants 4 messages Jun 2, 2010 – Jun 10, 2010 KVM

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 virtio-net: stop vhost backend on vmstop

vhost net currently keeps running after vmstop, which causes trouble as qemy does not check for dirty pages anymore.
The fix is to simply keep vm and vhost running/stopped status in sync.

---

Changes from v1:
Simplify code as suggested by Amit.

 hw/virtio-net.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
hw/virtio-net.c +5 -6
index 28f26e1..67eebcf 100644
@@ -877,12 +877,11 @@ static void virtio_net_set_status(struct VirtIODevice *vdev, uint8_t status)
 static void virtio_net_vmstate_change(void *opaque, int running, int reason)
 {
     VirtIONet *n = opaque;
-    if (!running) {
-        return;
-    }
-    /* This is called when vm is started, it will start vhost backend if
-     * appropriate e.g. after migration. */
-    virtio_net_set_status(&n->vdev, n->vdev.status);
+    uint8_t status = running ? n->vdev.status : 0;
+    /* This is called when vm is started/stopped,
+     * it will start/stop vhost backend if appropriate
+     * e.g. after migration. */
+    virtio_net_set_status(&n->vdev, status);
 }
 
 VirtIODevice *virtio_net_init(DeviceState *dev, NICConf *conf)
Signature · 1 line
1.7.1.12.g42b7f
#1 lore raw
Quoted 8 lines · Michael S. Tsirkin

vhost net currently keeps running after vmstop, which causes trouble as qemy does not check for dirty pages anymore.
The fix is to simply keep vm and vhost running/stopped status in sync.

Quoted 7 lines

---

Changes from v1:
Simplify code as suggested by Amit.

 hw/virtio-net.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

Applied, thanks.

#2 lore raw
Quoted 11 lines · Marcelo Tosatti
Quoted 10 lines · Michael S. Tsirkin

vhost net currently keeps running after vmstop, which causes trouble as qemy does not check for dirty pages anymore.
The fix is to simply keep vm and vhost running/stopped status in sync.

---

Quoted 7 lines
Quoted 5 lines

Changes from v1:
Simplify code as suggested by Amit.

 hw/virtio-net.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

Applied, thanks.

Heh, wrong list, this is actually an upstream patch. I sent Anthony a merge request with it, hope this won't create problems.

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 17 lines · Michael S. Tsirkin
Quoted 15 lines · Marcelo Tosatti
Quoted 13 lines · Michael S. Tsirkin

vhost net currently keeps running after vmstop, which causes trouble as qemy does not check for dirty pages anymore.
The fix is to simply keep vm and vhost running/stopped status in sync.

---

Changes from v1:
Simplify code as suggested by Amit.

Quoted 9 lines
Quoted 5 lines
Quoted 3 lines
  hw/virtio-net.c |   11 +++++------
  1 files changed, 5 insertions(+), 6 deletions(-)

Applied, thanks.

Heh, wrong list, this is actually an upstream patch. I sent Anthony a merge request with it, hope this won't create problems.

git will figure it out.

Regards,

Anthony Liguori