From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43023) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XDD4p-0003qu-7A for qemu-devel@nongnu.org; Fri, 01 Aug 2014 09:41:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XDD4g-0007iL-4s for qemu-devel@nongnu.org; Fri, 01 Aug 2014 09:40:55 -0400 Received: from mail-we0-x230.google.com ([2a00:1450:400c:c03::230]:57729) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XDD4f-0007h4-RP for qemu-devel@nongnu.org; Fri, 01 Aug 2014 09:40:45 -0400 Received: by mail-we0-f176.google.com with SMTP id q58so4319594wes.7 for ; Fri, 01 Aug 2014 06:40:44 -0700 (PDT) Sender: Levente Kurusa From: Levente Kurusa Date: Fri, 1 Aug 2014 15:39:58 +0200 Message-Id: <1406900401-19550-1-git-send-email-lkurusa@redhat.com> Subject: [Qemu-devel] [PATCH 0/3] vpc: support probing of fixed size images List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , Stefan Hajnoczi Cc: Andrew Jones , Stefan Weil , Levente Kurusa , Fam Zheng , QEMU Developers Fixed size VPC images do not have a footer, hence the current probe function will fail and QEMU will fall back to the raw_bsd driver, which is not the correct behaviour. The specification of the format says that fixed size images have a footer as the last 512 bytes of the file. The footer is exactly the same as the header would be in the case of dynamically growing images. For this, we need to read the last 512 bytes of the image, however the current mechanics predominantly read the first 2048 bytes and pass that as a buffer to the probe functions. Solve this by passing the BlockDriverState to the probe functions, hence giving them a chance to read the extra bytes they might need. Levente Kurusa (3): block: format: pass down the current state to the format's probe function block: vpc: introduce vpc_check_signature function block: vpc: handle fixed size images in probe function block.c | 2 +- block/bochs.c | 3 ++- block/cloop.c | 3 ++- block/cow.c | 3 ++- block/dmg.c | 3 ++- block/parallels.c | 3 ++- block/qcow.c | 3 ++- block/qcow2.c | 3 ++- block/qed.c | 4 ++-- block/raw_bsd.c | 3 ++- block/vdi.c | 3 ++- block/vmdk.c | 3 ++- block/vpc.c | 34 +++++++++++++++++++++++++++++----- include/block/block_int.h | 3 ++- 14 files changed, 54 insertions(+), 19 deletions(-) -- 1.9.3