On 1/9/23 9:51 AM, Ján Tomko wrote:
On a Monday in 2023, Laine Stump wrote:
> On 1/9/23 2:32 AM, Ján Tomko wrote:
>> On a Sunday in 2023, Laine Stump wrote:
>>> +static char *
>>> +qemuPasstCreatePidFilename(virDomainObj *vm,
>>> + virDomainNetDef *net)
>>> +{
>>> + qemuDomainObjPrivate *priv = vm->privateData;
>>> + virQEMUDriver *driver = priv->driver;
>>> + g_autoptr(virQEMUDriverConfig) cfg =
>>> virQEMUDriverGetConfig(driver);
>>> + g_autofree char *name = NULL;
>>> +
>>> + name = g_strdup_printf("%s-%s-passt", vm->def->name,
>>> net->info.alias);
>>
>> Please use virDomainDefGetShortName for filename purposes.
>
> Why? If I use GetShortName, then there's the possibility that two
> domains would want to use the same name for the pidfile.
>
Because otherwise the PID filename might exceed maximum path length for
domains with very long names.
The short name should be unique since it contains the domain ID.
Ah, I missed that bit. I guess I *can* use it for the passt socket path
then...