[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 08/13] vl: relocate paths to data directories
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 08/13] vl: relocate paths to data directories |
Date: |
Wed, 2 Sep 2020 10:41:47 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 |
On 9/2/20 10:35 AM, Paolo Bonzini wrote:
> On 02/09/20 10:28, Philippe Mathieu-Daudé wrote:
>>>
>>> -void qemu_add_data_dir(const char *path)
>>> +void qemu_add_data_dir(char *path)
>> But we have 'const char *data_dir[16];', why remove the const?
>
> In order to free duplicates: before this patch the directory can be
> statically- or stack-allocated, now it's always heap-allocated.
Oh I missed that, thanks.
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>
> Paolo
>
>> {
>> int i;
>>
>> @@ -2017,10 +2017,11 @@ void qemu_add_data_dir(const char *path)
>> }
>> for (i = 0; i < data_dir_idx; i++) {
>> if (strcmp(data_dir[i], path) == 0) {
>> - return; /* duplicate */
>> + g_free(path); /* duplicate */
>> + return;
>> }
>> }
>> - data_dir[data_dir_idx++] = g_strdup(path);
>> + data_dir[data_dir_idx++] = path;
>> }
>
> Paolo
>
- Re: [PATCH 07/13] net: relocate paths to helpers and scripts, (continued)
- [PATCH 12/13] ui: relocate paths to icons and translations, Paolo Bonzini, 2020/09/01
- [PATCH 13/13] configure: use a platform-neutral prefix, Paolo Bonzini, 2020/09/01
- [PATCH 10/13] qemu-bridge-helper: relocate path to default ACL, Paolo Bonzini, 2020/09/01
- [PATCH 04/13] cutils: introduce get_relocated_path, Paolo Bonzini, 2020/09/01
- [PATCH 11/13] qga: relocate path to default configuration and hook, Paolo Bonzini, 2020/09/01
- Re: [PATCH 00/13] Make QEMU installation relocatable, Mark Cave-Ayland, 2020/09/01