1. 28 5月, 2010 1 次提交
  2. 27 5月, 2010 1 次提交
    • A
      Add cache=unsafe parameter to -drive · 016f5cf6
      Alexander Graf 提交于
      Usually the guest can tell the host to flush data to disk. In some cases we
      don't want to flush though, but try to keep everything in cache.
      
      So let's add a new cache value to -drive that allows us to set the cache
      policy to most aggressive, disabling flushes. We call this mode "unsafe",
      as guest data is not guaranteed to survive host crashes anymore.
      
      This patch also adds a noop function for aio, so we can do nothing in AIO
      fashion.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
      016f5cf6
  3. 17 5月, 2010 1 次提交
  4. 03 5月, 2010 2 次提交
    • K
      block: bdrv_has_zero_init · f2feebbd
      Kevin Wolf 提交于
      This fixes the problem that qemu-img's use of no_zero_init only considered the
      no_zero_init flag of the format driver, but not of the underlying protocols.
      
      Between the raw/file split and this fix, converting to host devices is broken.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      f2feebbd
    • C
      block: separate raw images from the file protocol · 84a12e66
      Christoph Hellwig 提交于
      We're running into various problems because the "raw" file access, which
      is used internally by the various image formats is entangled with the
      "raw" image format, which maps the VM view 1:1 to a file system.
      
      This patch renames the raw file backends to the file protocol which
      is treated like other protocols (e.g. nbd and http) and adds a new
      "raw" image format which is just a wrapper around calls to the underlying
      protocol.
      
      The patch is surprisingly simple, besides changing the probing logical
      in block.c to only look for image formats when using bdrv_open and
      renaming of the old raw protocols to file there's almost nothing in there.
      
      For creating images, a new bdrv_create_file is introduced which guesses the
      protocol to use. This allows using qemu-img create -f raw (or just using the
      default) for both files and host devices. Converting the other format drivers
      to use this function to create their images is left for later patches.
      
      The only issues still open are in the handling of the host devices.
      Firstly in current qemu we can specifiy the host* format names
      on various command line acceping images, but the new code can't
      do that without adding some translation.  Second the layering breaks
      the no_zero_init flag in the BlockDriver used by qemu-img.  I'm not
      happy how this is done per-driver instead of per-state so I'll
      prepare a separate patch to clean this up.
      
      There's some more cleanup opportunity after this patch, e.g. using
      separate lists and registration functions for image formats vs
      protocols and maybe even host drivers, but this can be done at a
      later stage.
      
      Also there's a check for protocol in bdrv_open for the BDRV_O_SNAPSHOT
      case that I don't quite understand, but which I fear won't work as
      expected - possibly even before this patch.
      
      Note that this patch requires various recent block patches from Kevin
      and me, which should all be in his block queue.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      84a12e66
  5. 23 4月, 2010 5 次提交
    • K
      block.h: bdrv_create2 doesn't exist any more · 85de0ba5
      Kevin Wolf 提交于
      The bdrv_create2 implementation has disappeared long ago. Remove its
      prototype from the header file, too.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      85de0ba5
    • C
      block: get rid of the BDRV_O_FILE flag · 6db95603
      Christoph Hellwig 提交于
      BDRV_O_FILE is only used to communicate between bdrv_file_open and bdrv_open.
      It affects two things:  first bdrv_open only searches for protocols using
      find_protocol instead of all image formats and host drivers.  We can easily
      move that to the caller and pass the found driver to bdrv_open.  Second
      it is used to not force a read-write open of a snapshot file.  But we never
      use bdrv_file_open to open snapshots and this behaviour doesn't make sense
      to start with.
      
      qemu-io abused the BDRV_O_FILE for it's growable option, switch it to
      using bdrv_file_open to make sure we only open files as growable were
      we can actually support that.
      
      This patch requires Kevin's "[PATCH] Replace calls of old bdrv_open" to
      be applied first.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      6db95603
    • K
      Replace calls of old bdrv_open · d6e9098e
      Kevin Wolf 提交于
      What is known today as bdrv_open2 becomes the new bdrv_open. All remaining
      callers of the old function are converted to the new one. In some places they
      even know the right format, so they should have used bdrv_open2 from the
      beginning.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      d6e9098e
    • K
      qcow2: Trigger blkdebug events · 8252278a
      Kevin Wolf 提交于
      This adds blkdebug events to qcow2 to allow injecting I/O errors in specific
      places.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      8252278a
    • K
      blkdebug: Add events and rules · 8b9b0cc2
      Kevin Wolf 提交于
      Block drivers can trigger a blkdebug event whenever they reach a place where it
      could be useful to inject an error for testing/debugging purposes.
      
      Rules are read from a blkdebug config file and describe which action is taken
      when an event is triggered. For now this is only injecting an error (with a few
      options) or changing the state (which is an integer). Rules can be declared to
      be active only in a specific state; this way later rules can distiguish on
      which path we came to trigger their event.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      8b9b0cc2
  6. 11 2月, 2010 1 次提交
    • L
      block: BLOCK_IO_ERROR QMP event · 2582bfed
      Luiz Capitulino 提交于
      This commit introduces the bdrv_mon_event() function, which
      should be called by block subsystems (eg. IDE) when a I/O
      error occurs, so that an QMP event is emitted.
      
      The following information is currently provided in the event:
      
      - device name
      - operation (ie. "read" or "write")
      - action taken (eg. "stop")
      
      Event example:
      
      { "event": "BLOCK_IO_ERROR",
          "data": { "device": "ide0-hd1",
                    "operation": "write",
                    "action": "stop" },
          "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      2582bfed
  7. 10 2月, 2010 1 次提交
  8. 27 1月, 2010 2 次提交
  9. 20 1月, 2010 1 次提交
  10. 14 1月, 2010 2 次提交
  11. 12 12月, 2009 2 次提交
  12. 04 12月, 2009 3 次提交
  13. 17 11月, 2009 1 次提交
    • L
      Expose a mechanism to trace block writes · 7cd1e32a
      lirans@il.ibm.com 提交于
      To support live migration without shared storage we need to be able to trace
      writes to disk while migrating. This Patch expose dirty block tracking per
      device to be polled from upper layer.
      
      Changes from v4:
      - Register dirty tracking for each block device.
      - Minor coding style issues.
      - Block.c will now manage a dirty bitmap per device once
        bdrv_set_dirty_tracking() is called. Bitmap is polled by the upper
        layer (block-migration.c).
      Signed-off-by: NLiran Schour <lirans@il.ibm.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      7cd1e32a
  14. 09 11月, 2009 2 次提交
    • M
      Configurable block format whitelist · eb852011
      Markus Armbruster 提交于
      We have code for a quite a few block formats.  While I trust that all
      of these formats are useful at least for some people in some
      circumstances, some of them are of a kind that friends don't let
      friends use in production.
      
      This patch provides an optional block format whitelist, default off.
      If a whitelist is configured with --block-drv-whitelist, QEMU proper
      can use only whitelisted formats.  Other programs, like qemu-img, are
      not affected.
      
      Drivers for formats off the whitelist still participate in format
      probing, to ensure all programs probe exactly the same.  Without that,
      QEMU proper would be prone to treat images with a format off the
      whitelist as raw when the image's format is probed.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      eb852011
    • N
      Added readonly flag to -drive command · 59f2689d
      Naphtali Sprei 提交于
      This is a slightly revised patch for adding readonly flag to the -drive command.
      Even though this patch is "stand-alone", it assumes a previous related patch (in Anthony staging tree), that passes
      the readonly attribute of the drive to the guest OS, applied first.
      
      This enables sharing same image between guests, with readonly access.
      Implementaion mark the drive as read_only and changes the flags when actually opening the file.
      The readonly attribute of a qcow also passed to it's base file.
      For ide that cannot pass the readonly attribute to the guest OS, disallow the readonly flag.
      
      Also, return error code from bdrv_truncate for readonly drive.
      Signed-off-by: NNaphtali Sprei <nsprei@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      59f2689d
  15. 11 9月, 2009 3 次提交
    • C
      block: add aio_flush operation · b2e12bc6
      Christoph Hellwig 提交于
      Instead stalling the VCPU while serving a cache flush try to do it
      asynchronously.  Use our good old helper thread pool to issue an
      asynchronous fdatasync for raw-posix.  Note that while Linux AIO
      implements a fdatasync operation it is not useful for us because
      it isn't actually implement in asynchronous fashion.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      b2e12bc6
    • C
      block: add enable_write_cache flag · e900a7b7
      Christoph Hellwig 提交于
      Add a enable_write_cache flag in the block driver state, and use it to
      decide if we claim to have a volatile write cache that needs controlled
      flushing from the guest.  The flag is off if cache=writethrough is
      defined because O_DSYNC guarantees that every write goes to stable
      storage, and it is on for cache=none and cache=writeback.
      
      Both scsi-disk and ide now use the new flage, changing from their
      defaults of always off (ide) or always on (scsi-disk).
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      e900a7b7
    • K
      Add bdrv_aio_multiwrite · 40b4f539
      Kevin Wolf 提交于
      One performance problem of qcow2 during the initial image growth are
      sequential writes that are not cluster aligned. In this case, when a first
      requests requires to allocate a new cluster but writes only to the first
      couple of sectors in that cluster, the rest of the cluster is zeroed - just
      to be overwritten by the following second request that fills up the cluster.
      
      Let's try to merge sequential write requests to the same cluster, so we can
      avoid to write the zero padding to the disk in the first place.
      
      As a nice side effect, also other formats take advantage of dealing with less
      and larger requests.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      40b4f539
  16. 28 8月, 2009 1 次提交
    • C
      raw-posix: add Linux native AIO support · 5c6c3a6c
      Christoph Hellwig 提交于
      Now that do have a nicer interface to work against we can add Linux native
      AIO support.  It's an extremly thing layer just setting up an iocb for
      the io_submit system call in the submission path, and registering an
      eventfd with the qemu poll handler to do complete the iocbs directly
      from there.
      
      This started out based on Anthony's earlier AIO patch, but after
      estimated 42,000 rewrites and just as many build system changes
      there's not much left of it.
      
      To enable native kernel aio use the aio=native sub-command on the
      drive command line.  I have also added an option to qemu-io to
      test the aio support without needing a guest.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      5c6c3a6c
  17. 16 7月, 2009 1 次提交
  18. 10 7月, 2009 2 次提交
  19. 30 6月, 2009 1 次提交
    • 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
  20. 17 6月, 2009 1 次提交
  21. 22 5月, 2009 1 次提交
  22. 15 5月, 2009 1 次提交
  23. 22 4月, 2009 1 次提交
  24. 08 4月, 2009 1 次提交
  25. 06 4月, 2009 1 次提交
  26. 29 3月, 2009 1 次提交