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

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

 



2010/4/21 Stefan Hajnoczi <stefanha@xxxxxxxxx>:
> On Wed, Apr 21, 2010 at 6:57 AM, Yoshiaki Tamura
> <tamura.yoshiaki@xxxxxxxxxxxxx> 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) {
>> +        fprintf(stderr, "qemu file buffer realloc failed\n");
>> +        exit(1);
>> +    }
>> +
>> +    return f->buf;
>> +}
>> +
>
> qemu_realloc() will abort() if there was not enough memory to realloc.
>  Just like qemu_malloc(), you don't need to check for NULL.

Thanks for your comment.  I'll remove it.
If there is no objection, I would like to take out this patch from the series,
and post it by itself.

Yoshi

>
> Stefan
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux