]> git.proxmox.com Git - qemu.git/commitdiff
spapr_llan: fix device reenabling
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Thu, 2 May 2013 20:22:03 +0000 (20:22 +0000)
committerAlexander Graf <agraf@suse.de>
Mon, 6 May 2013 15:22:48 +0000 (17:22 +0200)
Normally, the "tap" device is polled by QEMU if a guest NIC can
receive packets. If a guest NIC is stopped during transfer (rmmod or
ifdown), it may still have packets in a queue which have to be send
to the guest before QEMU enables polling of a "tap" interface via
tap_update_fd_handler().

However the spapr_llan device was missing the qemu_flush_queued_packets()
call so the tap_send_completed() callback was never called and therefore
"tap" interface polling was not enabled ever.

The patch fixes this problem.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Alexander Graf <agraf@suse.de>
hw/net/spapr_llan.c

index 3150add3c1cdc5b7881011a7c530e90f3b8ca7fa..03a09f204743b6bf44f1861616a003e1b8ad8464 100644 (file)
@@ -336,6 +336,8 @@ static target_ulong h_register_logical_lan(PowerPCCPU *cpu,
     spapr_vio_dma_set(sdev, VLAN_BD_ADDR(rec_queue), 0, VLAN_BD_LEN(rec_queue));
 
     dev->isopen = 1;
+    qemu_flush_queued_packets(qemu_get_queue(dev->nic));
+
     return H_SUCCESS;
 }