From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44843) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYqab-00031g-Fw for qemu-devel@nongnu.org; Mon, 07 Sep 2015 03:11:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZYqaX-0000jc-BJ for qemu-devel@nongnu.org; Mon, 07 Sep 2015 03:11:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59245) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYqaX-0000jY-5h for qemu-devel@nongnu.org; Mon, 07 Sep 2015 03:11:37 -0400 Date: Mon, 7 Sep 2015 15:11:34 +0800 From: Fam Zheng Message-ID: <20150907071134.GH3958@ad.nay.redhat.com> References: <1438238370-16212-1-git-send-email-famz@redhat.com> <1438238370-16212-15-git-send-email-famz@redhat.com> <55BFB6C6.80902@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55BFB6C6.80902@redhat.com> Subject: Re: [Qemu-devel] [PATCH v4 14/14] tests: add BlockJobTxn unit test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Kevin Wolf , Jeff Cody , qemu-devel@nongnu.org, vsementsov@parallels.com, stefanha@redhat.com, John Snow On Mon, 08/03 20:45, Max Reitz wrote: > >+static void test_single_job(int expected) > >+{ > >+ BlockJob *job; > >+ BlockJobTxn *txn; > >+ int result = -EINPROGRESS; > >+ > >+ txn = block_job_txn_new(); > >+ job = test_block_job_start(1, true, expected, &result); > > I think I'd like it better if 0 was passed if expected == -ECANCELED. This > way, we don't know whether the test really was cancelled or whether it just > exited normally, returning -ECANCELED because that was what was passed here. The job will yield right after starting, so I think it is OK. > >+ /* Now make job2 finish before the main loop kicks jobs. This means > >+ * simulates the race between a pending kick and another job completing. > > Perhaps the "means" should be removed? Yes. > > Even if you don't decide to address any of my comments: > > Reviewed-by: Max Reitz Thanks, Fam