[PATCH] MAINTAINERS: Remove myself as reviewer

2024-08-19 Thread Beraldo Leal
igned-off-by: Beraldo Leal --- MAINTAINERS | 3 --- 1 file changed, 3 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 3584d6a6c6..806cf0884d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3174,7 +3174,6 @@ F: qapi/cryptodev.json Python library M: John Snow M: Cleber Rosa -R: Be

Re: [PATCH 1/7] python: support pylint 2.16

2023-02-09 Thread Beraldo Leal
/tests/migrate-bitmaps-postcopy-test > index fc9c4b4ef41..dda55fad284 100755 > --- a/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test > +++ b/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test > @@ -84,7 +84,7 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase): > e['vm'] = 'SRC' > for e in self.vm_b_events: > e['vm'] = 'DST' > -events = (self.vm_a_events + self.vm_b_events) > +events = self.vm_a_events + self.vm_b_events > events = [(e['timestamp']['seconds'], > e['timestamp']['microseconds'], > e['vm'], > -- > 2.39.0 > Reviewed-by: Beraldo Leal -- Beraldo

Re: [qemu.qmp PATCH 12/12] update VERSION to 0.0.0a1

2022-04-29 Thread Beraldo Leal
t; index c19f3b8..7741e1a 100644 > --- a/VERSION > +++ b/VERSION > @@ -1 +1 @@ > -0.6.1.0a1 > +0.0.0a1 > -- > 2.34.1 > Makes sense, Reviewed-by: Beraldo Leal -- Beraldo

Re: [qemu.qmp PATCH 04/12] update project URLs

2022-04-29 Thread Beraldo Leal
On Fri, Apr 22, 2022 at 02:49:32PM -0400, John Snow wrote: > Point to this library's URLs instead of the entire project's. > > Signed-off-by: John Snow > --- > setup.cfg | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/setup.cfg b/setup.cfg > index c21f2ce..0a1c215 1

Re: [qemu.qmp PATCH 03/12] update project description

2022-04-29 Thread Beraldo Leal
On Fri, Apr 22, 2022 at 02:49:31PM -0400, John Snow wrote: > Signed-off-by: John Snow > Reviewed-by: Beraldo Leal > --- > setup.cfg | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/setup.cfg b/setup.cfg > index f06f944..c21f2ce 100644 > --- a/

Re: [qemu.qmp PATCH 07/13] add a couple new trove classifiers

2022-04-01 Thread Beraldo Leal
anguage :: English > Operating System :: OS Independent > @@ -23,6 +24,7 @@ classifiers = > Programming Language :: Python :: 3.8 > Programming Language :: Python :: 3.9 > Programming Language :: Python :: 3.10 > +Topic :: System :: Emulators > Typing :

Re: [qemu.qmp PATCH 05/13] update project description

2022-04-01 Thread Beraldo Leal
ibrary > long_description = file:PACKAGE.rst > long_description_content_type = text/x-rst > classifiers = Reviewed-by: Beraldo Leal -- Beraldo

Re: [PATCH 6/9] tests/avocado/virtiofs_submounts.py: shared_dir may not exist

2022-03-11 Thread Beraldo Leal
ch_dir), > + ignore_error=True) > > def test_pre_virtiofsd_set_up(self): > self.set_up_shared_dir() Reviewed-by: Beraldo Leal -- Beraldo

[PATCH v2] tests/avocado: starts PhoneServer upfront

2022-03-11 Thread Beraldo Leal
guest. Suggested-by: Daniel P. Berrangé Signed-off-by: Beraldo Leal --- tests/avocado/avocado_qemu/__init__.py | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/avocado/avocado_qemu/__init__.py b/tests/avocado/avocado_qemu/__init__.py index 9b056b5ce5

Re: [PATCH] tests/avocado: starts PhoneServer upfront

2022-03-11 Thread Beraldo Leal
On Fri, Mar 11, 2022 at 11:18:38AM -0500, Cleber Rosa wrote: > > Beraldo Leal writes: > > > On Fri, Mar 11, 2022 at 09:28:24AM -0500, Cleber Rosa wrote: > >> > >> Beraldo Leal writes: > >> > >> > Race conditions can happen with the cu

Re: [PATCH] tests/avocado: starts PhoneServer upfront

2022-03-11 Thread Beraldo Leal
On Fri, Mar 11, 2022 at 09:28:24AM -0500, Cleber Rosa wrote: > > Beraldo Leal writes: > > > Race conditions can happen with the current code, because the port that > > was available might not be anymore by the time the server is started. > > > > By setting the p

