qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qemu-iotests: Test streaming with missing job ID
@ 2017-05-15 12:39 Kevin Wolf
  2017-05-15 12:46 ` Alberto Garcia
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Kevin Wolf @ 2017-05-15 12:39 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, berto, kchamart, qemu-devel

This adds a small test for the image streaming error path for failing
block_job_create(), which would have found the null pointer dereference
in commit a170a91f.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/qemu-iotests/030     | 4 ++++
 tests/qemu-iotests/030.out | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
index e00c11b..feee861 100755
--- a/tests/qemu-iotests/030
+++ b/tests/qemu-iotests/030
@@ -147,6 +147,10 @@ class TestSingleDrive(iotests.QMPTestCase):
         result = self.vm.qmp('block-stream', device='nonexistent')
         self.assert_qmp(result, 'error/class', 'GenericError')
 
+    def test_job_id_missing(self):
+        result = self.vm.qmp('block-stream', device='mid')
+        self.assert_qmp(result, 'error/class', 'GenericError')
+
 
 class TestParallelOps(iotests.QMPTestCase):
     num_ops = 4 # Number of parallel block-stream operations
diff --git a/tests/qemu-iotests/030.out b/tests/qemu-iotests/030.out
index 84bfd63..391c857 100644
--- a/tests/qemu-iotests/030.out
+++ b/tests/qemu-iotests/030.out
@@ -1,5 +1,5 @@
-......................
+.......................
 ----------------------------------------------------------------------
-Ran 22 tests
+Ran 23 tests
 
 OK
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu-iotests: Test streaming with missing job ID
  2017-05-15 12:39 [Qemu-devel] [PATCH] qemu-iotests: Test streaming with missing job ID Kevin Wolf
@ 2017-05-15 12:46 ` Alberto Garcia
  2017-05-15 13:05   ` Kevin Wolf
  2017-05-17  7:39 ` Kashyap Chamarthy
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Alberto Garcia @ 2017-05-15 12:46 UTC (permalink / raw)
  To: Kevin Wolf, qemu-block; +Cc: kchamart, qemu-devel

On Mon 15 May 2017 02:39:40 PM CEST, Kevin Wolf wrote:
> This adds a small test for the image streaming error path for failing
> block_job_create(), which would have found the null pointer dereference
> in commit a170a91f.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  tests/qemu-iotests/030     | 4 ++++
>  tests/qemu-iotests/030.out | 4 ++--
>  2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
> index e00c11b..feee861 100755
> --- a/tests/qemu-iotests/030
> +++ b/tests/qemu-iotests/030
> @@ -147,6 +147,10 @@ class TestSingleDrive(iotests.QMPTestCase):
>          result = self.vm.qmp('block-stream', device='nonexistent')
>          self.assert_qmp(result, 'error/class', 'GenericError')
>  
> +    def test_job_id_missing(self):
> +        result = self.vm.qmp('block-stream', device='mid')
> +        self.assert_qmp(result, 'error/class', 'GenericError')

Mmm... but does that trigger the bug?

The bug happens if the user tries to create a stream job on a BDS that:

a) exists
b) is not the active node (i.e. needs reopening in read-write mode)
c) its node name is not valid for a block job (e.g. it contains a '#')

Berto

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu-iotests: Test streaming with missing job ID
  2017-05-15 12:46 ` Alberto Garcia
@ 2017-05-15 13:05   ` Kevin Wolf
  2017-05-15 13:20     ` Alberto Garcia
  0 siblings, 1 reply; 7+ messages in thread
From: Kevin Wolf @ 2017-05-15 13:05 UTC (permalink / raw)
  To: Alberto Garcia; +Cc: qemu-block, kchamart, qemu-devel

Am 15.05.2017 um 14:46 hat Alberto Garcia geschrieben:
> On Mon 15 May 2017 02:39:40 PM CEST, Kevin Wolf wrote:
> > This adds a small test for the image streaming error path for failing
> > block_job_create(), which would have found the null pointer dereference
> > in commit a170a91f.
> >
> > Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> > ---
> >  tests/qemu-iotests/030     | 4 ++++
> >  tests/qemu-iotests/030.out | 4 ++--
> >  2 files changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
> > index e00c11b..feee861 100755
> > --- a/tests/qemu-iotests/030
> > +++ b/tests/qemu-iotests/030
> > @@ -147,6 +147,10 @@ class TestSingleDrive(iotests.QMPTestCase):
> >          result = self.vm.qmp('block-stream', device='nonexistent')
> >          self.assert_qmp(result, 'error/class', 'GenericError')
> >  
> > +    def test_job_id_missing(self):
> > +        result = self.vm.qmp('block-stream', device='mid')
> > +        self.assert_qmp(result, 'error/class', 'GenericError')
> 
> Mmm... but does that trigger the bug?
> 
> The bug happens if the user tries to create a stream job on a BDS that:
> 
> a) exists
> b) is not the active node (i.e. needs reopening in read-write mode)
> c) its node name is not valid for a block job (e.g. it contains a '#')

I don't think c) is necessary, block jobs that are owned by a BDS
identified by a node name always require an explicit job ID. And yes, I
did test that it actually breaks before your fix.

Kevin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu-iotests: Test streaming with missing job ID
  2017-05-15 13:05   ` Kevin Wolf
