From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55630) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFhcZ-0004lM-V2 for qemu-devel@nongnu.org; Wed, 22 Jun 2016 08:51:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFhcY-0008Cx-4S for qemu-devel@nongnu.org; Wed, 22 Jun 2016 08:51:06 -0400 Date: Wed, 22 Jun 2016 14:50:57 +0200 From: Kevin Wolf Message-ID: <20160622125057.GJ6134@noname.redhat.com> References: <3952362ff5a519e20e7b18bda8e861cd5d69142b.1466598035.git.berto@igalia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3952362ff5a519e20e7b18bda8e861cd5d69142b.1466598035.git.berto@igalia.com> Subject: Re: [Qemu-devel] [PATCH v2 04/15] block: Simplify find_block_job() and make it accept a job ID List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, Max Reitz , Eric Blake , Jeff Cody Am 22.06.2016 um 14:25 hat Alberto Garcia geschrieben: > find_block_job() looks for a block backend with a specified name, > checks whether it has a block job and acquires its AioContext. This > patch uses block_job_next() and iterate directly over the block jobs. > > In addition to that we want to identify jobs primarily by their ID, so > this patch updates find_block_job() to allow IDs too. Only one of ID > and device name can be specified when looking for a block job. > > Signed-off-by: Alberto Garcia Nice, this gets rid of another bs->job user. But as I said in patch 2, it's better to leave out the device thing. We can just update the documentation of the QMP commands so that 'device' contains a job ID rather than a device name and then we can look up IDs unconditionally. This will simplify the function even more. Kevin