I.e. set
VIR_NETDEV_TAP_CREATE_ALLOW_EXISTING flag in case managed='no'?
That is also mentioned in the commit message:
The only exception is with where we specifically want to let users use
pre-created TAP device and basically not touch it at all.
On 19/01/2023 11:25, Vasily Ulyanov wr
/a2ae3d299cf9c5ada8aa42ec4271748eb479dc27
--
Vasily Ulyanov
Software Engineer, SUSE Labs Core
tches. I agree on
squashing the fixups and merging.
--
Vasily Ulyanov
Software Engineer, SUSE Labs Core
path, O_RDWR)) < 0)
> return -1;
>
> if (virFileLock(fd, false, 0, 1, false) >= 0) {
> /* The file isn't locked. PID is stale. */
> return -1;
> }
>
> /* we only knew the pid, and that pid is alive, so we can
>* return it.
>*/
> *pid = retPid;
> return 0;
>
>
> That leaves us with virChrdevLockFileCreate() which passes NULL as
> @binPath but doesn't use lock the "pidfile". In fact, it uses files as
> locks, not pid files.
>
> Michal
>
--
Vasily Ulyanov
Software Engineer, SUSE Labs Core
+
> src/util/virfile.h | 2 ++
> src/util/virpidfile.c | 20 +++
> 6 files changed, 82 insertions(+), 21 deletions(-)
>
--
Vasily Ulyanov
Software Engineer, SUSE Labs Core
virCommandSetPidFile() when
> spawning the command instead of passing arbitrary --pid arguments.
>
So I can drop --pid and --daemon args from swtpm cmd and add
virCommandSetPidFile(cmd, pidfile);
virCommandDaemonize(cmd);
Then in virPidFileReadPathIfAlive() I can add a lock check. H