From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48462) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbpzO-0003ck-Uy for qemu-devel@nongnu.org; Fri, 23 Nov 2012 04:56:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TbpzH-0007FW-L3 for qemu-devel@nongnu.org; Fri, 23 Nov 2012 04:56:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47117) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbpzH-0007FQ-DJ for qemu-devel@nongnu.org; Fri, 23 Nov 2012 04:55:55 -0500 Message-ID: <50AF4826.3000901@redhat.com> Date: Fri, 23 Nov 2012 10:55:50 +0100 From: Kevin Wolf MIME-Version: 1.0 References: <1353488464-82756-1-git-send-email-dietmar@proxmox.com> <50ACB184.5080204@redhat.com> <24E144B8C0207547AD09C467A8259F755782D8A1@lisa.maurer-it.com> <50ACCAEC.2030001@redhat.com> <50ACD5BC.2080006@redhat.com> <24E144B8C0207547AD09C467A8259F755782F867@lisa.maurer-it.com> <24E144B8C0207547AD09C467A8259F755782F985@lisa.maurer-it.com> <24E144B8C0207547AD09C467A8259F755782F9A4@lisa.maurer-it.com> In-Reply-To: <24E144B8C0207547AD09C467A8259F755782F9A4@lisa.maurer-it.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/5] RFC: Efficient VM backup for qemu (v1) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dietmar Maurer Cc: Paolo Bonzini , "qemu-devel@nongnu.org" Am 23.11.2012 10:05, schrieb Dietmar Maurer: >>>> My plan was to have something like bs->job->job_type- >>>> {before,after}_write. >>>> >>>> int coroutine_fn (*before_write)(BlockDriverState *bs, >>>> int64_t sector_num, int nb_sectors, QEMUIOVector *qiov, >>>> void **cookie); >>>> int coroutine_fn (*after_write)(BlockDriverState *bs, >>>> int64_t sector_num, int nb_sectors, QEMUIOVector *qiov, >>>> void *cookie); >>> >>> I don't think that job is the right place. Instead I would put a list >>> of filters into >>> BDS: >> >> Well, I can also add it to job_type. Just tell me what you prefer, and I will >> write the patch. A block filter shouldn't be tied to a job, I think. We have things like blkdebug that are really filters and aren't coupled with a job, and on the other hand we want to generalise "block jobs" into just "jobs", so adding block specific things to job_type would be a step in the wrong direction. I also think that before_write/after_write isn't a convenient interface, it brings back much of the callback-based AIO cruft and passing void* isn't nice anyway. It's much nice to have a single .bdrv_co_write callback that somewhere in the middle calls the layer below with a simple function call. Also read/write aren't enough, for a full filter interface you potentially also need flush, discard and probably most other operations. This is why I suggested using a regular BlockDriver struct for filters, it already has all functions that are needed. > BTW, will such filters work with the new virtio-blk-data-plane? Not initially, but I think as soon as data plane gets support for image formats, filters would work as well. Kevin