1. 24 5月, 2011 4 次提交
  2. 23 5月, 2011 4 次提交
  3. 22 5月, 2011 1 次提交
  4. 20 5月, 2011 20 次提交
  5. 19 5月, 2011 7 次提交
    • A
      ahci: Fix non-NCQ accesses for LBA > 16bits · 1fddfba1
      Alexander Graf 提交于
      AHCI provides two ways of reading/writing data:
      
       1) NCQ
       2) ATA commands with the LBA in the command FIS
      
      In the second code path, we didn't handle any LBAs that were bigger than
      16 bits, so whenever a guest that used high LBA numbers wanted to access
      data, the LBA got truncated down to 16 bits, giving the guest garbage.
      
      This patch adds support for LBAs higher than 16 bits. I've tested that it
      works just fine with SeaBIOS and Linux guests. This patch also unbreaks
      the often reported grub errors people have seen with AHCI.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      1fddfba1
    • M
      block: Remove type hint, it's guest matter, doesn't belong here · 8d278467
      Markus Armbruster 提交于
      No users of bdrv_get_type_hint() left.  bdrv_set_type_hint() can make
      the media removable by side effect.  Make that explicit.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      8d278467
    • M
      blockdev: Store -drive option media in DriveInfo · 95b5edcd
      Markus Armbruster 提交于
      DriveInfo is closely tied to -drive, and like -drive, it mixes
      information about host and guest part of the block device.  Unlike
      DriveInfo, BlockDriverState should be about the host part only.
      
      One of the remaining guest bits there is the "type hint".  -drive
      option media sets it, and qdevs "ide-drive", "scsi-disk" and non-qdev
      IF_XEN devices check it to pick HD vs. CD.
      
      Communicate -drive option media via new DriveInfo member media_cd
      instead.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      95b5edcd
    • M
      block QMP: Deprecate query-block's "type", drop info block's "type=" · d8aeeb31
      Markus Armbruster 提交于
      query-block's specification documents response member "type" with
      values "hd", "cdrom", "floppy", "unknown".
      
      Its value is unreliable: a block device used as floppy has type
      "floppy" if created with if=floppy, but type "hd" if created with
      if=none.
      
      That's because with if=none, the type is at best a declaration of
      intent: the drive can be connected to any guest device.  Its type is
      really the guest device's business.  Reporting it here is wrong.
      
      No known user of QMP uses "type".  It's unlikely that any unknown
      users exist, because its value is useless unless you know how the
      block device was created.  But then you also know the true value.
      
      Fixing the broken value risks breaking (hypothetical!) clients that
      somehow rely on the current behavior.  Not fixing the value risks
      breaking (hypothetical!) clients that rely on the value to be
      accurate.  Can't entirely avoid hypothetical lossage.  Change the
      value to be always "unknown".
      
      This makes "info block" always report "type=unknown".  Pointless.
      Change it to not report the type.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      d8aeeb31
    • M
      defaults: ide-cd, ide-hd and scsi-cd devices suppress default CD-ROM · af6bf132
      Markus Armbruster 提交于
      ide-hd has to suppress the default CD-ROM, or else you can't put one
      on secondary master without -nodefaults.
      
      Unlike legacy scsi-disk, scsi-cd suppresses default CD-ROM.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      af6bf132
    • M
      scsi: Split qdev "scsi-disk" into "scsi-hd" and "scsi-cd" · b443ae67
      Markus Armbruster 提交于
      A "scsi-disk" is either a hard disk or a CD-ROM, depending on the
      associated BlockDriverState's type hint.  Unclean; disk vs. CD belongs
      to the guest part, not the host part.
      
      Have separate qdevs "scsi-hd" and "scsi-cd" to model disk vs. CD in
      the guest part.
      
      Keep scsi-disk for backward compatibility.
      
      Don't copy scsi-disk property removable to scsi-cd.  It's not used and
      always zero(!) there.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      b443ae67
    • M
      ide: Split qdev "ide-drive" into "ide-hd" and "ide-cd" · 1f56e32a
      Markus Armbruster 提交于
      An "ide-drive" is either a hard disk or a CD-ROM, depending on the
      associated BlockDriverState's type hint.  Unclean; disk vs. CD belongs
      to the guest part, not the host part.
      
      Have separate qdevs "ide-hd" and "ide-cd" to model disk vs. CD in
      the guest part.
      
      Keep ide-drive for backward compatibility.
      
      "ide-disk" would perhaps be a nicer name than "ide-hd", but there's
      already "scsi-disk", which is like "ide-drive", and will be likewise
      split in the next commit.  {ide,scsi}-{hd,cd} is the best consistent
      set of names I could find within the backward compatibility
      straightjacket.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      1f56e32a
  6. 18 5月, 2011 4 次提交
    • S
      qed: support for growing images · 77a5a000
      Stefan Hajnoczi 提交于
      The .bdrv_truncate() operation resizes images and growing is easy to
      implement in QED.  Simply check that the new size is valid and then
      update the image_size header field to reflect the new size.
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      77a5a000
    • D
      qemu_img: is_not_zero() optimization · f6a00aa1
      Dmitry Konishchev 提交于
      I run qemu-img under profiler and realized, that most of CPU time is
      consumed by is_not_zero() function. I had made a couple of optimizations
      on it and got the following output for `time qemu-img convert -O qcow2
      volume.qcow2 snapshot.qcow2`:
      
      Original qemu-img:
      real 0m56.159s
      user 0m34.670s
      sys  0m12.079s
      
      Patched qemu-img:
      real 0m34.805s
      user 0m18.445s
      sys  0m12.552s
      Signed-off-by: NDmitry Konishchev <konishchev@gmail.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      f6a00aa1
    • S
      qed: Periodically flush and clear need check bit · 6f321e93
      Stefan Hajnoczi 提交于
      One strategy to limit the startup delay of consistency check when
      opening image files is to ensure that the file is marked dirty for as
      little time as possible.
      
      QED currently marks the image dirty when the first allocating write
      request is issued and clears the dirty bit again when the image is
      cleanly closed.  In practice that means the image is marked dirty for
      most of a guest's lifetime and prone to being in a dirty state upon
      crash or power failure.
      
      It is safe to clear the dirty bit after all allocating write requests
      have completed and a flush has been performed.  This patch adds a timer
      after the last allocating write request completes.  When the timer fires
      it will flush and then clear the dirty bit.  The timer is set to 5
      seconds and is cancelled upon arrival of a new allocating write request.
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      6f321e93
    • S
      qemu-tool: Stub out qemu-timer functions · 5fc09ca5
      Stefan Hajnoczi 提交于
      Block drivers may use timers for flushing metadata to disk or
      reconnecting to a network drive.  Stub out the following functions in
      qemu-tool.c:
      
      QEMUTimer *qemu_new_timer_ns(QEMUClock *clock, int scale,
                                   QEMUTimerCB *cb, void *opaque)
      void qemu_free_timer(QEMUTimer *ts)
      void qemu_del_timer(QEMUTimer *ts)
      void qemu_mod_timer(QEMUTimer *ts, int64_t expire_time)
      int64_t qemu_get_clock_ns(QEMUClock *clock)
      
      They will result in timers never firing when linked against qemu-tool.o.
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      5fc09ca5