Re: [Qemu-devel] [PATCH v2 5/6] block: mirror - change string allocation to 2-bytes

2015-01-22 Thread Stefan Hajnoczi
On Tue, Jan 20, 2015 at 12:31:32PM -0500, Jeff Cody wrote: > The backing_filename string in mirror_run() is only used to check > for a NULL string, so we don't need to allocate 1024 bytes (or, later, > PATH_MAX bytes), when we only need to copy the first 2 characters. > > We technically only need

Re: [Qemu-devel] [PATCH v2 5/6] block: mirror - change string allocation to 2-bytes

2015-01-20 Thread John Snow
On 01/20/2015 12:31 PM, Jeff Cody wrote: The backing_filename string in mirror_run() is only used to check for a NULL string, so we don't need to allocate 1024 bytes (or, later, PATH_MAX bytes), when we only need to copy the first 2 characters. We technically only need 1 byte, as we are just c

[Qemu-devel] [PATCH v2 5/6] block: mirror - change string allocation to 2-bytes

2015-01-20 Thread Jeff Cody
The backing_filename string in mirror_run() is only used to check for a NULL string, so we don't need to allocate 1024 bytes (or, later, PATH_MAX bytes), when we only need to copy the first 2 characters. We technically only need 1 byte, as we are just checking for NULL, but since backing_filename[