1. 17 7月, 2009 1 次提交
  2. 10 7月, 2009 2 次提交
  3. 30 6月, 2009 2 次提交
    • K
      block-raw: Allow pread beyond the end of growable images · 22afa7b5
      Kevin Wolf 提交于
      When using O_DIRECT, qcow2 snapshots didn't work any more for me. In the
      process of creating the snapshot, qcow2 tries to pwrite some new information
      (e.g. new L1 table) which will often end up being after the old end of the
      image file. Now pwrite tries to align things and reads the old contents of the
      file, read returns 0 because there is nothing to read after the end of file and
      pwrite is stuck in an endless loop.
      
      This patch allows to pread beyond the end of an image file. Whenever the
      given offset is after the end of the image file, the read succeeds and fills
      the buffer with zeros.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      22afa7b5
    • R
      support colon in filenames · 707c0dbc
      Ram Pai 提交于
      Problem: It is impossible to feed filenames with the character colon because
      qemu interprets such names as a protocol. For example filename scsi:0, is
      interpreted as a protocol by name "scsi".
      
      This patch allows user to espace colon characters. For example the above
      filename can now be expressed either as 'scsi\:0' or as file:scsi:0
      
      anything following the "file:" tag is interpreted verbatin. However if "file:"
      tag is omitted then any colon characters in the string must be escaped using
      backslash.
      
      Here are couple of examples:
      
      scsi\:0\:abc is a local file scsi:0:abc
      http\://myweb is a local file by name http://myweb
      file:scsi:0:abc is a local file scsi:0:abc
      file:http://myweb is a local file by name http://mywebSigned-off-by: NRam Pai <linuxram@us.ibm.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      707c0dbc
  4. 17 6月, 2009 3 次提交
  5. 15 6月, 2009 5 次提交
    • C
      raw-posix: cleanup ioctl methods · 63ec93db
      Christoph Hellwig 提交于
      Rename raw_ioctl and raw_aio_ioctl to hdev_ioctl and hdev_aio_ioctl as they
      are only used for the host device.  Also only add them to the method table
      for the cases where we need them (generic hdev if linux and linux CDROM)
      instead of declaring stubs and always add them.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      63ec93db
    • C
      block: add bdrv_probe_device method · 508c7cb3
      Christoph Hellwig 提交于
      Add a bdrv_probe_device method to all BlockDriver instances implementing
      host devices to move matching of host device types into the actual drivers.
      For now we keep exacly the old matching behaviour based on the devices names,
      although we really should have better detetion methods based on device
      information in the future.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      508c7cb3
    • C
      raw-posix: split hdev drivers · f3a5d3f8
      Christoph Hellwig 提交于
      Instead of declaring one BlockDriver for all host devices declared one
      for each type:  a generic one for normal disk devices, a Linux floppy
      driver and a CDROM driver for Linux and FreeBSD.  This gets rid of a lot
      of messy ifdefs and switching based on the type in the various removal
      device methods.
      
      block.c grows a new method to find the correct host device driver based
      on OS-sepcific criteria, which will later into the actual drivers in a
      later patch in this series.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      f3a5d3f8
    • C
      raw-posix: add a raw_open_common helper · 90babde0
      Christoph Hellwig 提交于
      raw_open and hdev_open contain the same basic logic.  Add a new
      raw_open_common helper containing the guts of the open routine
      and call it from raw_open and hdev_open.
      
      We use the new open_flags field in BDRVRawState to allow passing
      additional open flags to raw_open_common from both.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      90babde0
    • C
      raw-posix: always store open flags · 0e1d8f4c
      Christoph Hellwig 提交于
      Both the Linux floppy and the FreeBSD CDROM host device need to store
      the open flags so that they can re-open the device later.  Store the
      open flags unconditionally to remove the ifdef mess and simply the
      calling conventions for the later patches in the series.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      0e1d8f4c
  6. 06 6月, 2009 1 次提交
  7. 27 5月, 2009 3 次提交
    • C
      fully split aio_pool from BlockDriver · c16b5a2c
      Christoph Hellwig 提交于
      Now that we have a separate aio pool structure we can remove those
      aio pool details from BlockDriver.
      
      Every driver supporting AIO now needs to declare a static AIOPool
      with the aiocb size and the cancellation method.  This cleans up the
      current code considerably and will make it cleaner and more obvious
      to support two different aio implementations behind a single
      BlockDriver.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      c16b5a2c
    • C
      raw-posix: fix hdev_create · 4099df58
      Christoph Hellwig 提交于
      We do need hdev_create unconditionally on all platforms so that qemu-img
      create support for host device works on all platforms.
      
      Also relax the check to allow character devices in addition to block
      devices.  On many Unix platforms block devices have buffered block
      nodes and unbuffered character device nodes, and on FreeBSD the block
      nodes don't even exist anymore.  Also on Linux we do support the
      /dev/sgN scsi passthrough devices through the host device driver,
      and probably the old-style /dev/raw/rawN raw devices although I haven't
      tested that.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      4099df58
    • C
      fix raw_pread_aligned return value · 94c6d6d8
      Christoph Hellwig 提交于
      raw_pread_aligned currently returns the raw return value from
      lseek/read, which is always -1 in case of an error.  But the
      callers higher up the stack expect it to return the negated
      errno just like raw_pwrite_aligned.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      94c6d6d8
  8. 22 5月, 2009 1 次提交
  9. 15 5月, 2009 2 次提交
  10. 14 5月, 2009 2 次提交
  11. 23 4月, 2009 1 次提交
    • A
      implement qemu_blockalign (Stefano Stabellini) · e268ca52
      aliguori 提交于
      this patch adds a buffer_alignment field to BlockDriverState and
      implements a qemu_blockalign function that uses that field to allocate a
      memory aligned buffer to be used by the block driver.
      buffer_alignment is initialized to 512 but each block driver can set
      a different value (at the moment none of them do).
      This patch modifies ide.c, block-qcow.c, block-qcow2.c and block.c to
      use qemu_blockalign instead of qemu_memalign.
      There is only one place left that still uses qemu_memalign to allocate
      buffers used by block drivers that is posix-aio-compat:handle_aiocb_rw
      because it is not possible to get the BlockDriverState from that
      function. However I think it is not important because posix-aio-compat
      already deals with driver specific code so it is supposed to know its
      own needs.
      Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7229 c046a42c-6fe2-441c-8c8c-71466251a162
      e268ca52
  12. 08 4月, 2009 2 次提交
  13. 06 4月, 2009 2 次提交
    • A
      Fix the build for --disable-aio · 8185d2c9
      aliguori 提交于
      This was reported by malc.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6993 c046a42c-6fe2-441c-8c8c-71466251a162
      8185d2c9
    • A
      Add host_device support to qemu-img. (Nolan Leake) · 93c65b47
      aliguori 提交于
      This patch allows the use a host_device as the destination for "qemu-img
      convert".
      
      I added a ->bdrv_create function host_device.  It merely verifies that
      the device exists and is large enough.
      
      A check is needed in the qemu-img convert loop to ensure that we write
      out all 0 sectors to the host_device.  Otherwise they end up with stale
      garbage where all zero sectors were expected.
      
      I also made the check against bdrv_is_allocated enabled for everything
      _except_ host devices, since there is no point in making the block
      backend write a bunch of zeros just so that we can memcmp them
      immediately afterwards.  Host devices can't benefit from this because
      there is no way to differentiate between a sector being unallocated
      because it was never written, or because it was written with all zeros
      and then made a trip through qemu-img convert.
      
      Finally, there is an unrelated fix for a typo in the error message
      printed if the destination device does not support ->bdrv_create.
      
      Signed-off-by: Nolan Leake <nolan <at> sigbus.net>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6978 c046a42c-6fe2-441c-8c8c-71466251a162
      93c65b47
  14. 31 3月, 2009 1 次提交
  15. 29 3月, 2009 1 次提交
    • A
      new scsi-generic abstraction, use SG_IO (Christoph Hellwig) · 221f715d
      aliguori 提交于
      Okay, I started looking into how to handle scsi-generic I/O in the
      new world order.
      
      I think the best is to use the SG_IO ioctl instead of the read/write
      interface as that allows us to support scsi passthrough on disk/cdrom
      devices, too.  See Hannes patch on the kvm list from August for an
      example.
      
      Now that we always do ioctls we don't need another abstraction than
      bdrv_ioctl for the synchronous requests for now, and for asynchronous
      requests I've added a aio_ioctl abstraction keeping it simple.
      
      Long-term we might want to move the ops to a higher-level abstraction
      and let the low-level code fill out the request header, but I'm lazy
      enough to leave that to the people trying to support scsi-passthrough
      on a non-Linux OS.
      
      Tested lightly by issuing various sg_ commands from sg3-utils in a guest
      to a host CDROM device.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6895 c046a42c-6fe2-441c-8c8c-71466251a162
      221f715d
  16. 28 3月, 2009 1 次提交
    • B
      FreeBSD host physical cdrom fixes · 9f23011a
      blueswir1 提交于
      This improves physical cdrom support on FreeBSD hosts to be almost as
      good as on Linux, with the only notable exception that you still need to
      either have the guest itself eject the disc if you want to take it
      out/change it, or do a change command in the monitor after taking out
      a disc in case a guest cannot eject it itself - otherwise the guest may
      continue using state (like size) of the old disc.
      Signed-off-by: NJuergen Lock <nox@jelal.kn-bremen.de>
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6888 c046a42c-6fe2-441c-8c8c-71466251a162
      9f23011a
  17. 13 3月, 2009 3 次提交
  18. 08 3月, 2009 3 次提交
  19. 27 2月, 2009 1 次提交
  20. 06 2月, 2009 1 次提交
  21. 30 1月, 2009 1 次提交
  22. 24 1月, 2009 1 次提交