Re: [RFC PATCH 04/20] Make QEMUFile buf expandable, and introduce qemu_realloc_buffer() and qemu_clear_buffer().

2010-04-26 Thread Yoshiaki Tamura
Avi Kivity wrote: On 04/23/2010 12:59 PM, Yoshiaki Tamura wrote: Avi Kivity wrote: On 04/21/2010 08:57 AM, Yoshiaki Tamura wrote: Currently buf size is fixed at 32KB. It would be useful if it could be flexible. Why is this needed? The real buffering is in the kernel anyways; this is only

Re: [RFC PATCH 04/20] Make QEMUFile buf expandable, and introduce qemu_realloc_buffer() and qemu_clear_buffer().

2010-04-23 Thread Avi Kivity
On 04/21/2010 08:57 AM, Yoshiaki Tamura wrote: Currently buf size is fixed at 32KB. It would be useful if it could be flexible. Why is this needed? The real buffering is in the kernel anyways; this is only used to reduce the number of write() syscalls. -- Do not meddle in the

Re: [RFC PATCH 04/20] Make QEMUFile buf expandable, and introduce qemu_realloc_buffer() and qemu_clear_buffer().

2010-04-23 Thread Yoshiaki Tamura
Avi Kivity wrote: On 04/21/2010 08:57 AM, Yoshiaki Tamura wrote: Currently buf size is fixed at 32KB. It would be useful if it could be flexible. Why is this needed? The real buffering is in the kernel anyways; this is only used to reduce the number of write() syscalls. This was introduced

Re: [RFC PATCH 04/20] Make QEMUFile buf expandable, and introduce qemu_realloc_buffer() and qemu_clear_buffer().

2010-04-23 Thread Avi Kivity
On 04/23/2010 12:59 PM, Yoshiaki Tamura wrote: Avi Kivity wrote: On 04/21/2010 08:57 AM, Yoshiaki Tamura wrote: Currently buf size is fixed at 32KB. It would be useful if it could be flexible. Why is this needed? The real buffering is in the kernel anyways; this is only used to reduce the

Re: [RFC PATCH 04/20] Make QEMUFile buf expandable, and introduce qemu_realloc_buffer() and qemu_clear_buffer().

2010-04-23 Thread Anthony Liguori
On 04/23/2010 04:53 AM, Avi Kivity wrote: On 04/21/2010 08:57 AM, Yoshiaki Tamura wrote: Currently buf size is fixed at 32KB. It would be useful if it could be flexible. Why is this needed? The real buffering is in the kernel anyways; this is only used to reduce the number of write()

[RFC PATCH 04/20] Make QEMUFile buf expandable, and introduce qemu_realloc_buffer() and qemu_clear_buffer().

2010-04-21 Thread Yoshiaki Tamura
Currently buf size is fixed at 32KB. It would be useful if it could be flexible. Signed-off-by: Yoshiaki Tamura tamura.yoshi...@lab.ntt.co.jp --- hw/hw.h |2 ++ savevm.c | 26 +- 2 files changed, 27 insertions(+), 1 deletions(-) diff --git a/hw/hw.h b/hw/hw.h

Re: [RFC PATCH 04/20] Make QEMUFile buf expandable, and introduce qemu_realloc_buffer() and qemu_clear_buffer().

2010-04-21 Thread Stefan Hajnoczi
On Wed, Apr 21, 2010 at 6:57 AM, Yoshiaki Tamura tamura.yoshi...@lab.ntt.co.jp wrote: @@ -454,6 +458,25 @@ void qemu_fflush(QEMUFile *f)     }  } +void *qemu_realloc_buffer(QEMUFile *f, int size) +{ +    f-buf_max_size = size; + +    f-buf = qemu_realloc(f-buf, f-buf_max_size); +    if

Re: [RFC PATCH 04/20] Make QEMUFile buf expandable, and introduce qemu_realloc_buffer() and qemu_clear_buffer().

2010-04-21 Thread Yoshiaki Tamura
2010/4/21 Stefan Hajnoczi stefa...@gmail.com: On Wed, Apr 21, 2010 at 6:57 AM, Yoshiaki Tamura tamura.yoshi...@lab.ntt.co.jp wrote: @@ -454,6 +458,25 @@ void qemu_fflush(QEMUFile *f)     }  } +void *qemu_realloc_buffer(QEMUFile *f, int size) +{ +    f-buf_max_size = size; + +    f-buf =