Re: [PATCH for v1.0.5-maint] Fix use of VIR_STRDUP vs strdup

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

 



On 06/10/2013 10:28 AM, Eric Blake wrote:
> ----- Original Message -----
>> Commit 894f784948a93760629de3cb195c69ef4f4b831f broke the v1.0.5-maint
>> branch because VIR_STRDUP() didn't exist in the v1.0.5 release so the
>> resulting build is missing that symbol.
>>
>> This patch is only for the v1.0.5-maint branch.
>> ---
>>  src/qemu/qemu_migration.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
>> index d96805a..606194c 100644
>> --- a/src/qemu/qemu_migration.c
>> +++ b/src/qemu/qemu_migration.c
>> @@ -1223,7 +1223,7 @@ qemuMigrationDriveMirror(virQEMUDriverPtr driver,
>>              virReportOOMError();
>>              goto error;
>>          }
>> -    } else if (VIR_STRDUP(hoststr, host) < 0) {
>> +    } else if ((hoststr = strdup(host)) == NULL) {
> 
> Rather, we should backport c3abb5c45 to the v1.0.5-maint branch, so that
> all other patches using VIR_STRDUP can be backported without issue.
> 

I wonder if we should also backport the move of string-related functions from
virutil.h to virstring.h (and the two commits that fix it), just to remove the
need to #include "virstring.h" in a maint-only patch.

Also, backporting the three commits changing VIR_STRNDUP to accept NULL as the
source and -1 as strlen(source) could prevent some unwanted surprises if any
of the other patches use those.

Jan

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]