[PATCH] tests/avocado: starts PhoneServer upfront

2022-03-11 Thread Beraldo Leal
guest. Suggested-by: Daniel P. Berrangé Signed-off-by: Beraldo Leal --- tests/avocado/avocado_qemu/__init__.py | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/avocado/avocado_qemu/__init__.py b/tests/avocado/avocado_qemu/__init__.py index 9b056b5ce5

Re: [PATCH] tests/avocado: Cancel BootLinux tests in case there is no free port

2022-03-07 Thread Beraldo Leal
not self.phone_home_port: > +self.cancel('Failed to get a free port') > pubkey_content = None > if ssh_pubkey: > with open(ssh_pubkey) as pubkey: In any case, this LGTM. Reviewed-by: Beraldo Leal -- Beraldo

Re: [PATCH] Python: discourage direct setup.py install

2022-02-09 Thread Beraldo Leal
gt; +'Please use `pip install .` instead.' > +) > + > + > def main(): > """ > QEMU tooling installer > @@ -16,7 +33,7 @@ def main(): > # > https://medium.com/@daveshawley/safely-using-setup-cfg-for-metadata-1babbe54c108 > pkg_resources.require('setuptools>=39.2') > > -setuptools.setup() > +setuptools.setup(cmdclass={'bdist_egg': bdist_egg_guard}) > > Reviewed-by: Beraldo Leal -- Beraldo

Re: [PATCH] MAINTAINERS: python - remove ehabkost and add bleal

2022-02-09 Thread Beraldo Leal
On Mon, Feb 07, 2022 at 07:05:25PM -0500, John Snow wrote: > Eduardo Habkost has left Red Hat and has other daily responsibilities to > attend to. In order to stop spamming him on every series, remove him as > "Reviewer" for the python/ library dir and add Beraldo Leal in

Re: [PATCH] python: pin setuptools below v60.0.0

2022-01-21 Thread Beraldo Leal
iff --git a/python/setup.cfg b/python/setup.cfg > index 417e937839..aa238d8bc9 100644 > --- a/python/setup.cfg > +++ b/python/setup.cfg > @@ -163,6 +163,7 @@ deps = > .[devel] > .[fuse] # Workaround to trigger tox venv rebuild > .[tui] # Workaround to trigger tox venv rebuild > +setuptools < 60 # Workaround, please see commit msg. > commands = > make check > Reviewed-by: Beraldo Leal -- Beraldo

Re: [PATCH 1/2] python: introduce qmp-shell-wrap convenience tool

2022-01-20 Thread Beraldo Leal
On Tue, Jan 18, 2022 at 06:13:48AM +0100, Philippe Mathieu-Daudé wrote: > On 18/1/22 00:27, John Snow wrote: > > On Mon, Jan 17, 2022 at 9:11 AM Daniel P. Berrangé > > wrote: > > > > > > With the current 'qmp-shell' tool developers must first spawn QEMU with > > > a suitable -qmp arg and then sp

Re: [PATCH v2 2/5] python: use avocado's "new" runner

2022-01-20 Thread Beraldo Leal
; +++ b/python/avocado.cfg > @@ -1,5 +1,5 @@ > [run] > -test_runner = runner > +test_runner = nrunner > > [simpletests] > # Don't show stdout/stderr in the test *summary* Since Avocado 82, the new one is the default. So, you could remove the the "[run]" section. In any case: Reviewed-by: Beraldo Leal -- Beraldo

Re: [PATCH v3 30/31] python: rename qemu.aqmp to qemu.qmp

2022-01-12 Thread Beraldo Leal
.4a20f97db7 100755 > --- a/scripts/qmp/qmp-shell > +++ b/scripts/qmp/qmp-shell > @@ -4,7 +4,7 @@ import os > import sys > > sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', > 'python')) > -from qemu.aqmp import qmp_shell > +from qemu.qmp import qmp_shell > > > if __name__ == '__main__': > diff --git a/scripts/render_block_graph.py b/scripts/render_block_graph.py > index 97778927f3..26f43fef27 100755 > --- a/scripts/render_block_graph.py > +++ b/scripts/render_block_graph.py > @@ -25,8 +25,8 @@ > from graphviz import Digraph > > sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'python')) > -from qemu.aqmp import QMPError > -from qemu.aqmp.legacy import QEMUMonitorProtocol > +from qemu.qmp import QMPError > +from qemu.qmp.legacy import QEMUMonitorProtocol > > > def perm(arr): > diff --git a/scripts/simplebench/bench_block_job.py > b/scripts/simplebench/bench_block_job.py > index af9d1646a4..56191db44b 100755 > --- a/scripts/simplebench/bench_block_job.py > +++ b/scripts/simplebench/bench_block_job.py > @@ -27,7 +27,7 @@ > > sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', > 'python')) > from qemu.machine import QEMUMachine > -from qemu.aqmp import ConnectError > +from qemu.qmp import ConnectError > > > def bench_block_job(cmd, cmd_args, qemu_args): > diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py > index 98bc50cb3a..ded417c8c8 100644 > --- a/tests/qemu-iotests/iotests.py > +++ b/tests/qemu-iotests/iotests.py > @@ -37,7 +37,7 @@ > from contextlib import contextmanager > > from qemu.machine import qtest > -from qemu.aqmp.legacy import QMPMessage > +from qemu.qmp.legacy import QMPMessage > > # Use this logger for logging messages directly from the iotests module > logger = logging.getLogger('qemu.iotests') > diff --git a/tests/qemu-iotests/tests/mirror-top-perms > b/tests/qemu-iotests/tests/mirror-top-perms > index f394931a00..d0b4449b35 100755 > --- a/tests/qemu-iotests/tests/mirror-top-perms > +++ b/tests/qemu-iotests/tests/mirror-top-perms > @@ -21,7 +21,7 @@ > > import os > > -from qemu.aqmp import ConnectError > +from qemu.qmp import ConnectError > from qemu.machine import machine > > import iotests > @@ -99,10 +99,10 @@ class TestMirrorTopPerms(iotests.QMPTestCase): > self.vm_b.add_blockdev(f'file,node-name=drive0,filename={source}') > self.vm_b.add_device('virtio-blk,drive=drive0,share-rw=on') > try: > -# Silence AQMP errors temporarily. > +# Silence QMP errors temporarily. > # TODO: Remove change_log_level and allow the errors to be > logged. > # This necessitates a PID filter on *all* logging output. > -with change_log_level('qemu.aqmp'): > +with change_log_level('qemu.qmp'): > self.vm_b.launch() > print('ERROR: VM B launched successfully, ' >'this should not have happened') > -- > 2.31.1 Reviewed-by: Beraldo Leal -- Beraldo

Re: [PATCH v3 14/31] python/qmp: switch qmp-shell to AQMP

2022-01-12 Thread Beraldo Leal
On Mon, Jan 10, 2022 at 06:28:53PM -0500, John Snow wrote: > We have a replacement for async QMP, but it doesn't have feature parity > yet. For now, then, port the old tool onto the new backend. > > Signed-off-by: John Snow > Reviewed-by: Vladimir Sementsov-Ogievskiy > --- > python/qemu/aqmp/le

Re: [PATCH v3 10/31] python/aqmp: rename AQMPError to QMPError

2022-01-12 Thread Beraldo Leal
On Mon, Jan 10, 2022 at 06:28:49PM -0500, John Snow wrote: > This is in preparation for renaming qemu.aqmp to qemu.qmp. I should have > done this from this from the very beginning, but it's a convenient time > to make sure this churn is taken care of. s/this from this from/this from/ -- Beraldo

Re: [PATCH v3 15/31] python: move qmp utilities to python/qemu/utils

2022-01-12 Thread Beraldo Leal
t; @@ -4,7 +4,7 @@ import os > import sys > > sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', > 'python')) > -from qemu.qmp.qom import QOMSet > +from qemu.utils.qom import QOMSet > > > if __name__ == '__main__': > diff --git a/scripts/qmp/qom-tree b/scripts/qmp/qom-tree > index 7d0ccca3a4..760e172277 100755 > --- a/scripts/qmp/qom-tree > +++ b/scripts/qmp/qom-tree > @@ -4,7 +4,7 @@ import os > import sys > > sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', > 'python')) > -from qemu.qmp.qom import QOMTree > +from qemu.utils.qom import QOMTree > > > if __name__ == '__main__': > -- > 2.31.1 Reviewed-by: Beraldo Leal -- Beraldo

Re: [PATCH v3 16/31] python: move qmp-shell under the AQMP package

2022-01-12 Thread Beraldo Leal
On Mon, Jan 10, 2022 at 06:28:55PM -0500, John Snow wrote: > Signed-off-by: John Snow > Reviewed-by: Vladimir Sementsov-Ogievskiy > Reviewed-by: Beraldo Leal > --- > python/README.rst | 2 +- > python/qemu/{qmp => aqmp}/qmp_shell.py |

Re: [PATCH v3 31/31] python: rename 'aqmp-tui' to 'qmp-tui'

2022-01-12 Thread Beraldo Leal
m-fuse = qemu.utils.qom_fuse:QOMFuse.entry_point [fuse] > qemu-ga-client = qemu.utils.qemu_ga_client:main > qmp-shell = qemu.qmp.qmp_shell:main > -aqmp-tui = qemu.qmp.aqmp_tui:main [tui] > +qmp-tui = qemu.qmp.qmp_tui:main [tui] > > [flake8] > extend-ignore = E722 # Prefer pylint's bare-except checks to flake8's > @@ -83,7 +83,7 @@ namespace_packages = True > # fusepy has no type stubs: > allow_subclassing_any = True > > -[mypy-qemu.qmp.aqmp_tui] > +[mypy-qemu.qmp.qmp_tui] > # urwid and urwid_readline have no type stubs: > allow_subclassing_any = True > > -- > 2.31.1 > Reviewed-by: Beraldo Leal -- Beraldo

Re: [PATCH v3 08/31] python/aqmp: copy type definitions from qmp

2022-01-12 Thread Beraldo Leal
ssl: Optional[SSLContext] = None) -> None: > """ > Acting as the transport server, accept a single connection. > @@ -482,7 +486,7 @@ async def _client_connected_cb(reader: > asyncio.StreamReader, > self.logger.debug("Connection accepted.") > > @upper_half > -async def _do_connect(self, address: Union[str, Tuple[str, int]], > +async def _do_connect(self, address: SocketAddrT, >ssl: Optional[SSLContext] = None) -> None: > """ > Acting as the transport client, initiate a connection to a server. This makes sense to me. Reviewed-by: Beraldo Leal -- Beraldo

Re: [PATCH v3 05/31] python/aqmp: fix docstring typo

2022-01-12 Thread Beraldo Leal
l errors > -raised by this library dervive from `AQMPError`, see `aqmp.error` for > +raised by this library derive from `AQMPError`, see `aqmp.error` for > additional detail. See `aqmp.events` for an in-depth tutorial on > managing QMP events. > """ Reviewed-by: Beraldo Leal -- Beraldo

Re: [PATCH 3/3] python: update type hints for mypy 0.930

2022-01-10 Thread Beraldo Leal
connect() > > @classmethod > -def register(cls, subparsers: Subparsers) -> None: > +def register(cls, subparsers: Any) -> None: > """ > Register this command with the argument parser. > > -- > 2.31.1 > > Reviewed-by: Beraldo Leal -- Beraldo

Re: [PATCH 1/3] python/aqmp: use absolute import statement

2022-01-10 Thread Beraldo Leal
or > from .protocol import ConnectError, Runstate > -- > 2.31.1 > > Reviewed-by: Beraldo Leal -- Beraldo

Re: [PATCH v1 27/34] tests/avocado: add :avocado: tags for some tests

2022-01-10 Thread Beraldo Leal
> +:avocado: tags=arch:x86_64 > """ > def test_qmp_human_info_version(self): > self.vm.add_args('-nodefaults') > diff --git a/tests/avocado/vnc.py b/tests/avocado/vnc.py > index 096432988f..1f80647414 100644 > --- a/tests/avocado/vnc.py > +++ b/tests/avocado/vnc.py > @@ -14,6 +14,7 @@ > class Vnc(QemuSystemTest): > """ > :avocado: tags=vnc,quick > +:avocado: tags=arch:x86_64 > """ > def test_no_vnc(self): > self.vm.add_args('-nodefaults', '-S') > -- > 2.30.2 > Reviewed-by: Beraldo Leal -- Beraldo

Re: [PATCH v2 24/25] python: re-enable pylint duplicate-code warnings

2021-12-16 Thread Beraldo Leal
s this with less false > positives. > no-member, # mypy also handles this better. > -duplicate-code, # To be removed by the end of this patch series. > > [pylint.basic] > # Good variable names which should always be accepted, separated by a comma. Reviewed-by: Beraldo Leal -- Beraldo

Re: [PATCH v2 21/25] python/aqmp: fully separate from qmp.QEMUMonitorProtocol

2021-12-16 Thread Beraldo Leal
(dict) > +@param cmd_id: command id (dict, list, string or int) > +""" > + qmp_cmd: QMPMessage = {'execute': name} > +if args: > +qmp_cmd['arguments'] = args > +if cmd_id: > +qmp_cmd['id'] = cmd_id > +return self.cmd_obj(qmp_cmd) > > def command(self, cmd: str, **kwds: object) -> QMPReturnValue: > return self._sync( Reviewed-by: Beraldo Leal -- Beraldo

Re: [PATCH v2 23/25] python: remove the old QMP package

2021-12-16 Thread Beraldo Leal
nectError: If wait is True but no events could be > -retrieved or if some other error occurred. > - > -@return The list of available QMP events. > -""" > -self.__get_events(wait) > -events = self.__events > -self.__events = [] > -return events > - > -def clear_events(self) -> None: > -""" > -Clear current list of pending events. > -""" > -self.__events = [] > - > -def close(self) -> None: > -""" > -Close the socket and socket file. > -""" > -if self.__sock: > -self.__sock.close() > -if self.__sockfile: > -self.__sockfile.close() > - > -def settimeout(self, timeout: Optional[float]) -> None: > -""" > -Set the socket timeout. > - > -@param timeout (float): timeout in seconds (non-zero), or None. > -@note This is a wrap around socket.settimeout > - > -@raise ValueError: if timeout was set to 0. > -""" > -if timeout == 0: > -msg = "timeout cannot be 0; this engages non-blocking mode." > -msg += " Use 'None' instead to disable timeouts." > -raise ValueError(msg) > -self.__sock.settimeout(timeout) > - > -def send_fd_scm(self, fd: int) -> None: > -""" > -Send a file descriptor to the remote via SCM_RIGHTS. > -""" > -if self.__sock.family != socket.AF_UNIX: > -raise RuntimeError("Can't use SCM_RIGHTS on non-AF_UNIX socket.") > - > -self.__sock.sendmsg( > -[b' '], > -[(socket.SOL_SOCKET, socket.SCM_RIGHTS, struct.pack('@i', fd))] > -) > diff --git a/python/qemu/qmp/py.typed b/python/qemu/qmp/py.typed > deleted file mode 100644 > index e69de29bb2..00 > diff --git a/python/setup.cfg b/python/setup.cfg > index 510df23698..5140a5b322 100644 > --- a/python/setup.cfg > +++ b/python/setup.cfg > @@ -24,10 +24,9 @@ classifiers = > [options] > python_requires = >= 3.6 > packages = > -qemu.qmp > +qemu.aqmp > qemu.machine > qemu.utils > -qemu.aqmp > > [options.package_data] > * = py.typed Reviewed-by: Beraldo Leal -- Beraldo

Re: [PATCH v2 22/25] python/aqmp: copy qmp docstrings to qemu.aqmp.legacy

2021-12-16 Thread Beraldo Leal
] = False) > -> List[QMPMessage]: > return [event] if event is not None else [] > > def clear_events(self) -> None: > +"""Clear current list of pending events.""" > self._aqmp.events.clear() > > def close(self) -> None: > +"""Close the connection.""" > self._sync( > self._aqmp.disconnect() > ) > > def settimeout(self, timeout: Optional[float]) -> None: > +""" > +Set the timeout for QMP RPC execution. > + > +This timeout affects the `cmd`, `cmd_obj`, and `command` methods. > +The `accept`, `pull_event` and `get_event` methods have their > +own configurable timeouts. > + > +:param timeout: > +timeout in seconds, or None. > +None will wait indefinitely. > +""" > self._timeout = timeout > > def send_fd_scm(self, fd: int) -> None: > +""" > +Send a file descriptor to the remote via SCM_RIGHTS. > +""" > self._aqmp.send_fd_scm(fd) > > def __del__(self) -> None: Reviewed-by: Beraldo Leal -- Beraldo

