Re: [PATCH spice-server 5/7] smartcard.c: avoid marshalling migration data with reference to a memory that might be released before send has completed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Looks good, ACK.

Regards,

Hans


On 11/21/2012 08:42 PM, Yonit Halperin wrote:
The current solution just copy the buffer. Currently data that is read
from the guest is always copied before sending it to the client. When we
will have ref count for these buffers, we can also use it for marshalling
the migration data.
---
  server/smartcard.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/smartcard.c b/server/smartcard.c
index a7e81d5..f1e6244 100644
--- a/server/smartcard.c
+++ b/server/smartcard.c
@@ -508,7 +508,7 @@ static void smartcard_channel_send_migrate_data(RedChannelClient *rcc,
          spice_marshaller_add_uint8(m, state->reader_added);
          spice_marshaller_add_uint32(m, state->buf_used);
          m2 = spice_marshaller_get_ptr_submarshaller(m, 0);
-        spice_marshaller_add_ref(m2, state->buf, state->buf_used);
+        spice_marshaller_add(m2, state->buf, state->buf_used);
          spice_debug("reader added %d partial read size %u", state->reader_added, state->buf_used);
      }
  }

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]