1. 03 8月, 2010 6 次提交
    • M
      block: Change bdrv_eject() not to drop the image · 4be9762a
      Markus Armbruster 提交于
      bdrv_eject() gets called when a device model opens or closes the tray.
      
      If the block driver implements method bdrv_eject(), that method gets
      called.  Drivers host_cdrom implements it, and it opens and closes the
      physical tray, and nothing else.  When a device model opens, then
      closes the tray, media changes only if the user actively changes the
      physical media while the tray is open.  This is matches how physical
      hardware behaves.
      
      If the block driver doesn't implement method bdrv_eject(), we do
      something quite different: opening the tray severs the connection to
      the image by calling bdrv_close(), and closing the tray does nothing.
      When the device model opens, then closes the tray, media is gone,
      unless the user actively inserts another one while the tray is open,
      with a suitable change command in the monitor.  This isn't how
      physical hardware behaves.  Rather inconvenient when programs
      "helpfully" eject media to give you a chance to change it.  The way
      bdrv_eject() behaves here turns that chance into a must, which is not
      what these programs or their users expect.
      
      Change the default action not to call bdrv_close().  Instead, note the
      tray status in new BlockDriverState member tray_open.  Use it in
      bdrv_is_inserted().
      
      Arguably, the device models should keep track of tray status
      themselves.  But this is less invasive.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      4be9762a
    • K
      block: Fix bdrv_has_zero_init · 336c1c12
      Kevin Wolf 提交于
      Assuming that any image on a block device is not properly zero-initialized is
      actually wrong: Only raw images have this problem. Any other image format
      shouldn't care about it, they initialize everything properly themselves.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      336c1c12
    • Y
      bd0858bb
    • M
      loadvm: improve tests before bdrv_snapshot_goto() · f0aa7a8b
      Miguel Di Ciurcio Filho 提交于
      This patch improves the resilience of the load_vmstate() function, doing
      further and better ordered tests.
      
      In load_vmstate(), if there is any error on bdrv_snapshot_goto(), except if the
      error is on VM state device, load_vmstate() will return zero and the VM will be
      started with major corruption chances.
      
      The current process:
      - test if there is any writable device without snapshot support
          - if exists return -error
      - get the device that saves the VM state, possible return -error but unlikely
      because it was tested earlier
      - flush I/O
      - run bdrv_snapshot_goto() on devices
          - if fails, give an warning and goes to the next (not good!)
          - if fails on the VM state device, return zero (not good!)
      - check if the requested snapshot exists on the device that saves the VM state
      and the state is not zero
          - if fails return -error
      - open the file with the VM state
          - if fails return -error
      - load the VM state
          - if fails return -error
      - return zero
      
      New behavior:
      - get the device that saves the VM state
          - if fails return -error
      - check if the requested snapshot exists on the device that saves the VM state
      and the state is not zero
          - if fails return -error
      - test if there is any writable device without snapshot support
          - if exists return -error
      - test if the devices with snapshot support have the requested snapshot
          - if anyone fails, return -error
      - flush I/O
      - run snapshot_goto() on devices
          - if anyone fails, return -error
      - open the file with the VM state
          - if fails return -error
      - load the VM state
          - if fails return -error
      - return zero
      
      do_loadvm must not call vm_start if any error has occurred in load_vmstate.
      Signed-off-by: NMiguel Di Ciurcio Filho <miguel.filho@gmail.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      f0aa7a8b
    • K
      block: Change bdrv_commit to handle multiple sectors at once · 8a426614
      Kevin Wolf 提交于
      bdrv_commit copies the image to its backing file sector by sector, which
      is (surprise!) relatively slow. Let's take a larger buffer and handle more
      sectors at once if possible.
      
      With a 1G qcow2 file, this brought the time bdrv_commit takes down from
      5:06 min to 1:14 min for me.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      8a426614
    • A
      fix last cpu timer initialization · 5933e8a9
      Artyom Tarasenko 提交于
      The timer #0 is the system timer, so the timer #num_cpu is the
      timer of the last CPU, and it must be initialized in slavio_timer_reset.
      
      Don't mark non-existing timers as running.
      Signed-off-by: NArtyom Tarasenko <atar4qemu@gmail.com>
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      5933e8a9
  2. 01 8月, 2010 3 次提交
  3. 31 7月, 2010 15 次提交
  4. 30 7月, 2010 1 次提交
  5. 29 7月, 2010 14 次提交
  6. 28 7月, 2010 1 次提交