Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add downscript to fix free_machine targets #201

Merged
merged 5 commits into from
Nov 22, 2024
Merged

Add downscript to fix free_machine targets #201

merged 5 commits into from
Nov 22, 2024

Conversation

robertvolkmann
Copy link
Contributor

Description

None

@robertvolkmann robertvolkmann requested a review from a team as a code owner November 15, 2024 18:00
@robertvolkmann
Copy link
Contributor Author

@Gerrit91 could you test?

@Gerrit91
Copy link
Contributor

Don't exactly understand why but to me it does not work:

❯ make free-machine01
...
docker exec vms /mini-lab/manage_vms.py --names machine01 kill --with-disks
docker exec vms /mini-lab/manage_vms.py --names machine01 create
Formatting '/machine01.img', fmt=qcow2 size=5368709120 cluster_size=65536 lazy_refcounts=off refcount_bits=16
qemu-system-x86_64 -name machine01 -uuid e0ab02d2-27cd-5a5e-8efc-080ba80cf258 -m 2G -boot n -cpu host -drive if=virtio,format=qcow2,file=/machine01.img -drive if=pflash,format=raw,readonly,file=/usr/share/OVMF/OVMF_CODE.fd -drive if=pflash,format=raw,readonly,file=/usr/share/OVMF/OVMF_VARS.fd -serial telnet:127.0.0.1:4000,server,nowait -enable-kvm -nographic -device virtio-net,netdev=hn0,mac=aa:c1:ab:a2:e8:bd -netdev tap,id=hn0,ifname=tap0,script=/mini-lab/mirror_tap_to_lan.sh,downscript=/mini-lab/remove_mirror.sh -device virtio-net,netdev=hn1,mac=aa:c1:ab:18:a2:da -netdev tap,id=hn1,ifname=tap1,script=/mini-lab/mirror_tap_to_lan.sh,downscript=/mini-lab/remove_mirror.sh &
Error: Exclusivity flag on, cannot modify.
qemu-system-x86_64: network script /mini-lab/mirror_tap_to_lan.sh failed with status 512

But if I do it manually, it works:


❯ docker exec -it d198f8849b8e bash
root@vms:/# tc qdisc del dev lan0 ingress
root@vms:/# tc qdisc del dev lan1 ingress
root@vms:/# exit 
exit
❯ make free-machine01
...
docker exec vms /mini-lab/manage_vms.py --names machine01 kill --with-disks
docker exec vms /mini-lab/manage_vms.py --names machine01 create
Formatting '/machine01.img', fmt=qcow2 size=5368709120 cluster_size=65536 lazy_refcounts=off refcount_bits=16
qemu-system-x86_64 -name machine01 -uuid e0ab02d2-27cd-5a5e-8efc-080ba80cf258 -m 2G -boot n -cpu host -drive if=virtio,format=qcow2,file=/machine01.img -drive if=pflash,format=raw,readonly,file=/usr/share/OVMF/OVMF_CODE.fd -drive if=pflash,format=raw,readonly,file=/usr/share/OVMF/OVMF_VARS.fd -serial telnet:127.0.0.1:4000,server,nowait -enable-kvm -nographic -device virtio-net,netdev=hn0,mac=aa:c1:ab:a2:e8:bd -netdev tap,id=hn0,ifname=tap0,script=/mini-lab/mirror_tap_to_lan.sh,downscript=/mini-lab/remove_mirror.sh -device virtio-net,netdev=hn1,mac=aa:c1:ab:18:a2:da -netdev tap,id=hn1,ifname=tap1,script=/mini-lab/mirror_tap_to_lan.sh,downscript=/mini-lab/remove_mirror.sh &
QEMU 4.2.1 monitor - type 'help' for more information
(qemu) 

@Gerrit91
Copy link
Contributor

Don't you see the same behavior? If so, maybe we need to execute the commands outside the downscript.

@robertvolkmann
Copy link
Contributor Author

robertvolkmann commented Nov 22, 2024

Sending SIGKILL to the QEMU processes prevents the downscript from executing. I have switched it to SIGTERM.

@Gerrit91 Gerrit91 merged commit 5f2450e into master Nov 22, 2024
2 checks passed
@Gerrit91 Gerrit91 deleted the add-downscript branch November 22, 2024 12:18
@Honigeintopf
Copy link

Really nice !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants