1. 09 2月, 2014 3 次提交
  2. 25 1月, 2014 25 次提交
  3. 24 1月, 2014 7 次提交
  4. 22 1月, 2014 5 次提交
    • P
      block: fix backing file segfault · d80ac658
      Peter Feiner 提交于
      When a backing file is opened such that (1) a protocol is directly
      used as the block driver and (2) the block driver has bdrv_file_open,
      bdrv_open_backing_file segfaults. The problem arises because
      bdrv_open_common returns without setting bd->backing_hd->file.
      
      To effect (1), you seem to have to use the -F flag in qemu-img. There
      are several block drivers that satisfy (2), such as "file" and "nbd".
      Here are some concrete examples:
      
          #!/bin/bash
      
          echo Test file format
          ./qemu-img create -f file base.file 1m
          ./qemu-img create -f qcow2 -F file -o backing_file=base.file\
              file-overlay.qcow2
          ./qemu-img convert -O raw file-overlay.qcow2 file-convert.raw
      
          echo Test nbd format
          SOCK=$PWD/nbd.sock
          ./qemu-img create -f raw base.raw 1m
          ./qemu-nbd -t -k $SOCK base.raw &
          trap "kill $!" EXIT
          while ! test -e $SOCK; do sleep 1; done
          ./qemu-img create -f qcow2 -F nbd -o backing_file=nbd:unix:$SOCK\
              nbd-overlay.qcow2
          ./qemu-img convert -O raw nbd-overlay.qcow2 nbd-convert.raw
      
      Without this patch, the two qemu-img convert commands segfault.
      
      This is a regression that was introduced in v1.7 by
      dbecebdd.
      Signed-off-by: NPeter Feiner <peter@gridcentric.ca>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      d80ac658
    • M
      block: Allow recursive "file"s · 505d7583
      Max Reitz 提交于
      It should be possible to use a format as a driver for a file which in
      turn requires another file, i.e., nesting file formats.
      
      Allowing nested file formats results in e.g. qcow2 BlockDriverStates
      never being directly passed to bdrv_open_common() from bdrv_file_open(),
      but instead being handed through bdrv_open(). This changes the error
      message when trying to give a filename to qcow2, i.e. trying to use it
      as a driver for the protocol level. Therefore, change the reference
      output of I/O test 051 accordingly.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      505d7583
    • M
      block: Use bdrv_open_image() in bdrv_open() · 054963f8
      Max Reitz 提交于
      Using bdrv_open_image() instead of bdrv_file_open() directly in
      bdrv_open() is easier.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      054963f8
    • M
      block: Add bdrv_open_image() · da557aac
      Max Reitz 提交于
      Add a common function for opening images to be used for block drivers
      specified through BlockdevRefs in an option QDict. The difference from
      bdrv_file_open() is that this function may invoke bdrv_open() instead,
      allowing auto-detection of the driver to be used; and second, it
      automatically extracts the BlockdevRef from the option QDict.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      da557aac
    • M
      block: Allow block devices without files · 2a05cbe4
      Max Reitz 提交于
      blkdebug and blkverify will, in order to retain compatibility, not
      support the field "file" implicitly through bdrv_open(). In order to be
      able to use those drivers without giving a filename anyway, it is
      necessary to be able to have block devices without files implicitly
      opened by bdrv_open(). This is the case, if there was neither a file
      name, a reference to an existing block device to use as a file nor
      options specific to the file.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      2a05cbe4