diff mbox series

runqemu: Fix automated call to runqemu-ifup

Message ID 20230625042706.3998722-1-alejandro@enedino.org
State Accepted, archived
Commit ce3a2f4cec28290c8e530989f17243f1ada4e3bd
Headers show
Series runqemu: Fix automated call to runqemu-ifup | expand

Commit Message

Alejandro Enedino Hernandez Samaniego June 25, 2023, 4:27 a.m. UTC
When runqemu tries to call runqemu-ifup to create tap devices, it checks the
output of runqemu-ifup to get the newly created tap device.

The behavior of runqemu-ifup was recently modified along with its output, it
no longer expects the uid parameter to be passed and it prints out a warning
if it was, since this warning was now part of the output runqemu tries to parse
it and convert it to an int() which proved impossible.

Pass the correct arguments to the runqemu-ifup call and echo the warning
to stderr instead to make sure its not being parsed and used by runqemu in any
case.

Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro@enedino.org>
---
 scripts/runqemu      | 2 +-
 scripts/runqemu-ifup | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Adrian Freihofer June 25, 2023, 8:46 a.m. UTC | #1
Hi Alejandro

Thank you.
I will prepare another patch to bring the ifdown script to the same
level. There is still the <native-sysroot-basedir> parameter. But maybe
after learning from ifup part of the story, when the autobuilder
confirmed that everything is consistent again.

Regards,
Adrian
Alejandro Enedino Hernandez Samaniego June 25, 2023, 6:56 p.m. UTC | #2
Sounds good to me!, to be fair, I do believe we are moving in the right
direction,
perhaps we're just missing a couple of test cases to expand our testing
spectrum.

Cheers,

Alejandro

On Sun, 25 Jun 2023 at 02:46, <adrian.freihofer@gmail.com> wrote:

> Hi Alejandro
>
> Thank you.
> I will prepare another patch to bring the ifdown script to the same
> level. There is still the <native-sysroot-basedir> parameter. But maybe
> after learning from ifup part of the story, when the autobuilder
> confirmed that everything is consistent again.
>
> Regards,
> Adrian
>
>
diff mbox series

Patch

diff --git a/scripts/runqemu b/scripts/runqemu
index e1aa5a925c..62774a3b98 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -1186,7 +1186,7 @@  to your build configuration.
             gid = os.getgid()
             uid = os.getuid()
             logger.info("Setting up tap interface under sudo")
-            cmd = ('sudo', self.qemuifup, str(uid), str(gid))
+            cmd = ('sudo', self.qemuifup, str(gid))
             try:
                 tap = subprocess.check_output(cmd).decode('utf-8').strip()
             except subprocess.CalledProcessError as e:
diff --git a/scripts/runqemu-ifup b/scripts/runqemu-ifup
index c65ceaf1c8..05c9325b6b 100755
--- a/scripts/runqemu-ifup
+++ b/scripts/runqemu-ifup
@@ -30,7 +30,7 @@  if [ $EUID -ne 0 ]; then
 fi
 
 if [ $# -eq 2 ]; then
-	echo "Warning: uid parameter is ignored. It is no longer needed."
+	echo "Warning: uid parameter is ignored. It is no longer needed." >&2
 	GROUP="$2"
 elif [ $# -eq 1 ]; then
 	GROUP="$1"