On Tue, 4 Apr 2023 11:46:29 +1000
David Gibson <david(a)gibson.dropbear.id.au> wrote:
The new subcommand gives more information about
the holder process and its
namespace, and may be further extended in future. Add some options which
give the old behaviour for existing scripts.
Signed-off-by: David Gibson <david(a)gibson.dropbear.id.au>
---
test/lib/setup | 12 +++++-----
test/nstool.c | 60 +++++++++++++++++++++++++++++++++++++++++---------
2 files changed, 55 insertions(+), 17 deletions(-)
diff --git a/test/lib/setup b/test/lib/setup
index e6180b1..6d7644a 100755
--- a/test/lib/setup
+++ b/test/lib/setup
@@ -78,7 +78,7 @@ setup_pasta() {
layout_pasta
context_run_bg unshare "unshare -rUnpf ${NSTOOL} hold ${STATESETUP}/ns.hold"
- __target_pid=$(${NSTOOL} pid ${STATESETUP}/ns.hold)
+ __target_pid=$(${NSTOOL} info -pw ${STATESETUP}/ns.hold)
Either 'pid' or 'info -pw' needs to be typed a few times, and
'pid' is
simpler. I would have a slight preference toward demultiplexing the
different commands in nstool rather than in scripts (with, say, 'pid'
passing 'pidonly' as true in cmd_info()).
And you always pass '-w', right?
As of this patch, that's true, but a lot of that goes away when nstool
exec is introduced.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!