From: Kevin Wolf <kwolf@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Cc: jsnow@redhat.com, qemu-devel@nongnu.org, qemu-block@nongnu.org,
mreitz@redhat.com
Subject: Re: [PATCH v2 4/4] iotests: Mirror with different source/target size
Date: Wed, 13 May 2020 16:21:53 +0200 [thread overview]
Message-ID: <20200513142153.GI6202@linux.fritz.box> (raw)
In-Reply-To: <bb5b1e29-652f-6765-edb7-55a7fb63328d@virtuozzo.com>
Am 13.05.2020 um 13:17 hat Vladimir Sementsov-Ogievskiy geschrieben:
> 11.05.2020 16:58, Kevin Wolf wrote:
> > This tests that the mirror job catches situations where the target node
> > has a different size than the source node. It must also forbid resize
> > operations when the job is already running.
> >
> > Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> > Message-Id: <20200507145228.323412-4-kwolf@redhat.com>
> > Reviewed-by: Eric Blake <eblake@redhat.com>
> > Signed-off-by: Kevin Wolf <kwolf@redhat.com>
>
> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>
> > ---
> > tests/qemu-iotests/041 | 45 ++++++++++++++++++++++++++++++++++++++
> > tests/qemu-iotests/041.out | 4 ++--
> > 2 files changed, 47 insertions(+), 2 deletions(-)
> >
> > diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041
> > index 1812dd8479..601c756117 100755
> > --- a/tests/qemu-iotests/041
> > +++ b/tests/qemu-iotests/041
> > @@ -240,6 +240,49 @@ class TestSingleBlockdev(TestSingleDrive):
>
>
> Hmm, probably resize tests would be good in the TestSingleDrive, to
> cover drive-mirror too. Still, there shouldn't be any difference.. So,
> I don't think it worth doing.
At first, I tried to do a single implementation that works for both, but
it wasn't easily possible. I'm not sure any more if it was the only
problem, but at least drive-mirror targets don't have a known node-name,
so we would have to guess it from query-named-block-nodes. Not
impossible, but maybe not worth it...
> > target=self.qmp_target)
> > self.assert_qmp(result, 'error/class', 'GenericError')
> > + def do_test_resize(self, device, node):
> > + def pre_finalize():
>
> [..]
>
> > + def do_test_target_size(self, size):
> > + result = self.vm.qmp('block_resize', node_name=self.qmp_target,
> > + size=size)
> > + self.assert_qmp(result, 'return', {})
> > +
> > + result = self.vm.qmp(self.qmp_cmd, job_id='job0',
> > + device='drive0', sync='full', auto_dismiss=False,
> > + target=self.qmp_target)
> > + self.assert_qmp(result, 'return', {})
> > +
> > + result = self.vm.run_job('job0')
> > + self.assertEqual(result, 'Source and target image have different sizes')
>
> Hmm, and this proves, that we are not very good with handling early
> errors. A lot better would be to fail earlier, on blockdev-mirror
> command. And, as shown by your previous series, backup works better in
> this case. But again, it's for another series.
At least it shows that errp does make it to the client. :-)
I'm not sure which way is currently better. QMP handlers are still
synchronous code that blocks the rest of QEMU, so doing things only
inside the coroutine does have some benefits. Maybe with coroutine QMP
handlers this will become less of a concern, though.
Kevin
prev parent reply other threads:[~2020-05-13 14:22 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-11 13:58 [PATCH v2 0/4] mirror: Make sure that source and target size match Kevin Wolf
2020-05-11 13:58 ` [PATCH v2 1/4] iotests/109: Don't mirror with mismatched size Kevin Wolf
2020-05-11 15:08 ` Max Reitz
2020-05-11 15:29 ` Kevin Wolf
2020-05-11 15:37 ` Max Reitz
2020-05-12 15:00 ` Vladimir Sementsov-Ogievskiy
2020-05-11 13:58 ` [PATCH v2 2/4] iotests/229: Use blkdebug to inject an error Kevin Wolf
2020-05-11 15:18 ` Max Reitz
2020-05-11 15:33 ` Kevin Wolf
2020-05-12 15:54 ` Vladimir Sementsov-Ogievskiy
2020-05-11 13:58 ` [PATCH v2 3/4] mirror: Make sure that source and target size match Kevin Wolf
2020-05-11 15:32 ` Max Reitz
2020-05-12 17:15 ` Vladimir Sementsov-Ogievskiy
2020-05-12 17:16 ` Vladimir Sementsov-Ogievskiy
2020-05-12 18:48 ` Kevin Wolf
2020-05-13 10:44 ` Vladimir Sementsov-Ogievskiy
2020-05-11 13:58 ` [PATCH v2 4/4] iotests: Mirror with different source/target size Kevin Wolf
2020-05-11 15:42 ` Max Reitz
2020-05-13 11:17 ` Vladimir Sementsov-Ogievskiy
2020-05-13 14:21 ` Kevin Wolf [this message]
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=20200513142153.GI6202@linux.fritz.box \
--to=kwolf@redhat.com \
--cc=jsnow@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.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).