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 us

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() sysca

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 nu

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/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 internal

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 : > On Wed, Apr 21, 2010 at 6:57 AM, Yoshiaki Tamura > 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->b

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 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 (f->buf == NULL)

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

2010-04-20 Thread Yoshiaki Tamura
Currently buf size is fixed at 32KB. It would be useful if it could be flexible. Signed-off-by: Yoshiaki Tamura --- hw/hw.h |2 ++ savevm.c | 26 +- 2 files changed, 27 insertions(+), 1 deletions(-) diff --git a/hw/hw.h b/hw/hw.h index 05131a0..fc9ed29 100644 ---