| dee01b82 | 10-May-2023 |
John Snow <jsnow@redhat.com> |
mkvenv: add nested venv workaround
Python virtual environments do not typically nest; they may inherit from the top-level system packages or not at all.
For our purposes, it would be convenient to
mkvenv: add nested venv workaround
Python virtual environments do not typically nest; they may inherit from the top-level system packages or not at all.
For our purposes, it would be convenient to emulate "nested" virtual environments to allow callers of the configure script to install specific versions of python utilities in order to test build system features, utility version compatibility, etc.
While it is possible to install packages into the system environment (say, by using the --user flag), it's nicer to install test packages into a totally isolated environment instead.
As detailed in https://www.qemu.org/2023/03/24/python/, Emulate a nested venv environment by using .pth files installed into the site-packages folder that points to the parent environment when appropriate.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com> Message-Id: <20230511035435.734312-6-jsnow@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
| a9dbde71 | 16-May-2023 |
John Snow <jsnow@redhat.com> |
mkvenv: add better error message for broken or missing ensurepip
Debian debundles ensurepip for python; NetBSD debundles pyexpat but ensurepip needs pyexpat. Try our best to offer a helpful error me
mkvenv: add better error message for broken or missing ensurepip
Debian debundles ensurepip for python; NetBSD debundles pyexpat but ensurepip needs pyexpat. Try our best to offer a helpful error message instead of just failing catastrophically.
Signed-off-by: John Snow <jsnow@redhat.com> Message-Id: <20230511035435.734312-5-jsnow@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
| dd84028f | 10-May-2023 |
John Snow <jsnow@redhat.com> |
python: add mkvenv.py
This script will be responsible for building a lightweight Python virtual environment at configure time. It works with Python 3.6 or newer.
It has been designed to: - work *of
python: add mkvenv.py
This script will be responsible for building a lightweight Python virtual environment at configure time. It works with Python 3.6 or newer.
It has been designed to: - work *offline*, no PyPI required. - work *quickly*, The fast path is only ~65ms on my machine. - work *robustly*, with multiple fallbacks to keep things working. - work *cooperatively*, using system packages where possible. (You can use your distro's meson, no problem.)
Due to its unique position in the build chain, it exists outside of the installable python packages in-tree and *must* be runnable without any third party dependencies.
Under normal circumstances, the only dependency required to execute this script is Python 3.6+ itself. The script is *faster* by several seconds when setuptools and pip are installed in the host environment, which is probably the case for a typical multi-purpose developer workstation.
In the event that pip/setuptools are missing or not usable, additional dependencies may be required on some distributions which remove certain Python stdlib modules to package them separately:
- Debian may require python3-venv to provide "ensurepip" - NetBSD may require py310-expat to provide "pyexpat" * (* Or whichever version is current for NetBSD.)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com> Message-Id: <20230511035435.734312-4-jsnow@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
| 6c2537d3 | 10-May-2023 |
John Snow <jsnow@redhat.com> |
python: update pylint configuration
Pylint 2.17.x decided that SocketAddrT was a bad name for a Type Alias for some reason. Sure, fine, whatever.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewe
python: update pylint configuration
Pylint 2.17.x decided that SocketAddrT was a bad name for a Type Alias for some reason. Sure, fine, whatever.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20230511035435.734312-3-jsnow@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
| 6832189f | 09-Feb-2023 |
John Snow <jsnow@redhat.com> |
python: drop pipenv
The pipenv tool was nice in theory, but in practice it's just too hard to update selectively, and it makes using it a pain. The qemu.qmp repo dropped pipenv support a while back
python: drop pipenv
The pipenv tool was nice in theory, but in practice it's just too hard to update selectively, and it makes using it a pain. The qemu.qmp repo dropped pipenv support a while back and it's been functioning just fine, so I'm backporting that change here to qemu.git.
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20230210003147.1309376-3-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| bd4c0ef4 | 11-Jan-2023 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
python/qemu/machine: use socketpair() for QMP by default
When no monitor address is given, establish the QMP communication through a socketpair() (API is also supported on Windows since Python 3.5)
python/qemu/machine: use socketpair() for QMP by default
When no monitor address is given, establish the QMP communication through a socketpair() (API is also supported on Windows since Python 3.5)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-id: 20230111080101.969151-4-marcandre.lureau@redhat.com [Resolved conflicts, fixed typing error. --js] Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| 603a3bad | 11-Jan-2023 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
python/qmp/legacy: make QEMUMonitorProtocol accept a socket
Teach QEMUMonitorProtocol to accept an exisiting socket.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Dani
python/qmp/legacy: make QEMUMonitorProtocol accept a socket
Teach QEMUMonitorProtocol to accept an exisiting socket.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-id: 20230111080101.969151-3-marcandre.lureau@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| a3cfea92 | 11-Jan-2023 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
python/qmp/protocol: add open_with_socket()
Instead of listening for incoming connections with a SocketAddr, add a new method open_with_socket() that accepts an existing socket.
Signed-off-by: Marc
python/qmp/protocol: add open_with_socket()
Instead of listening for incoming connections with a SocketAddr, add a new method open_with_socket() that accepts an existing socket.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-id: 20230111080101.969151-2-marcandre.lureau@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| 166464c6 | 12-Jan-2023 |
Maksim Davydov <davydov-max@yandex-team.ru> |
python/qmp: increase read buffer size
Current 256KB is not enough for some real cases. As a possible solution limit can be chosen to be the same as libvirt (10MB)
Signed-off-by: Maksim Davydov <dav
python/qmp: increase read buffer size
Current 256KB is not enough for some real cases. As a possible solution limit can be chosen to be the same as libvirt (10MB)
Signed-off-by: Maksim Davydov <davydov-max@yandex-team.ru> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20230112152805.33109-3-davydov-max@yandex-team.ru Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| f9922937 | 10-Jan-2023 |
Peter Delevoryas <peter@pjd.dev> |
python/machine: Fix AF_UNIX path too long on macOS
On macOS, private $TMPDIR's are the default. These $TMPDIR's are generated from a user's unix UID and UUID [1], which can create a relatively long
python/machine: Fix AF_UNIX path too long on macOS
On macOS, private $TMPDIR's are the default. These $TMPDIR's are generated from a user's unix UID and UUID [1], which can create a relatively long path:
/var/folders/d7/rz20f6hd709c1ty8f6_6y_z40000gn/T/
QEMU's avocado tests create a temporary directory prefixed by "avo_qemu_sock_", and create QMP sockets within _that_ as well. The QMP socket is unnecessarily long, because a temporary directory is created for every QEMUMachine object.
/avo_qemu_sock_uh3w_dgc/qemu-37331-10bacf110-monitor.sock
The path limit for unix sockets on macOS is 104: [2]
/* * [XSI] Definitions for UNIX IPC domain. */ struct sockaddr_un { unsigned char sun_len; /* sockaddr len including null */ sa_family_t sun_family; /* [XSI] AF_UNIX */ char sun_path[104]; /* [XSI] path name (gag) */ };
This results in avocado tests failing on macOS because the QMP unix socket can't be created, because the path is too long:
ERROR| Failed to establish connection: OSError: AF_UNIX path too long
This change resolves by reducing the size of the socket directory prefix and the suffix on the QMP and console socket names.
The result is paths like this:
pdel@pdel-mbp:/var/folders/d7/rz20f6hd709c1ty8f6_6y_z40000gn/T $ tree qemu* qemu_df4evjeq qemu_jbxel3gy qemu_ml9s_gg7 qemu_oc7h7f3u qemu_oqb1yf97 ├── 10a004050.con └── 10a004050.qmp
[1] https://apple.stackexchange.com/questions/353832/why-is-mac-osx-temp-directory-in-weird-path [2] /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/sys/un.h
Signed-off-by: Peter Delevoryas <peter@pjd.dev> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20230110082930.42129-2-peter@pjd.dev Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| ada73a49 | 24-Jun-2022 |
Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> |
python: QEMUMachine: enable qmp accept timeout by default
I've spent much time trying to debug hanging pipeline in gitlab. I started from and idea that I have problem in code in my series (which has
python: QEMUMachine: enable qmp accept timeout by default
I've spent much time trying to debug hanging pipeline in gitlab. I started from and idea that I have problem in code in my series (which has some timeouts). Finally I found that the problem is that I've used QEMUMachine class directly to avoid qtest, and didn't add necessary arguments. Qemu fails and we wait for qmp accept endlessly. In gitlab it's just stopped by timeout (one hour) with no sign of what's going wrong.
With timeout enabled, gitlab don't wait for an hour and prints all needed information.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Reviewed-by: John Snow <jsnow@redhat.com> Message-Id: <20220624195252.175249-1-vsementsov@yandex-team.ru> [Fixed typing. --js] Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| 519f3cfc | 02-Dec-2022 |
John Snow <jsnow@redhat.com> |
python: add 3.11 to supported list
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Wilfred Mallawa <wilfred.mallawa@wdc.com> Message-id: 20221203005234.620788-4-jsnow@redhat.com Signed-off-
python: add 3.11 to supported list
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Wilfred Mallawa <wilfred.mallawa@wdc.com> Message-id: 20221203005234.620788-4-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| 745d58f7 | 02-Dec-2022 |
John Snow <jsnow@redhat.com> |
Python: fix flake8 config
Newer flake8 versions are a bit pickier about the config file, and my in-line comment confuses the parser. Fix it.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by:
Python: fix flake8 config
Newer flake8 versions are a bit pickier about the config file, and my in-line comment confuses the parser. Fix it.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Wilfred Mallawa <wilfred.mallawa@wdc.com> Message-id: 20221203005234.620788-2-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| 3c6e5e8c | 27-Oct-2022 |
John Snow <jsnow@redhat.com> |
python/machine: Handle termination cases without QMP
If we request a shutdown of a VM without a QMP console, we'll just hang waiting. Not ideal.
Add in code that attempts graceful termination in th
python/machine: Handle termination cases without QMP
If we request a shutdown of a VM without a QMP console, we'll just hang waiting. Not ideal.
Add in code that attempts graceful termination in these cases. Tested lightly; it appears to work and I doubt we rely on this case anywhere, but it's a corner you're allowed to wedge yourself in, so it should be handled.
Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| 47430775 | 30-Mar-2022 |
John Snow <jsnow@redhat.com> |
python/qmp: remove pylint workaround from legacy.py
Pylint upgraded recently (2.13.z) and having a pylint: disable comment in the middle of an argument field causes it some grief (It appears to stop
python/qmp: remove pylint workaround from legacy.py
Pylint upgraded recently (2.13.z) and having a pylint: disable comment in the middle of an argument field causes it some grief (It appears to stop parsing when it encounters it, causing some syntax problems). Since the duplicate line threshold was bumped up in 22305c2a081b, we don't need this workaround anymore. Drop it.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@openvz.org> Message-id: 20220330172812.3427355-10-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| b1a9b1f7 | 30-Mar-2022 |
John Snow <jsnow@redhat.com> |
python: rename 'aqmp-tui' to 'qmp-tui'
This is the last vestige of the "aqmp" moniker surviving in the tree; remove it.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Beraldo Leal <bleal@
python: rename 'aqmp-tui' to 'qmp-tui'
This is the last vestige of the "aqmp" moniker surviving in the tree; remove it.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Beraldo Leal <bleal@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@openvz.org> Message-id: 20220330172812.3427355-9-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|