Re: [PATCH v2 20/25] python/aqmp: take QMPBadPortError and parse_address from qemu.qmp

2021-12-16 Thread Beraldo Leal
a file path. > -""" > -components = address.split(':') > - if len(components) == 2: > -try: > -port = int(components[1]) > -except ValueError: > -msg = f"Bad port: '{components[1]}' in '{address}'." > -raise QMPBadPortError(msg) from None > -return (components[0], port) > - > -# Treat as filepath. > -return address > - > def connect(self, negotiate: bool = True) -> Optional[QMPMessage]: > """ > Connect to the QMP Monitor and perform capabilities negotiation. Reviewed-by: Beraldo Leal -- Beraldo

Re: [PATCH v2 18/25] iotests: switch to AQMP

2021-12-16 Thread Beraldo Leal
u.qmp import QMPMessage > +from qemu.aqmp.legacy import QMPMessage > > # Use this logger for logging messages directly from the iotests module > logger = logging.getLogger('qemu.iotests') Reviewed-by: Beraldo Leal -- Beraldo

Re: [PATCH v2 17/25] iotests/mirror-top-perms: switch to AQMP

2021-12-16 Thread Beraldo Leal
> + except ConnectError: > assert 'Is another process using the image' in > self.vm_b.get_log() > > result = self.vm.qmp('block-job-cancel', Reviewed-by: Beraldo Leal -- Beraldo

Re: [PATCH v2 15/25] scripts/render-block-graph: switch to AQMP

2021-12-16 Thread Beraldo Leal
UMonitorProtocol > > > def perm(arr): > @@ -105,7 +103,7 @@ def command(self, cmd): > reply = json.loads(subprocess.check_output(ar)) > > if 'error' in reply: > - raise QMPResponseError(reply) > +raise QMPError(reply) > > return reply['return'] Reviewed-by: Beraldo Leal -- Beraldo

Re: [PATCH v2 16/25] scripts/bench-block-job: switch to AQMP

2021-12-16 Thread Beraldo Leal
job(cmd, cmd_args, qemu_args): > vm.launch() > except OSError as e: > return {'error': 'popen failed: ' + str(e)} > -except (QMPConnectError, ConnectError, socket.timeout): > +except (ConnectError, socket.timeout): > return {'error': 'qemu failed: ' + str(vm.get_log())} > > try: Reviewed-by: Beraldo Leal -- Beraldo

Re: [PATCH v2 12/25] python/machine: permanently switch to AQMP

2021-12-16 Thread Beraldo Leal
/qtest.py > index f2f9aaa5e5..817c8a5425 100644 > --- a/python/qemu/machine/qtest.py > +++ b/python/qemu/machine/qtest.py > @@ -26,7 +26,7 @@ > TextIO, > ) > > -from qemu.qmp import SocketAddrT # pylint: disable=import-error > +from qemu.aqmp.protocol import SocketAddrT > > from .machine import QEMUMachine > Reviewed-by: Beraldo Leal -- Beraldo