@ 2017-05-15 13:20     ` Alberto Garcia
  0 siblings, 0 replies; 7+ messages in thread
From: Alberto Garcia @ 2017-05-15 13:20 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-block, kchamart, qemu-devel

On Mon 15 May 2017 03:05:00 PM CEST, Kevin Wolf wrote:
>> Mmm... but does that trigger the bug?
>> 
>> The bug happens if the user tries to create a stream job on a BDS that:
>> 
>> a) exists
>> b) is not the active node (i.e. needs reopening in read-write mode)
>> c) its node name is not valid for a block job (e.g. it contains a '#')
>
> I don't think c) is necessary, block jobs that are owned by a BDS
> identified by a node name always require an explicit job ID.

It defaults to bdrv_get_device_name() if the job ID is not set, but in
your case there's indeed none, so

Reviewed-by: Alberto Garcia <berto@igalia.com>

Berto

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu-iotests: Test streaming with missing job ID
  2017-05-15 12:39 [Qemu-devel] [PATCH] qemu-iotests: Test streaming with missing job ID Kevin Wolf
  2017-05-15 12:46 ` Alberto Garcia
@ 2017-05-17  7:39 ` Kashyap Chamarthy
  2017-05-17 12:11 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
  2017-05-17 13:26 ` [Qemu-devel] " Jeff Cody
  3 siblings, 0 replies; 7+ messages in thread
From: Kashyap Chamarthy @ 2017-05-17  7:39 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-block, berto, qemu-devel

On Mon, May 15, 2017 at 02:39:40PM +0200, Kevin Wolf wrote:
> This adds a small test for the image streaming error path for failing
> block_job_create(), which would have found the null pointer dereference
> in commit a170a91f.
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  tests/qemu-iotests/030     | 4 ++++
>  tests/qemu-iotests/030.out | 4 ++--
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
> index e00c11b..feee861 100755
> --- a/tests/qemu-iotests/030
> +++ b/tests/qemu-iotests/030
> @@ -147,6 +147,10 @@ class TestSingleDrive(iotests.QMPTestCase):
>          result = self.vm.qmp('block-stream', device='nonexistent')
>          self.assert_qmp(result, 'error/class', 'GenericError')
>  
> +    def test_job_id_missing(self):
> +        result = self.vm.qmp('block-stream', device='mid')
> +        self.assert_qmp(result, 'error/class', 'GenericError')
> +

Thanks.

FWIW:

Reviewed-by: Kashyap Chamarthy <kchamart@redhat.com>

[...]

-- 
/kashyap

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [Qemu-block] [PATCH] qemu-iotests: Test streaming with missing job ID
  2017-05-15 12:39 [Qemu-devel] [PATCH] qemu-iotests: Test streaming with missing job ID Kevin Wolf
  2017-05-15 12:46 ` Alberto Garcia
  2017-05-17  7:39 ` Kashyap Chamarthy
@ 2017-05-17 12:11 ` Stefan Hajnoczi
  2017-05-17 13:26 ` [Qemu-devel] " Jeff Cody
  3 siblings, 0 replies; 7+ messages in thread
From: Stefan Hajnoczi @ 2017-05-17 12:11 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-block, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 478 bytes --]

On Mon, May 15, 2017 at 02:39:40PM +0200, Kevin Wolf wrote:
> This adds a small test for the image streaming error path for failing
> block_job_create(), which would have found the null pointer dereference
> in commit a170a91f.
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  tests/qemu-iotests/030     | 4 ++++
>  tests/qemu-iotests/030.out | 4 ++--
>  2 files changed, 6 insertions(+), 2 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu-iotests: Test streaming with missing job ID
  2017-05-15 12:39 [Qemu-devel] [PATCH] qemu-iotests: Test streaming with missing job ID Kevin Wolf
                   ` (2 preceding siblings ...)
  2017-05-17 12:11 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
@ 2017-05-17 13:26 ` Jeff Cody
  3 siblings, 0 replies; 7+ messages in thread
From: Jeff Cody @ 2017-05-17 13:26 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-block, berto, qemu-devel

On Mon, May 15, 2017 at 02:39:40PM +0200, Kevin Wolf wrote:
> This adds a small test for the image streaming error path for failing
> block_job_create(), which would have found the null pointer dereference
> in commit a170a91f.
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---

Reviewed-by: Jeff Cody <jcody@redhat.com>


>  tests/qemu-iotests/030     | 4 ++++
>  tests/qemu-iotests/030.out | 4 ++--
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
> index e00c11b..feee861 100755
> --- a/tests/qemu-iotests/030
> +++ b/tests/qemu-iotests/030
> @@ -147,6 +147,10 @@ class TestSingleDrive(iotests.QMPTestCase):
>          result = self.vm.qmp('block-stream', device='nonexistent')
>          self.assert_qmp(result, 'error/class', 'GenericError')
>  
> +    def test_job_id_missing(self):
> +        result = self.vm.qmp('block-stream', device='mid')
> +        self.assert_qmp(result, 'error/class', 'GenericError')
> +
>  
>  class TestParallelOps(iotests.QMPTestCase):
>      num_ops = 4 # Number of parallel block-stream operations
> diff --git a/tests/qemu-iotests/030.out b/tests/qemu-iotests/030.out
> index 84bfd63..391c857 100644
> --- a/tests/qemu-iotests/030.out
> +++ b/tests/qemu-iotests/030.out
> @@ -1,5 +1,5 @@
> -......................
> +.......................
>  ----------------------------------------------------------------------
> -Ran 22 tests
> +Ran 23 tests
>  
>  OK
> -- 
> 1.8.3.1
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-05-17 13:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-15 12:39 [Qemu-devel] [PATCH] qemu-iotests: Test streaming with missing job ID Kevin Wolf
2017-05-15 12:46 ` Alberto Garcia
2017-05-15 13:05   ` Kevin Wolf
2017-05-15 13:20     ` Alberto Garcia
2017-05-17  7:39 ` Kashyap Chamarthy
2017-05-17 12:11 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-05-17 13:26 ` [Qemu-devel] " Jeff Cody

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).