From: John Snow <jsnow@redhat.com>
To: Hanna Reitz <hreitz@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>, Thomas Huth <thuth@redhat.com>,
Beraldo Leal <bleal@redhat.com>,
Qemu-block <qemu-block@nongnu.org>,
qemu-devel <qemu-devel@nongnu.org>,
Cleber Rosa <crosa@redhat.com>, Eric Blake <eblake@redhat.com>
Subject: Re: [PATCH v3 4/5] iotests: make qemu_img raise on non-zero rc by default
Date: Thu, 17 Mar 2022 10:23:02 -0400 [thread overview]
Message-ID: <CAFn=p-YST4b-h_Cvy0VTgs2PoiORo0NYx2xpgh4bD+yNCQB4Ww@mail.gmail.com> (raw)
In-Reply-To: <647ef14d-7c41-956b-1dcf-691407594a0b@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2145 bytes --]
On Thu, Mar 17, 2022, 6:41 AM Hanna Reitz <hreitz@redhat.com> wrote:
> On 17.03.22 11:25, Hanna Reitz wrote:
> > On 08.03.22 02:57, John Snow wrote:
> >> re-write qemu_img() as a function that will by default raise a
> >> VerboseProcessException (extended from CalledProcessException) on
> >> non-zero return codes. This will produce a stack trace that will show
> >> the command line arguments and return code from the failed process run.
> >
> > Why not qemu_img_pipe_and_status() as the central function where all
> > qemu-img calls go through?
>
> OK, I see that your follow-up series effectively does this. Still
> wondering why this patch here doesn’t touch qemu_img_pipe_and_status()
> instead.
>
Just a bad habit, I guess. It's the way I wrote this series: add a new
thing, then move the old things over to use it gradually.
This patchset (and the next) is pretty much the order I actually wrote it
in.
I do prefer the shorter name qemu_img() for this fn, tho.
(I struggle a lot with the order I write not being the order most people
prefer for reading. I feel like I've never quite gotten that correct. I
suppose I like to work backwards: start at the code I want and work
backwards until it works again.)
> > It seems like this makes qemu_img() a second version of
> > qemu_img_pipe_and_status(), which is a bit weird.
> >
> > (Or perhaps it should actually be qemu_tool_pipe_and_status() that
> > receives this treatment, with qemu-io functions just passing
> > check=False by default.)
>
> (And perhaps this, but I guess qemu-io is the only other real user of
> qemu_tool_pipe_and_status(), so if it doesn’t care, then there’s no real
> reason to change that function.)
>
Similar reasoning: I'm not actually sure I can justify the change
everywhere yet. I worked through all of qemu-io, but calls to qemu-nbd and
qemu itself are not yet audited.
In the end, that's the goal. Working my way backwards until replacing all
of these functions, yes.
Sorry for my backwards brain, maybe. I felt doing it this way got us the
most benefit the quickest.
> Hanna
>
>
[-- Attachment #2: Type: text/html, Size: 3229 bytes --]
next prev parent reply other threads:[~2022-03-17 14:56 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-08 1:57 [PATCH v3 0/5] iotests: add enhanced debugging info to qemu-img failures John Snow
2022-03-08 1:57 ` [PATCH v3 1/5] python/utils: add add_visual_margin() text decoration utility John Snow
2022-03-17 10:29 ` Hanna Reitz
2022-03-08 1:57 ` [PATCH v3 2/5] python/utils: add VerboseProcessError John Snow
2022-03-17 9:23 ` Hanna Reitz
2022-03-17 15:13 ` John Snow
2022-03-17 15:56 ` Hanna Reitz
2022-03-17 16:31 ` John Snow
2022-03-17 16:34 ` Hanna Reitz
2022-03-17 16:48 ` John Snow
2022-03-08 1:57 ` [PATCH v3 3/5] iotests: Remove explicit checks for qemu_img() == 0 John Snow
2022-03-08 15:15 ` Eric Blake
2022-03-08 17:04 ` John Snow
2022-03-17 10:28 ` Hanna Reitz
2022-03-08 1:57 ` [PATCH v3 4/5] iotests: make qemu_img raise on non-zero rc by default John Snow
2022-03-17 10:25 ` Hanna Reitz
2022-03-17 10:41 ` Hanna Reitz
2022-03-17 14:23 ` John Snow [this message]
2022-03-17 15:24 ` John Snow
2022-03-17 15:58 ` Hanna Reitz
2022-03-17 16:06 ` Hanna Reitz
2022-03-08 1:57 ` [PATCH v3 5/5] iotests: fortify compare_images() against crashes John Snow
2022-03-17 10:28 ` Hanna Reitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAFn=p-YST4b-h_Cvy0VTgs2PoiORo0NYx2xpgh4bD+yNCQB4Ww@mail.gmail.com' \
--to=jsnow@redhat.com \
--cc=bleal@redhat.com \
--cc=crosa@redhat.com \
--cc=eblake@redhat.com \
--cc=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).