Re: [PATCH v2 14/25] scripts/cpu-x86-uarch-abi: switch to AQMP

2021-12-16 Thread Beraldo Leal
s > > if len(sys.argv) != 2: > @@ -66,7 +66,7 @@ > > > sock = sys.argv[1] > -shell = qmp.QEMUMonitorProtocol(sock) > +shell = QEMUMonitorProtocol(sock) > shell.connect() > > models = shell.cmd("query-cpu-definitions") Reviewed-by: Beraldo Leal -- Beraldo

Re: [PATCH v2 08/25] python/qmp: switch qom tools to AQMP

2021-12-16 Thread Beraldo Leal
try: > data = str(self.qmp.command('qom-get', path=path, property=prop)) > data += '\n' # make values shell friendly > -except QMPResponseError as err: > +except ExecuteError as err: > raise FuseOSError(EPERM) from err > > if offset > len(data): Reviewed-by: Beraldo Leal -- Beraldo

Re: [PATCH v2 11/25] python: move qmp-shell under the AQMP package

2021-12-16 Thread Beraldo Leal
s.path.dirname(__file__), '..', '..', > 'python')) > -from qemu.qmp import qmp_shell > +from qemu.aqmp import qmp_shell > > > if __name__ == '__main__': Reviewed-by: Beraldo Leal -- Beraldo

Re: [PATCH v2 07/25] python/qmp: switch qemu-ga-client to AQMP

2021-12-16 Thread Beraldo Leal
tAgentClient(address) > -except OSError as err: > +except ConnectError as err: > print(err) > -if err.errno == errno.ECONNREFUSED: > -print('Hint: qemu is not running?') > +if isinstance(err.exc, ConnectionError): > +print('(Is QEMU running?)') > sys.exit(1) > > if cmd == 'fsfreeze' and args[0] == 'freeze': >From the Python PoV, LGTM: Reviewed-by: Beraldo Leal -- Beraldo

Re: [PATCH v2 04/25] python/aqmp: add SocketAddrT to package root

2021-12-16 Thread Beraldo Leal
nt > > > @@ -48,4 +53,7 @@ > 'ConnectError', > 'ExecuteError', > 'ExecInterruptedError', > + > +# Type aliases > +'SocketAddrT', > ) Reviewed-by: Beraldo Leal -- Beraldo

Re: [PATCH v2 02/25] python/aqmp: handle asyncio.TimeoutError on execute()

2021-12-16 Thread Beraldo Leal
-result = await queue.get() > > try: > +result = await queue.get() > if isinstance(result, ExecInterruptedError): > raise result > return result Reviewed-by: Beraldo Leal -- Beraldo

Re: [PATCH v2 01/25] python/aqmp: add __del__ method to legacy interface

2021-12-16 Thread Beraldo Leal
if we don't raise our > +# own error, the user will be treated to a lot of traceback > +# they might not understand. > +raise AQMPError( > + "QEMUMonitorProtocol.close()" > +" was not called before object was garbage collected" > +) >From the Python PoV, LGTM. Reviewed-by: Beraldo Leal -- Beraldo

Re: [PATCH v4 02/14] tests/avocado: Specify target VM argument to helper routines

2021-12-15 Thread Beraldo Leal
27;\r', vm=vm) > > def exec_command_and_wait_for_pattern(test, command, > - success_message, failure_message=None): > + success_message, failure_message=None, > + vm=None): Same here. Other than that, lgtm. Reviewed-by: Beraldo Leal -- Beraldo

Re: [PATCH] tests/docker: add libfuse3 development headers

2021-12-08 Thread Beraldo Leal
ests/docker/dockerfiles/ubuntu2004.docker > b/tests/docker/dockerfiles/ubuntu2004.docker > index 15a026be09..a46feaecdd 100644 > --- a/tests/docker/dockerfiles/ubuntu2004.docker > +++ b/tests/docker/dockerfiles/ubuntu2004.docker > @@ -34,6 +34,7 @@ ENV PACKAGES \ > libepoxy-dev \ > libfdt-dev \ > libffi-dev \ > +libfuse3-dev \ > libgbm-dev \ > libgcrypt20-dev \ > libglib2.0-dev \ Reviewed-by: Beraldo Leal Tested-by: Beraldo Leal Tested against package names on those repositories. -- Beraldo

