qrap(1)

πŸ“¦
version 20250415.2340bbf Β· 3 versions
, in alpine 3.24, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute

πŸ’– qrap β€” the temporary qemu wrapper (from the General Commands Manual, section 1) πŸ’–

okay bestie, gather round, because qrap is one of those little glue scripts that's lowkey carrying the whole vibe check. it connects a UNIX domain socket to a file descriptor and then yeets qemu into existence. temporary queen behavior, honestly. πŸ‘‘


✨ NAME ✨

qrap β€” a temporary qemu wrapper that connects a UNIX domain socket to a file descriptor πŸ¦‹


🌸 SYNOPSIS 🌸

qrap [FDNUM QEMU_CMD] [QEMU_ARG]...

πŸ’… DESCRIPTION πŸ’…

so qrap is a wrapper, and it was designed specifically to be used with qemu(1) and passt(1). what it does is connect a UNIX domain socket to a file descriptor, and then run qemu(1) with whatever arguments you handed it. it's giving personal assistant energy. πŸŽ€

when qrap goes looking, it probes a running instance of passt(1) by checking for UNIX domain sockets that answer a dummy ARP request. those sockets have names starting from /tmp/passt_1.socket all the way up to /tmp/passt_64.socket. yes, sixty-four of them. it's thorough. πŸ’–

now, if the first and second arguments are not a socket number and a command β€” that is, respectively, FDNUM and QEMU_CMD β€” then qrap will go hunting for a qemu executable in PATH, and it will patch the command line for you so that a network device and a netdev back-end get specified for usage with passt(1). so helpful. so thoughtful. 🫢

and if qrap does patch the command line, it will remove any potentially conflicting network device. that means any -netdev or -net option, or any -device option whose argument starts with virtio-net-pci,, virtio-net-ccw,, e1000,, e1000e,, or rtl8139,. it clears the old ones out of the way first, no cap. 🧹✨

🌈 EXAMPLES 🌈

Start qemu explicitly passing its command name and a socket number β€” here you're telling it exactly what you want:

$ ./qrap 5 kvm test.qcow2 -m 1024 -display none -nodefaults -nographic -net socket,fd=5 -net nic,model=virtio

Start qemu without command name and socket number, patching arguments β€” here you let qrap do its little magic trick and patch things for you:

$ ./qrap test.qcow2 -m 1024 -display none -nodefaults -nographic

πŸ’€ NOTES πŸ’€

this wrapper is temporary, bestie. like, genuinely temporary. qemu commit 13c6be96618c ("net: stream: add unix socket") introduces native AF_UNIX socket support, and it should be included in qemu starting from the 7.2 release. πŸ‘€

so qrap will be around for a little bit longer, just to give users enough time to switch over. it's the loyal friend who stays until everyone's safely home. πŸ˜­πŸ’œ


πŸ‘‘ AUTHOR πŸ‘‘

Stefano Brivio <sbrivio@redhat.com>


πŸ™ˆ REPORTING BUGS πŸ™ˆ

there is no public bug tracker available at this time. for the moment being, report issues to Stefano Brivio <sbrivio@redhat.com>. slide into the email, not the DMs. πŸ“§


Copyright (c) 2020-2021 Red Hat GmbH.

qrap is free software: you can redistribute is and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.

πŸ”₯ SEE ALSO πŸ”₯

high-level documentation is available at https://passt.top/passt/about/. go read it, it's iconic. 🌟


and that's the whole page, bestie β€” <pink>qrap(1)</pink>, straight out of the General Commands Manual, section 1. mwah. πŸ’…πŸ’–

πŸ“¦ where this page comes from