]> git.proxmox.com Git - qemu.git/blobdiff - spice-qemu-char.c
virtio-net: properly check the vhost status during status set
[qemu.git] / spice-qemu-char.c
index ff95fcbe011d56f9dfed2f35c4945d1a56949d10..f10970c9dbc80e9fd5fa8029d40199ee889ba13a 100644 (file)
@@ -35,7 +35,8 @@ static int vmc_write(SpiceCharDeviceInstance *sin, const uint8_t *buf, int len)
     uint8_t* p = (uint8_t*)buf;
 
     while (len > 0) {
-        last_out = MIN(len, qemu_chr_be_can_write(scd->chr));
+        int can_write = qemu_chr_be_can_write(scd->chr);
+        last_out = MIN(len, can_write);
         if (last_out <= 0) {
             break;
         }