Hello again,
After some more re-thinking I would say I found a "solution". As it's
not designed for running multiple devices out of the box and some
qemuboot modifications are needed anyway (rootfs, MACs,... ), it
doesn't make any sense to introduce such a variable. I have to modify
the cfg anyway, so I will do it there.
Anyway thanks for the feedback, I appreciate it :).
BR,
Zuzana
On Mon, 2026-06-08 at 19:00 +0200, Zuzana Valekova Spitalova wrote:
> Hi Richard,
>
> Do you mean the `/tmp/qemu-tap-locks/tapX.lock` file which is
> generated
> by:
> > possibles = re.findall(tap_re, ip_link, re.M)
> > tap = ""
> > for p in possibles:
> > lockfile = os.path.join(lockdir, p)
> > if os.path.exists('%s.skip' % lockfile):
> > logger.info('Found %s.skip, skipping %s' % (lockfile, p))
> > continue
> > self.taplock = lockfile + '.lock'
> ?
>
> How should I use it then? :) Something like `basename /tmp/qemu-tap-
> locks/tap0.lock | sed "s/[^0-9]//g"` and pass it into variable? It's
> not very unique or straight forward, is it?
>
> Looking into qemuboot.conf, maybe @CLIENT@ could be feasible. But the
> main problem is, that I need a @variable@ inside "cmd" while it's
> evaluated there. The @CLIENT@ nor @TAP@ are used in setup_tap nor
> setup_cmd.
>
> What do you mean by PID? Do you mean to use `ps` to get the pid or
> somehow call `os.getpid()`?
>
> Would it be possible to provide me an example(s) how to achieve it ?
> :)
>
> Many thanks for support,
> Zuzana
>
> On Mon, 2026-06-08 at 12:19 +0100, Richard Purdie wrote:
> > On Sun, 2026-06-07 at 19:40 +0200, Zuzana via
> > lists.openembedded.org
> > wrote:
> > > In some cases like running multiple QEMUs, would be nice to have
> > > an
> > > option
> > > to distinguish between them. For this reason I introduce an
> > > unique
> > > instance
> > > ID based on time. Later in cmd, the '@INSTANCE_ID@' could be used
> > > for QEMU
> > > identification.
> > >
> > > Signed-off-by: Zuzana Valekova Spitalova
> > > <[email protected]>
> > > ---
> > > scripts/runqemu | 7 +++++++
> > > 1 file changed, 7 insertions(+)
> >
> > Note that we already have the taplocks and IP addresses for the
> > guests,
> > there is also the PID of qemu as a unique ID. Why would we need
> > something else as well? Can you not use the PID?
> >
> > Cheers,
> >
> > Richard
--
Zuzana Valekova Spitalova
Siemens AG
www.siemens.com
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#238435):
https://lists.openembedded.org/g/openembedded-core/message/238435
Mute This Topic: https://lists.openembedded.org/mt/119693437/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-