1. 20 11月, 2017 6 次提交
  2. 18 11月, 2017 21 次提交
  3. 17 11月, 2017 13 次提交
    • P
      Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2017-11-17' into staging · 085ee6d2
      Peter Maydell 提交于
      nbd patches for 2017-11-17
      
      Eric Blake - nbd: Don't crash when server reports NBD_CMD_READ failure
      Eric Blake - nbd/client: Use error_prepend() correctly
      Eric Blake - nbd/client: Don't hard-disconnect on ESHUTDOWN from server
      Eric Blake - nbd/server: Fix error reporting for bad requests
      
      # gpg: Signature made Fri 17 Nov 2017 14:53:30 GMT
      # gpg:                using RSA key 0xA7A16B4A2527436A
      # gpg: Good signature from "Eric Blake <eblake@redhat.com>"
      # gpg:                 aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>"
      # gpg:                 aka "[jpeg image of size 6874]"
      # Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2  F3AA A7A1 6B4A 2527 436A
      
      * remotes/ericb/tags/pull-nbd-2017-11-17:
        nbd/server: Fix error reporting for bad requests
        nbd/client: Don't hard-disconnect on ESHUTDOWN from server
        nbd/client: Use error_prepend() correctly
        nbd: Don't crash when server reports NBD_CMD_READ failure
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      085ee6d2
    • E
      nbd/server: Fix error reporting for bad requests · fed5f8f8
      Eric Blake 提交于
      The NBD spec says an attempt to NBD_CMD_TRIM on a read-only
      export should fail with EPERM, as a trim has the potential
      to change disk contents, but we were relying on the block
      layer to catch that for us, which might not always give the
      right error (and even if it does, it does not let us pass
      back a sane message for structured replies).
      
      The NBD spec says an attempt to NBD_CMD_WRITE_ZEROES out of
      bounds should fail with ENOSPC, not EINVAL.
      
      Our check for u64 offset + u32 length wraparound up front is
      pointless; nothing uses offset until after the second round
      of sanity checks, and we can just as easily ensure there is
      no wraparound by checking whether offset is in bounds (since
      a disk size cannot exceed off_t which is 63 bits, adding a
      32-bit number for a valid offset can't overflow).  Bonus:
      dropping the up-front check lets us keep the connection alive
      after NBD_CMD_WRITE, whereas before we would drop the
      connection (of course, any client sending a packet that would
      trigger the failure is already buggy, so it's also okay to
      drop the connection, but better quality-of-implementation
      never hurts).
      
      Solve all of these issues by some code motion and improved
      request validation.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <20171115213557.3548-1-eblake@redhat.com>
      Reviewed-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      fed5f8f8
    • E
      nbd/client: Don't hard-disconnect on ESHUTDOWN from server · 01b05c66
      Eric Blake 提交于
      The NBD spec says that a server may fail any transmission request
      with ESHUTDOWN when it is apparent that no further request from
      the client can be successfully honored.  The client is supposed
      to then initiate a soft shutdown (wait for all remaining in-flight
      requests to be answered, then send NBD_CMD_DISC).  However, since
      qemu's server never uses ESHUTDOWN errors, this code was mostly
      untested since its introduction in commit b6f5d3b5.
      
      More recently, I learned that nbdkit as the NBD server is able to
      send ESHUTDOWN errors, so I finally tested this code, and noticed
      that our client was special-casing ESHUTDOWN to cause a hard
      shutdown (immediate disconnect, with no NBD_CMD_DISC), but only
      if the server sends this error as a simple reply.  Further
      investigation found that commit d2febedb introduced a regression
      where structured replies behave differently than simple replies -
      but that the structured reply behavior is more in line with the
      spec (even if we still lack code in nbd-client.c to properly quit
      sending further requests).  So this patch reverts the portion of
      b6f5d3b5 that introduced an improper hard-disconnect special-case
      at the lower level, and leaves the future enhancement of a nicer
      soft-disconnect at the higher level for another day.
      
      CC: qemu-stable@nongnu.org
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <20171113194857.13933-1-eblake@redhat.com>
      Reviewed-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      01b05c66
    • E
      nbd/client: Use error_prepend() correctly · cb6b1a3f
      Eric Blake 提交于
      When using error prepend(), it is necessary to end with a space
      in the format string; otherwise, messages come out incorrectly,
      such as when connecting to a socket that hangs up immediately:
      
      can't open device nbd://localhost:10809/: Failed to read dataUnexpected end-of-file before all bytes were read
      
      Originally botched in commit e44ed99d, then several more instances
      added in the meantime.
      
      Pre-existing and not fixed here: we are inconsistent on capitalization;
      some of our messages start with lower case, and others start with upper,
      although the use of error_prepend() is much nicer to read when all
      fragments consistently start with lower.
      
      CC: qemu-stable@nongnu.org
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <20171113152424.25381-1-eblake@redhat.com>
      Reviewed-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      cb6b1a3f
    • E
      nbd: Don't crash when server reports NBD_CMD_READ failure · 08ace1d7
      Eric Blake 提交于
      If a server fails a read, for example with EIO, but the connection
      is still live, then we would crash trying to print a non-existent
      error message in nbd_client_co_preadv().  For consistency, also
      change the error printout in nbd_read_reply_entry(), although that
      instance does not crash.  Bug introduced in commit f140e300.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <20171112013936.5942-1-eblake@redhat.com>
      Reviewed-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      08ace1d7
    • D
      qcow2: fix image corruption after committing qcow2 image into base · f0603329
      Daniel P. Berrange 提交于
      After committing the qcow2 image contents into the base image, qemu-img
      will call bdrv_make_empty to drop the payload in the layered image.
      
      When this is done for qcow2 images, it blows away the LUKS encryption
      header, making the resulting image unusable. There are two codepaths
      for emptying a qcow2 image, and the second (slower) codepath leaves
      the LUKS header intact, so force use of that codepath.
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      f0603329
    • K
      block: Deprecate bdrv_set_read_only() and users · 398e6ad0
      Kevin Wolf 提交于
      bdrv_set_read_only() is used by some block drivers to override the
      read-only option given by the user. This is not how read-only images
      generally work in QEMU: Instead of second guessing what the user really
      meant (which currently includes making an image read-only even if the
      user didn't only use the default, but explicitly said read-only=off), we
      should error out if we can't provide what the user requested.
      
      This adds deprecation warnings to all callers of bdrv_set_read_only() so
      that the behaviour can be corrected after the usual deprecation period.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      398e6ad0
    • D
      qcow2: don't permit changing encryption parameters · f66afbe2
      Daniel P. Berrange 提交于
      Currently if trying to change encryption parameters on a qcow2 image, qemu-img
      will abort. We already explicitly check for attempt to change encrypt.format
      but missed other parameters like encrypt.key-secret. Rather than list each
      parameter, just blacklist changing of all parameters with a 'encrypt.' prefix.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Reviewed-by: NAlberto Garcia <berto@igalia.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      f66afbe2
    • K
      block: Fix error path in bdrv_backing_update_filename() · 64730694
      Kevin Wolf 提交于
      error_setg_errno() takes a positive errno code. Spotted by Coverity
      (CID 1381628).
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NAlberto Garcia <berto@igalia.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      64730694
    • K
      qemu-iotests: Use -nographic in 182 · c60f6fcf
      Kevin Wolf 提交于
      This avoids that random UI frontend error messages end up in the output.
      In particular, we were seeing this line in CI error logs:
      
      +Unable to init server: Could not connect: Connection refused
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NKashyap Chamarthy <kchamart@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      c60f6fcf
    • W
      replication: Fix replication open fail · 611e0653
      Wang Guang 提交于
      replication_child_perm request write
      permissions for all child which will lead bdrv_check_perm fail.
      replication_child_perm() should request write
      permissions only if it is writable itself.
      Signed-off-by: NWang Guang <wang.guang55@zte.com.cn>
      Signed-off-by: NWang Yong <wang.yong155@zte.com.cn>
      Reviewed-by: NXie Changlong <xiechanglong@cmss.chinamobile.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      611e0653
    • P
      Merge remote-tracking branch 'remotes/kraxel/tags/ui-20171117-pull-request' into staging · fec035a5
      Peter Maydell 提交于
      sdl2 fixes for 2.11
      
      # gpg: Signature made Fri 17 Nov 2017 10:06:27 GMT
      # gpg:                using RSA key 0x4CB6D8EED3E87138
      # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
      # gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
      # gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
      # Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138
      
      * remotes/kraxel/tags/ui-20171117-pull-request:
        sdl2: Fix broken display updating after the window is hidden
        sdl2: Do not leave grab when fullscreen
        sdl2: Fix dead keyboard after fullsceen
        sdl2: Use the same pointer show/hide logic for absolute and relative mode
        sdl2: Do not quit the emulator when an auxilliary window is closed
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      fec035a5
    • P
      Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging · b91f0f25
      Peter Maydell 提交于
      pc, pci, virtio: fixes for rc1
      
      A bunch of fixes all over the place.
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      
      # gpg: Signature made Thu 16 Nov 2017 16:37:21 GMT
      # gpg:                using RSA key 0x281F0DB8D28D5469
      # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>"
      # gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>"
      # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
      #      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469
      
      * remotes/mst/tags/for_upstream:
        tests/bios-tables-test: Fix endianess problems when passing data to iasl
        build-sys: restrict vmcoreinfo to fw_cfg+dma capable targets
        vmcoreinfo: put it in the 'misc' device category
        NUMA: Enable adding NUMA node implicitly
        tests/acpi-test-data: update _CRS in DSDT
        hw/pcie-pci-bridge: restrict to X86 and ARM
        hw/pci-host: Fix x86 Host Bridges 64bit PCI hole
        pci: Initialize pci_dev->name before use
        fix: unrealize virtio device if we fail to hotplug it
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      b91f0f25