]> xenbits.xen.org Git - xenclient/ioemu.git/commitdiff
Always treat floppy images as raw
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 8 Jul 2009 14:52:31 +0000 (15:52 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 8 Jul 2009 14:53:05 +0000 (15:53 +0100)
The fix for the image format guessing vulnerability breaks raw floppy
images.  In our environment it is difficult to apply the same
configuration change as envisaged upstream, so instead we arrange to
always treat a floppy image as raw.

Two-line patch supplied by James Harper <james.harper@bendigoit.com.au>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
(cherry picked from commit f2ce5c35f60bb606bd3ddb55c361bb8a9aad5c5c)

[ Also originally committed as 342846c1eecc972fcfae84d9d1ae65a318101792
  Mistakenly dropped from qemu-xen-unstable.git and now reapplied.
  Thanks to report from James Harper.   -iwj ]
(cherry picked from commit 8aba8e15b6050dfd94d12a737562d3f6fe67d30f)

vl.c

diff --git a/vl.c b/vl.c
index b5bb5cb2a6cf1922ec1ed999d9e34c8f551cf1f3..85adc540fc9388b1337900efeab9169e8ce2e067 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -2629,6 +2629,8 @@ int drive_init(struct drive_opt *arg, int snapshot, void *opaque)
            approximation.  */
     case IF_FLOPPY:
         bdrv_set_type_hint(bdrv, BDRV_TYPE_FLOPPY);
+        if (!drv)
+            drv = &bdrv_raw;
         break;
     case IF_PFLASH:
     case IF_MTD: