Accepting request 965607 from home:lizhang:branches:Virtualization

- The patches from upstream cause testsuit failures (bsc#1197150 bsc#1197528)
* Patches added:
  Revert-python-iotests-replace-qmp-with-a.patch
  Revert-python-machine-add-instance-disam.patch
  Revert-python-machine-add-sock_dir-prope.patch
  Revert-python-machine-handle-fast-QEMU-t.patch
  Revert-python-machine-move-more-variable.patch
  Revert-python-machine-remove-_remove_mon.patch

OBS-URL: https://build.opensuse.org/request/show/965607
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=703
This commit is contained in:
Li Zhang 2022-03-29 10:21:23 +00:00 committed by Git OBS Bridge
parent 32cbd20edb
commit 32d2c6bf29
9 changed files with 326 additions and 2 deletions

View File

@ -0,0 +1,39 @@
From: Li Zhang <lizhang@suse.de>
Date: Tue, 29 Mar 2022 12:04:16 +0200
Subject: Revert "python, iotests: replace qmp with aqmp"
References: bsc#1197528 bsc#1197150
aqmp is still not stable, it causes failures.
This reverts commit 76cd358671e6b8e7c435ec65b1c44200254514a9.
Signed-off-by: Li Zhang <lizhang@suse.de>
---
python/qemu/machine/machine.py | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py
index a487c397459a1fa6889276ab2538..a0cf69786b4bb7e851b5eeb2517b 100644
--- a/python/qemu/machine/machine.py
+++ b/python/qemu/machine/machine.py
@@ -41,6 +41,7 @@ from typing import (
)
from qemu.qmp import ( # pylint: disable=import-error
+ QEMUMonitorProtocol,
QMPMessage,
QMPReturnValue,
SocketAddrT,
@@ -49,12 +50,6 @@ from qemu.qmp import ( # pylint: disable=import-error
from . import console_socket
-if os.environ.get('QEMU_PYTHON_LEGACY_QMP'):
- from qemu.qmp import QEMUMonitorProtocol
-else:
- from qemu.aqmp.legacy import QEMUMonitorProtocol
-
-
LOG = logging.getLogger(__name__)

View File

@ -0,0 +1,28 @@
From: Li Zhang <lizhang@suse.de>
Date: Tue, 29 Mar 2022 12:00:29 +0200
Subject: Revert "python/machine: add instance disambiguator to default
nickname"
References: bsc#1197528 bsc#1197150
To improve testsuit, these patches still need more testing.
This reverts commit 72b17fe715056c96ea73f187ab46721788b3a782.
Signed-off-by: Li Zhang <lizhang@suse.de>
---
python/qemu/machine/machine.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py
index ad529fd92a6022150fd0156d005d..ea9e07805df10a57115dace06885 100644
--- a/python/qemu/machine/machine.py
+++ b/python/qemu/machine/machine.py
@@ -133,7 +133,7 @@ class QEMUMachine:
self._wrapper = wrapper
self._qmp_timer = qmp_timer
- self._name = name or f"qemu-{os.getpid()}-{id(self):02x}"
+ self._name = name or "qemu-%d" % os.getpid()
self._temp_dir: Optional[str] = None
self._base_temp_dir = base_temp_dir
self._sock_dir = sock_dir

View File

@ -0,0 +1,70 @@
From: Li Zhang <lizhang@suse.de>
Date: Tue, 29 Mar 2022 12:02:45 +0200
Subject: Revert "python/machine: add @sock_dir property"
References: bsc#1197528 bsc#1197150
To improve testsuit, these patches still need more testing.
This reverts commit 87bf1fe5cbffefe6b7ee13a7015ae285250ad2db.
Signed-off-by: Li Zhang <lizhang@suse.de>
---
python/qemu/machine/machine.py | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py
index b1dd77b53885629eba452cdd1bc2..a487c397459a1fa6889276ab2538 100644
--- a/python/qemu/machine/machine.py
+++ b/python/qemu/machine/machine.py
@@ -134,9 +134,8 @@ class QEMUMachine:
self._qmp_timer = qmp_timer
self._name = name or "qemu-%d" % os.getpid()
- self._temp_dir: Optional[str] = None
self._base_temp_dir = base_temp_dir
- self._sock_dir = sock_dir
+ self._sock_dir = sock_dir or self._base_temp_dir
self._log_dir = log_dir
if monitor_address is not None:
@@ -144,7 +143,7 @@ class QEMUMachine:
self._remove_monitor_sockfile = False
else:
self._monitor_address = os.path.join(
- self.sock_dir, f"{self._name}-monitor.sock"
+ self._sock_dir, f"{self._name}-monitor.sock"
)
self._remove_monitor_sockfile = True
@@ -164,13 +163,14 @@ class QEMUMachine:
self._qmp_set = True # Enable QMP monitor by default.
self._qmp_connection: Optional[QEMUMonitorProtocol] = None
self._qemu_full_args: Tuple[str, ...] = ()
+ self._temp_dir: Optional[str] = None
self._launched = False
self._machine: Optional[str] = None
self._console_index = 0
self._console_set = False
self._console_device_type: Optional[str] = None
self._console_address = os.path.join(
- self.sock_dir, f"{self._name}-console.sock"
+ self._sock_dir, f"{self._name}-console.sock"
)
self._console_socket: Optional[socket.socket] = None
self._remove_files: List[str] = []
@@ -816,15 +816,6 @@ class QEMUMachine:
dir=self._base_temp_dir)
return self._temp_dir
- @property
- def sock_dir(self) -> str:
- """
- Returns the directory used for sockfiles by this machine.
- """
- if self._sock_dir:
- return self._sock_dir
- return self.temp_dir
-
@property
def log_dir(self) -> str:
"""

View File

@ -0,0 +1,66 @@
From: Li Zhang <lizhang@suse.de>
Date: Tue, 29 Mar 2022 11:51:54 +0200
Subject: Revert "python/machine: handle "fast" QEMU terminations"
References: bsc#1197528 bsc#1197150
This patch causes iotest failures, it needs to revert.
This reverts commit 1611e6cf4e7163f6102b37010a8b7e7120f468b5.
Signed-off-by: Li Zhang <lizhang@suse.de>
---
python/qemu/machine/machine.py | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py
index 67ab06ca2b6daa531b7c0ad9f7c2..f92e73de4010d10c9e062259c706 100644
--- a/python/qemu/machine/machine.py
+++ b/python/qemu/machine/machine.py
@@ -349,6 +349,9 @@ class QEMUMachine:
Called to cleanup the VM instance after the process has exited.
May also be called after a failed launch.
"""
+ # Comprehensive reset for the failed launch case:
+ self._early_cleanup()
+
try:
self._close_qmp_connection()
except Exception as err: # pylint: disable=broad-except
@@ -397,16 +400,9 @@ class QEMUMachine:
try:
self._launch()
+ self._launched = True
except:
- # We may have launched the process but it may
- # have exited before we could connect via QMP.
- # Assume the VM didn't launch or is exiting.
- # If we don't wait for the process, exitcode() may still be
- # 'None' by the time control is ceded back to the caller.
- if self._launched:
- self.wait()
- else:
- self._post_shutdown()
+ self._post_shutdown()
LOG.debug('Error launching VM')
if self._qemu_full_args:
@@ -430,7 +426,6 @@ class QEMUMachine:
stderr=subprocess.STDOUT,
shell=False,
close_fds=False)
- self._launched = True
self._post_launch()
def _close_qmp_connection(self) -> None:
@@ -462,8 +457,8 @@ class QEMUMachine:
"""
Perform any cleanup that needs to happen before the VM exits.
- This method may be called twice upon shutdown, once each by soft
- and hard shutdown in failover scenarios.
+ May be invoked by both soft and hard shutdown in failover scenarios.
+ Called additionally by _post_shutdown for comprehensive cleanup.
"""
# If we keep the console socket open, we may deadlock waiting
# for QEMU to exit, while QEMU is waiting for the socket to

View File

@ -0,0 +1,56 @@
From: Li Zhang <lizhang@suse.de>
Date: Tue, 29 Mar 2022 11:57:11 +0200
Subject: Revert "python/machine: move more variable initializations to
_pre_launch"
References: bsc#1197528 bsc#1197150
To improve testsuit, these patches still need more testing.
This reverts commit b1ca99199320fcc010f407b84ac00d96e7e4baa1.
Signed-off-by: Li Zhang <lizhang@suse.de>
---
python/qemu/machine/machine.py | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py
index f92e73de4010d10c9e062259c706..ad529fd92a6022150fd0156d005d 100644
--- a/python/qemu/machine/machine.py
+++ b/python/qemu/machine/machine.py
@@ -327,14 +327,6 @@ class QEMUMachine:
self._qemu_log_path = os.path.join(self.log_dir, self._name + ".log")
self._qemu_log_file = open(self._qemu_log_path, 'wb')
- self._iolog = None
- self._qemu_full_args = tuple(chain(
- self._wrapper,
- [self._binary],
- self._base_args,
- self._args
- ))
-
def _post_launch(self) -> None:
if self._qmp_connection:
self._qmp.accept(self._qmp_timer)
@@ -398,6 +390,8 @@ class QEMUMachine:
if self._launched:
raise QEMUMachineError('VM already launched')
+ self._iolog = None
+ self._qemu_full_args = ()
try:
self._launch()
self._launched = True
@@ -416,6 +410,12 @@ class QEMUMachine:
Launch the VM and establish a QMP connection
"""
self._pre_launch()
+ self._qemu_full_args = tuple(
+ chain(self._wrapper,
+ [self._binary],
+ self._base_args,
+ self._args)
+ )
LOG.debug('VM launch command: %r', ' '.join(self._qemu_full_args))
# Cleaning up of this subprocess is guaranteed by _do_shutdown.

View File

@ -0,0 +1,41 @@
From: Li Zhang <lizhang@suse.de>
Date: Tue, 29 Mar 2022 12:01:34 +0200
Subject: Revert "python/machine: remove _remove_monitor_sockfile property"
References: bsc#1197528 bsc#1197150
To improve testsuit, these patches still need more testing.
This reverts commit 6eeb3de7e1aff91ce6e092a39f85946d12664385.
Signed-off-by: Li Zhang <lizhang@suse.de>
---
python/qemu/machine/machine.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py
index ea9e07805df10a57115dace06885..b1dd77b53885629eba452cdd1bc2 100644
--- a/python/qemu/machine/machine.py
+++ b/python/qemu/machine/machine.py
@@ -141,10 +141,12 @@ class QEMUMachine:
if monitor_address is not None:
self._monitor_address = monitor_address
+ self._remove_monitor_sockfile = False
else:
self._monitor_address = os.path.join(
self.sock_dir, f"{self._name}-monitor.sock"
)
+ self._remove_monitor_sockfile = True
self._console_log_path = console_log
if self._console_log_path:
@@ -313,7 +315,8 @@ class QEMUMachine:
self._remove_files.append(self._console_address)
if self._qmp_set:
- if isinstance(self._monitor_address, str):
+ if self._remove_monitor_sockfile:
+ assert isinstance(self._monitor_address, str)
self._remove_files.append(self._monitor_address)
self._qmp_connection = QEMUMonitorProtocol(
self._monitor_address,

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:4f5bc361cd694767bf6cac686610b0df8d6f39fc7463ba8fe614c3eeb8e0d565 oid sha256:c67f3ecc31706a88b9777641c089555b6f8e7767bda5cd6ad4141353f3bf3e76
size 87984 size 91872

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Tue Mar 29 10:16:18 UTC 2022 - Li Zhang <li.zhang@suse.com>
- The patches from upstream cause testsuit failures (bsc#1197150 bsc#1197528)
* Patches added:
Revert-python-iotests-replace-qmp-with-a.patch
Revert-python-machine-add-instance-disam.patch
Revert-python-machine-add-sock_dir-prope.patch
Revert-python-machine-handle-fast-QEMU-t.patch
Revert-python-machine-move-more-variable.patch
Revert-python-machine-remove-_remove_mon.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Mar 29 09:36:34 UTC 2022 - Dario Faggioli <dfaggioli@suse.com> Tue Mar 29 09:36:34 UTC 2022 - Dario Faggioli <dfaggioli@suse.com>

View File

@ -220,6 +220,12 @@ Patch00073: tests-qemu-iotests-040-Skip-TestCommitWi.patch
Patch00074: tests-qemu-iotests-testrunner-Quote-case.patch Patch00074: tests-qemu-iotests-testrunner-Quote-case.patch
Patch00075: Fix-the-module-building-problem-for-s390.patch Patch00075: Fix-the-module-building-problem-for-s390.patch
Patch00076: scsi-generic-check-for-additional-SG_IO-.patch Patch00076: scsi-generic-check-for-additional-SG_IO-.patch
Patch00077: Revert-python-machine-handle-fast-QEMU-t.patch
Patch00078: Revert-python-machine-move-more-variable.patch
Patch00079: Revert-python-machine-add-instance-disam.patch
Patch00080: Revert-python-machine-remove-_remove_mon.patch
Patch00081: Revert-python-machine-add-sock_dir-prope.patch
Patch00082: Revert-python-iotests-replace-qmp-with-a.patch
# Patches applied in roms/seabios/: # Patches applied in roms/seabios/:
Patch01000: seabios-use-python2-explicitly-as-needed.patch Patch01000: seabios-use-python2-explicitly-as-needed.patch
Patch01001: seabios-switch-to-python3-as-needed.patch Patch01001: seabios-switch-to-python3-as-needed.patch
@ -1219,6 +1225,12 @@ This package records qemu testsuite results and represents successful testing.
%patch00074 -p1 %patch00074 -p1
%patch00075 -p1 %patch00075 -p1
%patch00076 -p1 %patch00076 -p1
%patch00077 -p1
%patch00078 -p1
%patch00079 -p1
%patch00080 -p1
%patch00081 -p1
%patch00082 -p1
%patch01000 -p1 %patch01000 -p1
%patch01001 -p1 %patch01001 -p1
%patch01002 -p1 %patch01002 -p1