Received: from eggs.gnu.org ([2001:4830:134:3::10]:46888) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UoxBm-00051A-Tn for qemu-devel@nongnu.org; Tue, 18 Jun 2013 10:47:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UoxBl-0005Ox-N6 for qemu-devel@nongnu.org; Tue, 18 Jun 2013 10:47:18 -0400 Received: from mail-wg0-x22e.google.com ([2a00:1450:400c:c00::22e]:64949) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UoxBl-0005On-GS for qemu-devel@nongnu.org; Tue, 18 Jun 2013 10:47:17 -0400 Received: by mail-wg0-f46.google.com with SMTP id c11so3474213wgh.13 for ; Tue, 18 Jun 2013 07:47:16 -0700 (PDT) Date: Tue, 18 Jun 2013 16:47:13 +0200 From: Stefan Hajnoczi Message-ID: <20130618144713.GR7649@stefanha-thinkpad.redhat.com> References: <1371477707-7039-1-git-send-email-kraxel@redhat.com> <1371477707-7039-3-git-send-email-kraxel@redhat.com> <87a9mo4x38.fsf@codemonkey.ws> <20130617105018.26c2eadc@redhat.com> <51C02766.5020301@redhat.com> <20130618091323.26c2988b@redhat.com> <51C05F91.6020201@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51C05F91.6020201@redhat.com> Subject: Re: [Qemu-devel] [RfC PATCH 2/2] console: add screendump-device qmp cmd List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Anthony Liguori , Markus Armbruster , qemu-devel@nongnu.org, alevy@redhat.com, stefanha@redhat.com, Luiz Capitulino On Tue, Jun 18, 2013 at 03:24:33PM +0200, Gerd Hoffmann wrote: > Hi, > > >> Something like the attached patch? Which is just the bare minimum I'll > >> need for screendump. Basically a one-off bottom half with some monitor > >> infrastructure (job id, error handling). So it isn't for big jobs, but > >> for small jobs which have to wait for something before they execute > >> (spice-server, guest action, whatever). > > > > I only skimmed over the patch, but you need QMP commands to cancel > > and to query running jobs. > > Sure, can easily go on top, just need to stuff the monitor_jobs into a > list and allow ops on it. Just want to make sure the direction I'm > heading to is fine. > > > Also, please move all this stuff to qmp.c > > and do s/monitor/qmp rename. > > Will do. > > > Lastly, is it possible to have the block job QMP API on top of this > > new QMP job API? > > Don't think so. As mentioned above this does short-running jobs as > bottom half whereas block jobs are running in coroutines ... Maybe we really should do a proper QMP jobs API. Using a BH makes sense for the screenshot case but is orthogonal to the QMP job API. It may be possible to map block jobs onto the QMP jobs API. Of course the blockjob-specific QMP APIs will remain for compatibility. Here's a quick overview of blockjob commands to give a feel for their scope: drive-mirror Starts a block job and returns nothing. Note that blockjobs do not have ids because they are bound 1:1 with a block device. This was a design mistake, we should really allow for multiple jobs per block device. query-block-jobs Return info on active block jobs. block-job-cancel Mark a block job as cancelled. It will cancel at the earliest opportunity. QMP Events BLOCK_JOB_COMPLETED and BLOCK_JOB_CANCELLED Async events. QMP Event BLOCK_JOB_ERROR Error reporting with BlockDevOnError error handling policy information (i.e. is the job paused waiting for the administrator to fix storage and then continue it?). Stefan