diff -Nru file-4.26/debian/changelog file-4.26/debian/changelog --- file-4.26/debian/changelog 2009-01-29 15:48:39.000000000 -0500 +++ file-4.26/debian/changelog 2009-02-03 09:03:42.000000000 -0500 @@ -1,3 +1,9 @@ +file (4.26-3~adb1) unstable; urgency=low + + * Update QEMU disk image magic. (Closes: #451524). + + -- Adam Buchbinder Tue, 03 Feb 2009 09:03:03 -0500 + file (4.26-2) unstable; urgency=medium * Using patch-stamp rather than patch in rules file. diff -Nru file-4.26/debian/patches/00list file-4.26/debian/patches/00list --- file-4.26/debian/patches/00list 2009-01-29 15:48:39.000000000 -0500 +++ file-4.26/debian/patches/00list 2009-02-03 09:00:05.000000000 -0500 @@ -16,6 +16,7 @@ 217-magic-update-ruby.dpatch 218-magic-update-gimp.dpatch 219-magic-update-wav.dpatch +220-magic-update-qemu.dpatch 320-magic-add-par2.dpatch 321-magic-add-pe5.dpatch 322-magic-add-pmenu.dpatch diff -Nru file-4.26/debian/patches/220-magic-update-qemu.dpatch file-4.26/debian/patches/220-magic-update-qemu.dpatch --- file-4.26/debian/patches/220-magic-update-qemu.dpatch 1969-12-31 19:00:00.000000000 -0500 +++ file-4.26/debian/patches/220-magic-update-qemu.dpatch 2009-02-03 09:05:30.000000000 -0500 @@ -0,0 +1,94 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 220-magic-update-qemu.dpatch by Adam Buchbinder +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Update QEMU image magic, based on some reference docs and checked +## DP: against actual QEMU images. + +@DPATCH@ +diff -urNad file-4.26~/magic/Magdir/msdos file-4.26/magic/Magdir/msdos +--- file-4.26~/magic/Magdir/msdos 2009-01-26 12:05:54.000000000 -0500 ++++ file-4.26/magic/Magdir/msdos 2009-02-03 08:59:36.000000000 -0500 +@@ -613,43 +613,58 @@ + #-------------------------------------------------------------------- + # Qemu Emulator Images + # Lines written by Friedrich Schwittay (f.schwittay@yousable.de) +-# Made by reading sources and doing trial and error on existing +-# qcow files +-0 string QFI Qemu Image, Format: Qcow ++# Updated by Adam Buchbinder (adam.buchbinder@gmail.com) ++# Made by reading sources, reading documentation, and doing trial and error ++# on existing QCOW files ++0 string QFI\xFB QEMU QCOW Image + + # Uncomment the following line to display Magic (only used for debugging + # this magic number) + #>0 string x , Magic: %s + +-# There are currently 2 Versions: "1" and "2" +-# I do not use Version 2 and therefor branch here +-# but can assure: it works (tested on both versions) +-# Also my Qemu 0.9.0 which uses this Version 2 refuses +-# to start in its bios +->0x04 belong 2 , Version: 2 +->0x04 belong 1 , Version: 1 ++# There are currently 2 Versions: "1" and "2". ++# http://www.gnome.org/~markmc/qcow-image-format-version-1.html ++>4 belong 1 (v1) + +-# Using the existence of the Backing File Offset to Branch or not ++# Using the existence of the Backing File Offset to determine whether + # to read Backing File Information +->>0xc belong >0 , Backing File( Offset: %lu +->>>(0xc.L) string >\0 , Path: %s +- +-# Didn't get the trick here how qemu stores the "Size" at this Position +-# There is actually something stored but nothing makes sense +-# The header in the sources talks about it +-#>>>16 lelong x , Size: %lu ++>>12 belong >0 \b, has backing file ( ++# Note that this isn't a null-terminated string; the length is actually ++# (16.L). Assuming a null-terminated string happens to work usually, but it ++# may spew junk until it reaches a \0 in some cases. ++>>>(12.L) string >\0 \bpath %s + + # Modification time of the Backing File + # Really useful if you want to know if your backing + # file is still usable together with this image +->>>20 bedate x , Mtime: %s ) ++>>>>20 bedate >0 \b, mtime %s) ++>>>>20 default x \b) + +-# Don't know how to calculate in Magicfiles +-# Also: this Information is not reliably +-# stored in image-files +->>24 lelong x , Disk Size could be: %d * 256 bytes ++# Size is stored in bytes in a big-endian u64. ++>>24 bequad x \b, %lld bytes + +-0 string QEVM QEMU's suspend to disk image ++# 1 for AES encryption, 0 for none. ++>>36 belong 1 \b, AES-encrypted ++ ++# http://www.gnome.org/~markmc/qcow-image-format.html ++>4 belong 2 (v2) ++# Using the existence of the Backing File Offset to determine whether ++# to read Backing File Information ++>>8 bequad >0 \b, has backing file ++# Note that this isn't a null-terminated string; the length is actually ++# (16.L). Assuming a null-terminated string happens to work usually, but it ++# may spew junk until it reaches a \0 in some cases. Also, since there's no ++# .Q modifier, we just use the bottom four bytes as an offset. Note that if ++# the file is over 4G, and the backing file path is stored after the first 4G, ++# the wrong filename will be printed. (This should be (8.Q), when that syntax ++# is introduced.) ++>>>(12.L) string >\0 (path %s) ++>>24 bequad x \b, %lld bytes ++>>32 belong 1 \b, AES-encrypted ++ ++>4 default x (unknown version) ++ ++0 string QEVM QEMU suspend to disk image + + 0 string Bochs\ Virtual\ HD\ Image Bochs disk image, + >32 string x type %s,