1. 15 7月, 2013 1 次提交
    • K
      ahci: Fix FLUSH command · a62eaa26
      Kevin Wolf 提交于
      AHCI couldn't cope with asynchronous commands that aren't doing DMA, it
      simply wouldn't complete them. Due to the bug fixed in commit f68ec837,
      FLUSH commands would seem to have completed immediately even if they
      were still running on the host. After the commit, they would simply hang
      and never unset the BSY bit, rendering AHCI unusable on any OS sending
      flushes.
      
      This patch adds another callback for the completion of asynchronous
      commands. This is what AHCI really wants to use for its command
      completion logic rather than an DMA completion callback.
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      a62eaa26
  2. 08 5月, 2013 1 次提交
  3. 16 4月, 2013 1 次提交
  4. 09 4月, 2013 1 次提交
    • P
      hw: move headers to include/ · 0d09e41a
      Paolo Bonzini 提交于
      Many of these should be cleaned up with proper qdev-/QOM-ification.
      Right now there are many catch-all headers in include/hw/ARCH depending
      on cpu.h, and this makes it necessary to compile these files per-target.
      However, fixing this does not belong in these patches.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      0d09e41a
  5. 19 12月, 2012 2 次提交
  6. 10 8月, 2012 1 次提交
    • J
      ahci: Fix ahci cdrom read corruptions for reads > 128k · 61f52e06
      Jason Baron 提交于
      While testing q35, which has its cdrom attached to the ahci controller, I found
      that the Fedora 17 install would panic on boot. The panic occurs while
      squashfs is trying to read from the cdrom. The errors are:
      
      [    8.622711] SQUASHFS error: xz_dec_run error, data probably corrupt
      [    8.625180] SQUASHFS error: squashfs_read_data failed to read block
      0x20be48a
      
      I was also able to produce corrupt data reads using an installed piix based
      qemu machine, using 'dd'. I found that the corruptions were only occuring when
      then read size was greater than 128k. For example, the following command
      results in corrupted reads:
      
      dd if=/dev/sr0 of=/tmp/blah bs=256k iflag=direct
      
      The > 128k size reads exercise a different code path than 128k and below. In
      ide_atapi_cmd_read_dma_cb() s->io_buffer_size is capped at 128k. Thus,
      ide_atapi_cmd_read_dma_cb() is called a second time when the read is > 128k.
      However, ahci_dma_rw_buf() restart the read from offset 0, instead of at 128k.
      Thus, resulting in a corrupted read.
      
      To fix this, I've introduced 'io_buffer_offset' field in IDEState to keep
      track of the offset. I've also modified ahci_populate_sglist() to take a new
      3rd offset argument, so that the sglist is property initialized.
      
      I've tested this patch using 'dd' testing, and Fedora 17 now correctly boots
      and installs on q35 with the cdrom ahci controller.
      Signed-off-by: NJason Baron <jbaron@redhat.com>
      Tested-by: NAndreas Färber <afaerber@suse.de>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      61f52e06
  7. 17 7月, 2012 4 次提交
  8. 18 6月, 2012 1 次提交
  9. 19 4月, 2012 1 次提交
  10. 05 4月, 2012 2 次提交
    • F
      ide: Adds wwn=hex qdev option · 95ebda85
      Floris Bos 提交于
      Allow the user to specify a disk's World Wide Name.
      
      Linux guests can address disks by their unique World Wide Name number
      (e.g. /dev/disk/by-id/wwn-0x5001517959123522). This patch adds support
      for assigning a World Wide Name number to a virtual IDE disk.
      
      Cc: kwolf@redhat.com
      Signed-off-by: NFloris Bos <dev@noc-ps.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      95ebda85
    • F
      ide: Add "model=s" qdev option · 27e0c9a1
      Floris Bos 提交于
      Allow the user to override the default disk model name "QEMU HARDDISK".
      
      Some Linux distributions use the /dev/disk/by-id/scsi-SATA_name-of-disk-
      model_serial addressing scheme when refering to partitions in /etc/fstab
      and elsewhere. This causes problems when starting a disk image taken from
      an existing physical server under qemu, because when running under qemu
      name-of-disk-model is always "QEMU HARDDISK".
      
      This patch introduces a model=s option which in combination with the
      existing serial=s option can be used to fake the disk the operating
      system was previously on, allowing the OS to boot properly.
      
      Cc: kwolf@redhat.com
      Signed-off-by: NFloris Bos <dev@noc-ps.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      27e0c9a1
  11. 28 1月, 2012 1 次提交
  12. 29 10月, 2011 1 次提交
  13. 11 10月, 2011 1 次提交
  14. 16 9月, 2011 1 次提交
    • L
      Replace the VMSTOP macros with a proper state type · 1dfb4dd9
      Luiz Capitulino 提交于
      Today, when notifying a VM state change with vm_state_notify(),
      we pass a VMSTOP macro as the 'reason' argument. This is not ideal
      because the VMSTOP macros tell why qemu stopped and not exactly
      what the current VM state is.
      
      One example to demonstrate this problem is that vm_start() calls
      vm_state_notify() with reason=0, which turns out to be VMSTOP_USER.
      
      This commit fixes that by replacing the VMSTOP macros with a proper
      state type called RunState.
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      1dfb4dd9
  15. 12 9月, 2011 3 次提交
  16. 06 9月, 2011 1 次提交
    • M
      ide: Update command code definitions as per ACS-2 Table B.2 · 1d4316d3
      Markus Armbruster 提交于
      Drop WIN_SRST, it has the same value as WIN_DEVICE_RESET.
      
      Drop unused WIN_RESTORE, it has the same value as WIN_RECAL.
      
      Drop codes that are not implemented and long obsolete: WIN_READ_LONG,
      WIN_READ_LONG_ONCE, WIN_WRITE_LONG, WIN_WRITE_LONG_ONCE, WIN_FORMAT
      (all obsolete since ATA4), WIN_ACKMEDIACHANGE, WIN_POSTBOOT,
      WIN_PREBOOT (obsolete since ATA3), WIN_WRITE_SAME (obsolete since
      ATA3, code reused for something else in ACS2), WIN_IDENTIFY_DMA
      (obsolete since ATA4).
      
      Drop codes that are not implemented and vendor-specific:
      EXABYTE_ENABLE_NEST, DISABLE_SEAGATE.
      
      Drop WIN_INIT, it isn't implemented, its value used to be reserved,
      and is used for something else since ATA8.
      
      CFA_IDLEIMMEDIATE isn't specific to CFATA.  ACS-2 shows it as a
      defined command in ATA-1, -2 and -3.  Rename to WIN_IDLEIMMEDIATE2.
      
      Mark vendor specific, retired, and obsolete codes.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      1d4316d3
  17. 26 8月, 2011 1 次提交
    • C
      block: explicit I/O accounting · a597e79c
      Christoph Hellwig 提交于
      Decouple the I/O accounting from bdrv_aio_readv/writev/flush and
      make the hardware models call directly into the accounting helpers.
      
      This means:
       - we do not count internal requests from image formats in addition
         to guest originating I/O
       - we do not double count I/O ops if the device model handles it
         chunk wise
       - we only account I/O once it actuall is done
       - can extent I/O accounting to synchronous or coroutine I/O easily
       - implement I/O latency tracking easily (see the next patch)
      
      I've conveted the existing device model callers to the new model,
      device models that are using synchronous I/O and weren't accounted
      before haven't been updated yet.  Also scsi hasn't been converted
      to the end-to-end accounting as I want to defer that after the pending
      scsi layer overhaul.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      a597e79c
  18. 15 6月, 2011 3 次提交
    • C
      ide: add TRIM support · d353fb72
      Christoph Hellwig 提交于
      Add support for TRIM sub function of the data set management command,
      and wire it up to the qemu discard infrastructure.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      d353fb72
    • C
      ide: allow other dma comands than read and write · 4e1e0051
      Christoph Hellwig 提交于
      Replace the is_read flag with a dma_cmd flag to allow the dma and
      restart logic to handler other commands like TRIM.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      4e1e0051
    • K
      ide: Split error status from status register · def93791
      Kevin Wolf 提交于
      When adding the werror=stop mode, some flags were added to s->status
      which are used to determine what kind of operation should be restarted
      when the VM is continued.
      
      Unfortunately, it turns out that s->status is in fact a device register
      and as such is visible to the guest (some of the abused bits are even
      writable for the guest).
      
      For migration we keep on using the old VMState field (renamed to
      migration_compat_status) if the status register doesn't use any of the
      previously abused bits. If it does, we use a subsection with a clean copy of
      the status register.
      
      The error status is always sent in a subsection if there is any error. It can't
      use the old field because errors happen even without PCI.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      def93791
  19. 19 5月, 2011 1 次提交
    • 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
  20. 27 4月, 2011 1 次提交
  21. 13 4月, 2011 1 次提交
    • A
      atapi: GESN: implement 'media' subcommand · 996faf1a
      Amit Shah 提交于
      Implement the 'media' sub-command of the GET_EVENT_STATUS_NOTIFICATION
      command.  This helps us report tray open, tray closed, no media, media
      present states to the guest.
      
      Newer Linux kernels (2.6.38+) rely on this command to revalidate discs
      after media change.
      
      This patch also sends out tray open/closed status to the guest driver
      when requested e.g. via the CDROM_DRIVE_STATUS ioctl (thanks Markus).
      Without such notification, the guest and qemu's tray open/close status
      was frequently out of sync, causing installers like Anaconda detecting
      no disc instead of tray open, confusing them terribly.
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      Acked-by: NJes Sorensen <Jes.Sorensen@redhat.com>
      Acked-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      996faf1a
  22. 24 1月, 2011 1 次提交
  23. 17 12月, 2010 3 次提交
  24. 12 12月, 2010 1 次提交
  25. 25 11月, 2010 1 次提交
  26. 22 10月, 2010 1 次提交
    • K
      ide: Handle flush failure · e2bcadad
      Kevin Wolf 提交于
      Instead of always assuming success for bdrv_aio_flush, actually do something
      with the error. This respects the werror option and accordingly ignores the
      error, reports it to the guest or stops the VM and retries after cont.
      
      Ignoring the error is trivial, obviously. For stopping the VM and retrying
      later old code can be reused, but we need to introduce a new status for "retry
      a flush". For reporting to the guest, fortunately the same action is required
      as for a failed read/write (status = DRDY | ERR, error = ABRT), so this code
      can be reused as well.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      e2bcadad
  27. 27 7月, 2010 2 次提交
  28. 06 7月, 2010 1 次提交