-
-
Notifications
You must be signed in to change notification settings - Fork 606
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
imgedit.py can't always connect to qemu-nbd #534
Comments
We could do something similar to osv/scripts/upload_manifest.py Lines 16 to 20 in b3aef65
|
Two years after this issue was opened, imgedit.py was changed in commit 464f4e0 to open a random port in the same way described here. The fact we allow qemu-nbd to default to listening to any IPv4 address but then connect to localhost, remains. The real solution is very simple and described in issue #709: imgedit.py should call qemu-nbd with "-b 127.0.0.1" and connect to 127.0.0.1, instead of localhost. |
Since commit 464f4e0, imgedit.py opens runs qemu-nbd on a random port, but qemu-nbd needlessly listens to all interfaces - including potentially to connections from the outside world. While the practical risk is minimal (imgedit.py runs for very short duration), there is no need to take it at all - qemu-nbd should only listen to the 127.0.0.1 interface (see issue #709). And in turn, imgedit.py should contact 127.0.0.1 and not rely on the alias "localhost" working for ipv4 (see issue #534). Signed-off-by: Nadav Har'El <[email protected]> Message-Id: <[email protected]>
Since commit 464f4e0, imgedit.py opens runs qemu-nbd on a random port, but qemu-nbd needlessly listens to all interfaces - including potentially to connections from the outside world. While the practical risk is minimal (imgedit.py runs for very short duration), there is no need to take it at all - qemu-nbd should only listen to the 127.0.0.1 interface (see issue cloudius-systems#709). And in turn, imgedit.py should contact 127.0.0.1 and not rely on the alias "localhost" working for ipv4 (see issue cloudius-systems#534). Signed-off-by: Nadav Har'El <[email protected]> Message-Id: <[email protected]>
There are a couple of issues with imgedit.py being able to reliably connect to qemu-nbd.
First, it connects to "localhost". On my Fedora20 VM, "localhost" was configured to resolve to ::1, and emu-nbd seems to only listen on IPv4 addresses. I fixed this by editing imgedit.py to connect to "127.0.0.1".
Second, imgedit.py assumes the port number that qemu-nbd is going to listen to. It should be choosing an explicit port and passing that as the argument to the qemu-nbd --port option and to the nbd_client port= argument.
The text was updated successfully, but these errors were encountered: