[libvirt PATCH 4/4] qemu: virtiofs: use a .log.fs suffix for logs

Ján Tomko jtomko at redhat.com
Mon Mar 23 16:56:15 UTC 2020


On a Monday in 2020, Michal Prívozník wrote:
>On 23. 3. 2020 17:10, Ján Tomko wrote:
>> As Dave pointed out, someone creative might name a domain
>> to make its logfile conflict with a logfile of another
>> domain's virtiofsd log.
>>
>> Signed-off-by: Ján Tomko <jtomko at redhat.com>
>> Reported-by: Dr. David Alan Gilbert <dgilbert at redhat.com>
>> ---
>>  src/qemu/qemu_virtiofs.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/qemu/qemu_virtiofs.c b/src/qemu/qemu_virtiofs.c
>> index aaa25bcbb8..575b47fd74 100644
>> --- a/src/qemu/qemu_virtiofs.c
>> +++ b/src/qemu/qemu_virtiofs.c
>> @@ -67,9 +67,9 @@ qemuVirtioFSCreateLogFilename(virQEMUDriverConfigPtr cfg,
>>  {
>>      g_autofree char *name = NULL;
>>
>> -    name = g_strdup_printf("%s-%s", def->name, alias);
>> +    name = g_strdup_printf("%s-%s.log.fs", def->name, alias);
>>
>> -    return virFileBuildPath(cfg->logDir, name, "-virtiofsd.log");
>> +    return virFileBuildPath(cfg->logDir, name, NULL);
>>  }
>>
>>
>>
>
>Why not go with virDomainDefGetShortName() then? Using def->name to name
>a file is dangerous anyways.

Other than path name limits (which are way higher than unix socket
limits), it should not be dangerous.

>Oh, is it because we want to keep the same
>log name across domain cold reboots?
>

That too.

Jano

>Michal
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20200323/1ac2af7b/attachment-0001.sig>


More information about the libvir-list mailing list