All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
To: Thomas Huth <thuth@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"qemu-block@nongnu.org" <qemu-block@nongnu.org>
Cc: "kwolf@redhat.com" <kwolf@redhat.com>,
	"lvivier@redhat.com" <lvivier@redhat.com>,
	"hare@suse.com" <hare@suse.com>,
	Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	Denis Lunev <den@virtuozzo.com>,
	"armbru@redhat.com" <armbru@redhat.com>,
	"keith.busch@intel.com" <keith.busch@intel.com>,
	"kraxel@redhat.com" <kraxel@redhat.com>,
	"stefanha@redhat.com" <stefanha@redhat.com>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>,
	"fam@euphon.net" <fam@euphon.net>
Subject: Re: [Qemu-devel] [PATCH] tests: Set read-zeroes on for null-co driver
Date: Tue, 13 Aug 2019 10:12:56 +0000	[thread overview]
Message-ID: <2a94e0ad-b66f-5f4e-94a7-639ff601cb92@virtuozzo.com> (raw)
In-Reply-To: <a2be1222-07f4-919b-7191-e6ec78c41bad@redhat.com>



On 13/08/2019 11:46, Thomas Huth wrote:
> On 7/30/19 3:23 PM, Andrey Shinkevich wrote:
>>
>>
>> On 30/07/2019 15:59, Thomas Huth wrote:
>>> On 30/07/2019 14.52, Thomas Huth wrote:
>>>> On 29/07/2019 14.46, Andrey Shinkevich wrote:
>>>>> This patch is to reduce the number of Valgrind report messages about
>>>>> using uninitialized memory with the null-co driver. It helps to filter
>>>>> real memory issues and is the same work done for the iotests with the
>>>>> commit ID a6862418fec4072.
>>>>>
>>>>> Suggested-by: Kevin Wolf <kwolf@redhat.com>
>>>>> Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
>>>>> ---
>>>> [...]
>>>>> diff --git a/tests/test-blockjob-txn.c b/tests/test-blockjob-txn.c
>>>>> index 86606f9..7da9216 100644
>>>>> --- a/tests/test-blockjob-txn.c
>>>>> +++ b/tests/test-blockjob-txn.c
>>>>> @@ -15,6 +15,7 @@
>>>>>    #include "qemu/main-loop.h"
>>>>>    #include "block/blockjob_int.h"
>>>>>    #include "sysemu/block-backend.h"
>>>>> +#include "qapi/qmp/qdict.h"
>>>>>    
>>>>>    typedef struct {
>>>>>        BlockJob common;
>>>>> @@ -96,7 +97,9 @@ static BlockJob *test_block_job_start(unsigned int iterations,
>>>>>    
>>>>>        data = g_new0(TestBlockJobCBData, 1);
>>>>>    
>>>>> -    bs = bdrv_open("null-co://", NULL, NULL, 0, &error_abort);
>>>>> +    QDict *opt = qdict_new();
>>>>> +    qdict_put_str(opt, "file.read-zeroes", "on");
>>>>> +    bs = bdrv_open("null-co://", NULL, opt, 0, &error_abort);
>>>>>        g_assert_nonnull(bs);
>>>>
>>>> Not sure, but don't you need to also qdict_destroy_obj(opt) at the end
>>>> to avoid leaking memory? (Also in the other spots where you use
>>>> qdict_new() ...)
>>>
>>> Never mind, seems like bdrv_open() is doing an qobject_unref() on the
>>> options at the end, so I guess this should be fine...
>>>
>>> So in that case:
>>>
>>> Acked-by: Thomas Huth <thuth@redhat.com>
>>>
>>> (I assume this will be taken through the block tree? Let me know if you
>>> prefer the qtest tree instead)
>>
>> Thanks, Thomas!
>> I have run the patched program under the Valgrind to double check for
>> memory issues - no leak reported.
>> As for the branch, I would be happy with either.
> 
> Ok, FYI, I've queued this patch now in the qtest branch:
> 
>   https://gitlab.com/huth/qemu/commits/qtest-next
> 
>   Thomas
> 

Thank you Thomas,
I appreciate.

Andrey
-- 
With the best regards,
Andrey Shinkevich

      reply	other threads:[~2019-08-13 10:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-29 12:46 [Qemu-devel] [PATCH] tests: Set read-zeroes on for null-co driver Andrey Shinkevich
2019-07-30 12:52 ` Thomas Huth
2019-07-30 12:59   ` Thomas Huth
2019-07-30 13:23     ` Andrey Shinkevich
2019-08-13  8:46       ` Thomas Huth
2019-08-13 10:12         ` Andrey Shinkevich [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=2a94e0ad-b66f-5f4e-94a7-639ff601cb92@virtuozzo.com \
    --to=andrey.shinkevich@virtuozzo.com \
    --cc=armbru@redhat.com \
    --cc=den@virtuozzo.com \
    --cc=fam@euphon.net \
    --cc=hare@suse.com \
    --cc=keith.busch@intel.com \
    --cc=kraxel@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=thuth@redhat.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.