Re: [PATCH] MAINTAINERS: Remove me as a reviewer for the build and test/avocado

2021-11-22 Thread Beraldo Leal
On Mon, Nov 22, 2021 at 04:11:24PM -0300, Willian Rampazzo wrote: > Remove me as a reviewer for the Build and test automation and the > Integration Testing with the Avocado Framework and add Beraldo > Leal. > > Signed-off-by: Willian Rampazzo > --- > MAINTAINERS | 4 ++--

Re: [PATCH v2 24/24] python/aqmp: add AsyncProtocol unit tests

2021-07-20 Thread Beraldo Leal
cceptRequireRunning_()) > + > +async def testConnectRequireRunning_(self): > +await self.proto.accept('/not/a/real/path') > + > +await self._prod_session_api( > +Runstate.RUNNING, > +"NullProtocol is already connected and running.", > +accept=False, > +) > + > +def testConnectRequireRunning(self): > +"""Test that connect() cannot be called when Runstate=RUNNING""" > +self._asyncRunner(self.testConnectRequireRunning_()) > + > +async def testAcceptRequireDisconnecting_(self): > +await self.proto.accept('/not/a/real/path') > + > +# Cheat: force a disconnect. > +await self.proto.simulate_disconnect() > + > +await self._prod_session_api( > +Runstate.DISCONNECTING, > +("NullProtocol is disconnecting." > + " Call disconnect() to return to IDLE state."), > +accept=True, > +) > + > +def testAcceptRequireDisconnecting(self): > +"""Test that accept() cannot be called when Runstate=DISCONNECTING""" > +self._asyncRunner(self.testAcceptRequireDisconnecting_()) > + > +async def testConnectRequireDisconnecting_(self): > +await self.proto.accept('/not/a/real/path') > + > +# Cheat: force a disconnect. > +await self.proto.simulate_disconnect() > + > +await self._prod_session_api( > +Runstate.DISCONNECTING, > +("NullProtocol is disconnecting." > + " Call disconnect() to return to IDLE state."), > +accept=False, > +) > + > +def testConnectRequireDisconnecting(self): > +"""Test that connect() cannot be called when > Runstate=DISCONNECTING""" > +self._asyncRunner(self.testConnectRequireDisconnecting_()) > -- > 2.31.1 Besides that, I just would like to bring to the table that Avocado has now a basic support for coroutines as tests that might help here. IIUC, some of the boilerplate code (and duplicated methods) could be removed with this: https://github.com/avocado-framework/avocado/pull/4788 In any case, I understand if the latest version is not an option here, so: Reviewed-by: Beraldo Leal Thanks, -- Beraldo

