]> git.proxmox.com Git - qemu.git/blobdiff - spice-qemu-char.c
Open 2.0 development tree
[qemu.git] / spice-qemu-char.c
index ff95fcbe011d56f9dfed2f35c4945d1a56949d10..6d147a7ece26a79f6af8838e4d22afd5e3ea6e81 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;
         }
@@ -254,6 +255,7 @@ static CharDriverState *chr_open(const char *subtype)
     chr->chr_add_watch = spice_chr_add_watch;
     chr->chr_close = spice_chr_close;
     chr->chr_set_fe_open = spice_chr_set_fe_open;
+    chr->explicit_be_open = true;
 
     QLIST_INSERT_HEAD(&spice_chars, s, next);