1. 29 10月, 2013 10 次提交
    • K
      block: Avoid unecessary drv->bdrv_getlength() calls · b94a2610
      Kevin Wolf 提交于
      The block layer generally keeps the size of an image cached in
      bs->total_sectors so that it doesn't have to perform expensive
      operations to get the size whenever it needs it.
      
      This doesn't work however when using a backend that can change its size
      without qemu being aware of it, i.e. passthrough of removable media like
      CD-ROMs or floppy disks. For this reason, the caching is disabled when a
      removable device is used.
      
      It is obvious that checking whether the _guest_ device has removable
      media isn't the right thing to do when we want to know whether the size
      of the host backend can change. To make things worse, non-top-level
      BlockDriverStates never have any device attached, which makes qemu
      assume they are removable, so drv->bdrv_getlength() is always called on
      the protocol layer. In the case of raw-posix, this causes unnecessary
      lseek() system calls, which turned out to be rather expensive.
      
      This patch completely changes the logic and disables bs->total_sectors
      caching only for certain block driver types, for which a size change is
      expected: host_cdrom and host_floppy on POSIX, host_device on win32; also
      the raw format in case it sits on top of one of these protocols, but in
      the common case the nested bdrv_getlength() call on the protocol driver
      will use the cache again and avoid an expensive drv->bdrv_getlength()
      call.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      b94a2610
    • T
      block: Disable BDRV_O_COPY_ON_READ for the backing file · 87a5debd
      Thibaut LAURENT 提交于
      Since commit 0ebd24e0,
      bdrv_open_common will throw an error when trying to open a file
      read-only with the BDRV_O_COPY_ON_READ flag set.
      Although BDRV_O_RDWR is unset for the backing files,
      BDRV_O_COPY_ON_READ is still passed on if copy-on-read was requested
      for the drive. Let's unset this flag too before opening the backing
      file, or bdrv_open_common will fail.
      Signed-off-by: NThibaut LAURENT <thibaut.laurent@gmail.com>
      Reviewed-by: NBenoit Canet <benoit@irqsave.net>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      87a5debd
    • A
      ahci: fix win7 hang on boot · 8464b273
      Alexander Graf 提交于
      When AHCI executes an asynchronous IDE command, it checked DRDY without
      checking either DRQ or BSY.  This sometimes caused interrupt to be sent
      before command is actually completed.
      
      This resulted in a race condition: if guest then managed to access the
      device before command has completed, it would hang waiting for an
      interrupt.
      This was observed with windows 7 guests.
      
      To fix, check for DRQ or BSY in additiona to DRDY, if set,
      the command is asynchronous so delay the interrupt until
      asynchronous done callback is invoked.
      Reported-by: NMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Tested-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      8464b273
    • L
      sheepdog: pass copy_policy in the request · 1841f880
      Liu Yuan 提交于
      Currently copy_policy isn't used. Recent sheepdog supports erasure coding, which
      make use of copy_policy internally, but require client explicitly passing
      copy_policy from base inode to newly creately inode for snapshot related
      operations.
      
      If connected sheep daemon doesn't utilize copy_policy, passing it to sheep
      daemon is just one extra null effect operation. So no compatibility problem.
      
      With this patch, sheepdog can provide erasure coded volume for QEMU VM.
      
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NLiu Yuan <namei.unix@gmail.com>
      Acked-by: NMORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      1841f880
    • L
      sheepdog: explicitly set copies as type uint8_t · 29a67f7e
      Liu Yuan 提交于
      'copies' is actually uint8_t since day one, but request headers and some helper
      functions parameterize it as uint32_t for unknown reasons and effectively
      reserve 24 bytes for possible future use. This patch explicitly set the correct
      for copies and reserve the left bytes.
      
      This is a preparation patch that allow passing copy_policy in request header.
      
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NLiu Yuan <namei.unix@gmail.com>
      Acked-by: NMORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      29a67f7e
    • M
      block: Don't copy backing file name on error · 61ed2684
      Max Reitz 提交于
      bdrv_open_backing_file() tries to copy the backing file name using
      pstrcpy directly after calling bdrv_open() to open the backing file
      without checking whether that was actually successful. If it was not,
      ps->backing_hd->file will probably be NULL and qemu will crash.
      
      Fix this by moving pstrcpy after checking whether bdrv_open() succeeded.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NBenoit Canet <benoit@irqsave.net>
      Reviewed-by: Amos_沧海桑田's avatarAmos Kong <kongjianjun@gmail.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      61ed2684
    • K
      tests: Multiboot mmap test case · d1f3a23b
      Kevin Wolf 提交于
      This adds a test case for Multiboot memory map in the tests/multiboot
      directory, where future i386 test kernels can be dropped. Because this
      requires an x86 build host and an installed 32 bit libgcc, the test is
      not part of a regular 'make check'.
      
      The reference output for the test is verified against test runs of the
      same multiboot kernel booted by some GRUB 0.97.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      d1f3a23b
    • K
      ide-test: Check what happens with bus mastering disabled · d7b7e580
      Kevin Wolf 提交于
      The main goal is that qemu doesn't crash.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      d7b7e580
    • K
      exec: Fix bounce buffer allocation in address_space_map() · e85d9db5
      Kevin Wolf 提交于
      This fixes a regression introduced by commit e3127ae0, which kept the
      allocation size of the bounce buffer limited to one page in order to
      avoid unbounded allocations (as explained in the commit message of
      6d16c2f8), but broke the reporting of the shortened bounce buffer to
      the caller. The caller therefore assumes that the full requested size
      was provided and causes memory corruption when writing beyond the end of
      the actually allocated buffer.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      e85d9db5
    • M
      qcow2: Flush image after creation · ba2ab2f2
      Max Reitz 提交于
      Opening the qcow2 image with BDRV_O_NO_FLUSH prevents any flushes during
      the image creation. This means that the image has not yet been flushed
      to disk when qemu-img create exits. This flush is delayed until the next
      operation on the image involving opening it without BDRV_O_NO_FLUSH and
      closing (or directly flushing) it. For large images and/or images with a
      small cluster size and preallocated metadata, this flush may take a
      significant amount of time and may occur unexpectedly.
      
      Reopening the image without BDRV_O_NO_FLUSH right before the end of
      qcow2_create2() results in hoisting the potentially costly flush into
      the image creation, which is expected to take some time (whereas
      successive image operations may be not).
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NBenoit Canet <benoit@irqsave.net>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      ba2ab2f2
  2. 25 10月, 2013 1 次提交
  3. 24 10月, 2013 4 次提交
  4. 21 10月, 2013 1 次提交
  5. 19 10月, 2013 7 次提交
    • A
      Merge remote-tracking branch 'qemu-kvm/uq/master' into staging · fc8ead74
      Anthony Liguori 提交于
      # By Paolo Bonzini (2) and Jan Kiszka (1)
      # Via Gleb Natapov
      * qemu-kvm/uq/master:
        kvmvapic: Prevent reading beyond the end of guest RAM
        x86: cpuid: reconstruct leaf 0Dh data
        x86: fix migration from pre-version 12
      
      Message-id: 1382108641-4862-1-git-send-email-pbonzini@redhat.com
      Signed-off-by: NAnthony Liguori <aliguori@amazon.com>
      fc8ead74
    • A
      Merge remote-tracking branch 'stefanha/net' into staging · 3551643e
      Anthony Liguori 提交于
      # By Amos Kong
      # Via Stefan Hajnoczi
      * stefanha/net:
        net/rtl8139: update network information when macaddr is changed in guest
        net/e1000: update network information when macaddr is changed in guest
        net: update nic info during device reset
      
      Message-id: 1382103314-21608-1-git-send-email-stefanha@redhat.com
      Signed-off-by: NAnthony Liguori <aliguori@amazon.com>
      3551643e
    • A
      Merge remote-tracking branch 'stefanha/block' into staging · 1da9772d
      Anthony Liguori 提交于
      # By Fam Zheng (3) and others
      # Via Stefan Hajnoczi
      * stefanha/block:
        vmdk: fix VMFS extent parsing
        vmdk: Only read cid from image file when opening
        virtio: Remove unneeded memcpy
        block/raw-win32: Always use -errno in hdev_open
        blockdev: fix cdrom read_only flag
        sd: Avoid access to NULL BlockDriverState
        hmp: drop bogus "[not inserted]"
      
      Message-id: 1382105915-27735-1-git-send-email-stefanha@redhat.com
      Signed-off-by: NAnthony Liguori <aliguori@amazon.com>
      1da9772d
    • A
      Merge remote-tracking branch 'bonzini/iommu-for-anthony' into staging · 98964491
      Anthony Liguori 提交于
      # By Paolo Bonzini (10) and others
      # Via Paolo Bonzini
      * bonzini/iommu-for-anthony:
        exec: remove qemu_safe_ram_ptr
        icount: make it thread-safe
        icount: document (future) locking rules for icount
        icount: prepare the code for future races in calling qemu_clock_warp
        icount: reorganize icount_warp_rt
        icount: use cpu_get_icount() directly
        timer: add timer_mod_anticipate and timer_mod_anticipate_ns
        timer: extract timer_mod_ns_locked and timerlist_rearm
        timer: make qemu_clock_enable sync between disable and timer's cb
        qemu-thread: add QemuEvent
        timer: protect timers_state's clock with seqlock
        seqlock: introduce read-write seqlock
        vga: Mark relevant portio lists regions as coalesced MMIO flushing
        cirrus: Mark vga io region as coalesced MMIO flushing
        portio: Allow to mark portio lists as coalesced MMIO flushing
        compatfd: switch to QemuThread
        memory: fix 128 arithmetic in info mtree
      
      Message-id: 1382024935-28297-1-git-send-email-pbonzini@redhat.com
      Signed-off-by: NAnthony Liguori <aliguori@amazon.com>
      98964491
    • A
      Merge remote-tracking branch 'bonzini/configure' into staging · 1cb9b64d
      Anthony Liguori 提交于
      # By Peter Maydell (3) and Ákos Kovács (2)
      # Via Paolo Bonzini
      * bonzini/configure:
        ui/Makefile.objs: delete unnecessary cocoa.o dependency
        default-configs/: CONFIG_GDBSTUB_XML removed
        Makefile.target: CONFIG_NO_* variables removed
        rules.mak: New string testing functions
        rules.mak: New logical functions for handling y/n values
      1cb9b64d
    • A
      Merge remote-tracking branch 'spice/spice.v75' into staging · c21611ab
      Anthony Liguori 提交于
      # By Gerd Hoffmann (2) and others
      # Via Gerd Hoffmann
      * spice/spice.v75:
        spice: fix multihead support
        spice-display: add display channel id to the debug messages.
        Fix VNC SASL authentication when using a QXL device
        spice: replace use of deprecated API
      
      Message-id: 1382006760-19388-1-git-send-email-kraxel@redhat.com
      Signed-off-by: NAnthony Liguori <aliguori@amazon.com>
      c21611ab
    • A
      Merge remote-tracking branch 'filippov/tags/20131015-xtensa' into staging · cd22e320
      Anthony Liguori 提交于
      xtensa queue 2013-10-15
      
      # gpg: Signature made Tue 15 Oct 2013 06:27:41 AM PDT using RSA key ID F83FA044
      # gpg: Can't check signature: public key not found
      
      # By Max Filippov
      # Via Max Filippov
      * filippov/tags/20131015-xtensa:
        target-xtensa: add in_asm logging
      
      Message-id: 1381844297-1728-1-git-send-email-jcmvbkbc@gmail.com
      Signed-off-by: NAnthony Liguori <aliguori@amazon.com>
      cd22e320
  6. 18 10月, 2013 6 次提交
  7. 17 10月, 2013 11 次提交