Bug 485471

Summary: blktap qcow driver uses incompatible endianess vs qemu's qcow driver
Product: Red Hat Enterprise Linux 5 Reporter: Daniel Berrangé <berrange>
Component: xenAssignee: Michal Novotny <minovotn>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 5.4CC: areis, mshao, xen-maint
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: xen-3.0.3-86.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-02 10:11:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 486353    
Bug Blocks:    
Attachments:
Description Flags
Blktap qcow endianess compatibility fix
none
Patch after last BLKTAP update
none
Original version of this patch from upstream none

Description Daniel Berrangé 2009-02-13 17:24:08 UTC
Description of problem:

The Xen blktap driver uses native endian L1 tables for qcow files. QEMU defines that the format is always big-endian. This means Xen qcow files are incompatible with QEMUs. This may hurt people migrating to KVM.

The following upstream changeset fixed Xen.

changeset:   17311:17e30b91b9e2
user:        Keir Fraser <keir.fraser>
date:        Thu Mar 27 17:13:37 2008 +0000
files:       tools/blktap/drivers/block-qcow.c
description:
tapdisk: Fix L1 table endianess of qcow images

Fix tapdisk to use big endian L1 tables as used by qemu/ioemu. Old
tapdisk images with native endianess are automagically converted to
big endian when the image file is opened for the first time.

Signed-off-by: Kevin Wolf <kwolf>


Version-Release number of selected component (if applicable):
xen-3.0.3-79.el5

How reproducible:
Not tried to reproduce, but should be doable by creating a qcow image under xen, and seeing if it then works in KVM

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Michal Novotny 2009-02-18 11:23:32 UTC
Created attachment 332359 [details]
Blktap qcow endianess compatibility fix

This is patch correcting endianess compatibility problem in PV and FV guests. Both PV and FV now can use the same QCOW image. It's a backport of upstream at http://xenbits.xensource.com/xen-unstable.hg?rev/17e30b91b9e2 .

Comment 2 Michal Novotny 2009-02-20 16:01:50 UTC
Created attachment 332722 [details]
Patch after last BLKTAP update

Because of my last update concerning qcow image and poll-on-aio patch in BZ #486353 I had to create a new patch for this problem. Here it is. It solves endianess problem and it has been tested on RHEL 5.3 Xen and the same qcow image worked fine for both PV and FV guests...

Comment 3 Michal Novotny 2009-04-29 14:19:24 UTC
Created attachment 341757 [details]
Original version of this patch from upstream

This is upstream version that could be applied without modifications.

Comment 4 Jiri Denemark 2009-05-21 15:40:34 UTC
Fix built into xen-3.0.3-86.el5

Comment 6 Yewei Shao 2009-07-28 02:30:55 UTC
Verified on xen-3.0.3-91.el5

Comment 8 errata-xmlrpc 2009-09-02 10:11:34 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-1328.html