[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/8] buffered_file: g_realloc() can't fail
From: |
Orit Wasserman |
Subject: |
Re: [Qemu-devel] [PATCH 1/8] buffered_file: g_realloc() can't fail |
Date: |
Tue, 21 Aug 2012 13:40:22 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 |
On 08/18/2012 02:17 PM, Juan Quintela wrote:
> Signed-off-by: Juan Quintela <address@hidden>
> ---
> buffered_file.c | 10 +---------
> 1 file changed, 1 insertion(+), 9 deletions(-)
>
> diff --git a/buffered_file.c b/buffered_file.c
> index f170aa0..4148abb 100644
> --- a/buffered_file.c
> +++ b/buffered_file.c
> @@ -50,20 +50,12 @@ static void buffered_append(QEMUFileBuffered *s,
> const uint8_t *buf, size_t size)
> {
> if (size > (s->buffer_capacity - s->buffer_size)) {
> - void *tmp;
> -
> DPRINTF("increasing buffer capacity from %zu by %zu\n",
> s->buffer_capacity, size + 1024);
>
> s->buffer_capacity += size + 1024;
>
> - tmp = g_realloc(s->buffer, s->buffer_capacity);
> - if (tmp == NULL) {
> - fprintf(stderr, "qemu file buffer expansion failed\n");
> - exit(1);
> - }
> -
> - s->buffer = tmp;
> + s->buffer = g_realloc(s->buffer, s->buffer_capacity);
> }
>
> memcpy(s->buffer + s->buffer_size, buf, size);
>
Reviewed-by: Orit Wasserman <address@hidden>
- [Qemu-devel] [PATCH v2 0/8] Migration stats, Juan Quintela, 2012/08/18
- [Qemu-devel] [PATCH 1/8] buffered_file: g_realloc() can't fail, Juan Quintela, 2012/08/18
- Re: [Qemu-devel] [PATCH 1/8] buffered_file: g_realloc() can't fail,
Orit Wasserman <=
- [Qemu-devel] [PATCH 2/8] fix migration sync, Juan Quintela, 2012/08/18
- [Qemu-devel] [PATCH 3/8] migration: move total_time from ram stats to migration info, Juan Quintela, 2012/08/18
- Re: [Qemu-devel] For 1.2: Re: [PATCH 3/8] migration: move total_time from ram stats to migration info, Anthony Liguori, 2012/08/22
- Re: [Qemu-devel] For 1.2: Re: [PATCH 3/8] migration: move total_time from ram stats to migration info, Eric Blake, 2012/08/22
Re: [Qemu-devel] [PATCH 3/8] migration: move total_time from ram stats to migration info, Orit Wasserman, 2012/08/21