Re: [PATCH 13/15] iotests: remove qemu_io_pipe_and_status()

2022-03-22 Thread John Snow
On Tue, Mar 22, 2022 at 12:39 PM Hanna Reitz  wrote:
>
> On 18.03.22 21:36, John Snow wrote:
> > I know we just added it, sorry. This is done in favor of qemu_io() which
> > *also* returns the console output and status, but with more robust error
> > handling on failure.
> >
> > Signed-off-by: John Snow 
> > ---
> >   tests/qemu-iotests/iotests.py   |  3 ---
> >   tests/qemu-iotests/tests/image-fleecing | 12 +++-
> >   2 files changed, 3 insertions(+), 12 deletions(-)
>
> Reviewed-by: Hanna Reitz 

I goofed this patch -- some of the failures in this test are expected
and this patch breaks the test. Dropping the R-Bs. v2 will explain
what's up in the commit message.

--js




Re: [PATCH 13/15] iotests: remove qemu_io_pipe_and_status()

2022-03-22 Thread Hanna Reitz

On 18.03.22 21:36, John Snow wrote:

I know we just added it, sorry. This is done in favor of qemu_io() which
*also* returns the console output and status, but with more robust error
handling on failure.

Signed-off-by: John Snow 
---
  tests/qemu-iotests/iotests.py   |  3 ---
  tests/qemu-iotests/tests/image-fleecing | 12 +++-
  2 files changed, 3 insertions(+), 12 deletions(-)


Reviewed-by: Hanna Reitz 




Re: [PATCH 13/15] iotests: remove qemu_io_pipe_and_status()

2022-03-21 Thread Eric Blake
On Fri, Mar 18, 2022 at 04:36:53PM -0400, John Snow wrote:
> I know we just added it, sorry. This is done in favor of qemu_io() which
> *also* returns the console output and status, but with more robust error
> handling on failure.
> 
> Signed-off-by: John Snow 
> ---
>  tests/qemu-iotests/iotests.py   |  3 ---
>  tests/qemu-iotests/tests/image-fleecing | 12 +++-
>  2 files changed, 3 insertions(+), 12 deletions(-)

Reviewed-by: Eric Blake 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.   +1-919-301-3266
Virtualization:  qemu.org | libvirt.org




[PATCH 13/15] iotests: remove qemu_io_pipe_and_status()

2022-03-18 Thread John Snow
I know we just added it, sorry. This is done in favor of qemu_io() which
*also* returns the console output and status, but with more robust error
handling on failure.

Signed-off-by: John Snow 
---
 tests/qemu-iotests/iotests.py   |  3 ---
 tests/qemu-iotests/tests/image-fleecing | 12 +++-
 2 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 58ea766568..e8f38e7ad3 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -365,9 +365,6 @@ def qemu_io(*args: str, check: bool = True, combine_stdio: 
bool = True
 return qemu_tool(*qemu_io_wrap_args(args),
  check=check, combine_stdio=combine_stdio)
 
-def qemu_io_pipe_and_status(*args):
-return qemu_tool_pipe_and_status('qemu-io', qemu_io_wrap_args(args))
-
 def qemu_io_log(*args: str) -> subprocess.CompletedProcess[str]:
 result = qemu_io(*args, check=False)
 log(result.stdout, filters=[filter_testfiles, filter_qemu_io])
diff --git a/tests/qemu-iotests/tests/image-fleecing 
b/tests/qemu-iotests/tests/image-fleecing
index b7e5076104..07a4ea7bc4 100755
--- a/tests/qemu-iotests/tests/image-fleecing
+++ b/tests/qemu-iotests/tests/image-fleecing
@@ -23,8 +23,7 @@
 # Creator/Owner: John Snow 
 
 import iotests
-from iotests import log, qemu_img, qemu_io, qemu_io_silent, \
-qemu_io_pipe_and_status
+from iotests import log, qemu_img, qemu_io, qemu_io_silent
 
 iotests.script_initialize(
 supported_fmts=['qcow2'],
@@ -185,10 +184,7 @@ def do_test(vm, use_cbw, use_snapshot_access_filter, 
base_img_path,
 for p in patterns + zeroes:
 cmd = 'read -P%s %s %s' % p
 log(cmd)
-out, ret = qemu_io_pipe_and_status('-r', '-f', 'raw', '-c', cmd,
-   nbd_uri)
-if ret != 0:
-print(out)
+qemu_io('-r', '-f', 'raw', '-c', cmd, nbd_uri)
 
 log('')
 log('--- Testing COW ---')
@@ -228,9 +224,7 @@ def do_test(vm, use_cbw, use_snapshot_access_filter, 
base_img_path,
 args += [target_img_path]
 else:
 args += ['-f', 'raw', nbd_uri]
-out, ret = qemu_io_pipe_and_status(*args)
-if ret != 0:
-print(out)
+qemu_io(*args)
 
 log('')
 log('--- Cleanup ---')
-- 
2.34.1