[Bug 1899082] Re: ReplayKernel.test_x86_64_pc fails intermittently

2021-02-10 Thread Beraldo Leal
I could reproduce this without Avocado: -- #!/bin/bash SOCKET="/tmp/qemu.sock" VMLINUZ_PATH="/tmp/vmlinuz" REPLAY_FILE="/tmp/replay.bin" function run_and_wait() { /usr/bin/qemu-system-x86_64 -display none \ -vga none \

Re: [Avocado-devel] acceptance-system-fedora and acceptance-system-centos failing sporadically with timeout?

2021-02-05 Thread Beraldo Leal
Hi all, I will try to give my two cents: On Fri, Feb 05, 2021 at 03:31:40PM -0500, John Snow wrote: > On 2/5/21 11:43 AM, Philippe Mathieu-Daudé wrote: > > Cc'ing Avocado team & John (Python inferior exit delay?). > > > > On 1/28/21 11:10 AM, Thomas Huth wrote: > > > On 28/01/2021 10.45, Claudio

Re: [PATCH 16/22] Acceptance Tests: introduce method for requiring an accelerator

2021-02-04 Thread Beraldo Leal
hanged, 34 insertions(+), 29 deletions(-) Reviewed-by: Beraldo Leal

Re: [PATCH 08/22] tests/acceptance/virtiofs_submounts.py: standardize port as integer

2021-02-04 Thread Beraldo Leal
self.ssh_logger = logging.getLogger('ssh') > port = self.get_portfwd() > -self.ssh_session = ssh.Session('127.0.0.1', port=int(port), > +self.ssh_session = ssh.Session('127.0.0.1', port=port, > user=username, key=keyfile) > for i in range(10): > try: > -- > 2.25.4 > Reviewed-by: Beraldo Leal

Re: [PATCH 07/22] tests/acceptance/virtiofs_submounts.py: evaluate string not length

2021-02-04 Thread Beraldo Leal
Test, self).setUp(pubkey) > > -if len(vmlinuz) > 0: > +if vmlinuz: > self.vm.add_args('-kernel', vmlinuz, > '-append', 'console=ttyS0 root=/dev/sda1') > > -- > 2.25.4 > Reviewed-by: Beraldo Leal

Re: [PATCH 05/22] tests/acceptance/virtiofs_submounts.py: do not ask for ssh key password

2021-02-04 Thread Beraldo Leal
;ed25519', '-f', self.ssh_key)) > +self.run(('ssh-keygen', '-N', '', '-t', 'ed25519', '-f', > self.ssh_key)) > > pubkey = open(self.ssh_key + '.pub').read() > > -- > 2.25.4 > Reviewed-by: Beraldo Leal

Re: [PATCH 04/22] tests/acceptance/virtiofs_submounts.py: use workdir property

2021-02-04 Thread Beraldo Leal
gt; +self.ssh_key = os.path.join(self.workdir, 'id_ed25519') > > self.run(('ssh-keygen', '-t', 'ed25519', '-f', self.ssh_key)) > > -- > 2.25.4 > Reviewed-by: Beraldo Leal

Re: [PATCH 02/22] tests/acceptance/boot_linux.py: rename misleading cloudinit method

2021-02-04 Thread Beraldo Leal
t; -cloudinit_iso = self.download_cloudinit(ssh_pubkey) > +def set_up_cloudinit(self, ssh_pubkey=None): > +cloudinit_iso = self.prepare_cloudinit(ssh_pubkey) > self.vm.add_args('-drive', 'file=%s,format=raw' % cloudinit_iso) > > def launch_and_wait(self): > -- > 2.25.4 > Reviewed-by: Beraldo Leal

Re: [PATCH 01/22] tests/acceptance/boot_linux.py: fix typo on cloudinit error message

2021-02-04 Thread Beraldo Leal
On Wed, Feb 03, 2021 at 12:23:36PM -0500, Cleber Rosa wrote: > Signed-off-by: Cleber Rosa > --- > tests/acceptance/boot_linux.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Beraldo Leal

Re: [PATCH v2 04/38] qapi: Prefer explicit relative imports

2020-09-24 Thread Beraldo Leal
On Thu, Sep 24, 2020 at 03:25:50PM -0400, Cleber Rosa wrote: > On Wed, Sep 23, 2020 at 01:12:09PM -0400, John Snow wrote: > > On 9/23/20 9:18 AM, Cleber Rosa wrote: > > > Relative imports are a source of heated debates, but when properly > > > used in a self contained module like here, they are ver