1. 08 4月, 2019 3 次提交
  2. 07 4月, 2019 1 次提交
    • P
      Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging · f55a585d
      Peter Maydell 提交于
      pci, pc, virtio: fixes
      
      intel-iommu fixes
      virtio typo fixes
      linker: a couple of asserts for consistency/security
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      
      # gpg: Signature made Tue 02 Apr 2019 16:51:19 BST
      # gpg:                using RSA key 281F0DB8D28D5469
      # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [full]
      # gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>" [full]
      # 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:
        intel_iommu: Drop extended root field
        intel_iommu: Fix root_scalable migration breakage
        virtio-net: Fix typo in comment
        intel_iommu: Correct caching-mode error message
        acpi: verify file entries in bios_linker_loader_add_pointer()
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      f55a585d
  3. 06 4月, 2019 1 次提交
    • P
      Merge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20190405a' into staging · 90fb864a
      Peter Maydell 提交于
      Migration fixes pull for 4.0
      
      A couple of fixes for crashes in colo and
      migration parameters.
      
      # gpg: Signature made Fri 05 Apr 2019 16:47:38 BST
      # gpg:                using RSA key 45F5C71B4A0CB7FB977A9FA90516331EBC5BFDE7
      # gpg: Good signature from "Dr. David Alan Gilbert (RH2) <dgilbert@redhat.com>" [full]
      # Primary key fingerprint: 45F5 C71B 4A0C B7FB 977A  9FA9 0516 331E BC5B FDE7
      
      * remotes/dgilbert/tags/pull-migration-20190405a:
        migration: Fix migrate_set_parameter
        migration/ram.c: Fix codes conflict about bitmap_mutex
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      90fb864a
  4. 05 4月, 2019 7 次提交
    • J
      migration: Fix migrate_set_parameter · d013283a
      Juan Quintela 提交于
      Otherwise we are setting err twice, what is wrong and causes an abort.
      Signed-off-by: NJuan Quintela <quintela@redhat.com>
      Message-Id: <20190403114958.3705-2-quintela@redhat.com>
      Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      d013283a
    • Z
      migration/ram.c: Fix codes conflict about bitmap_mutex · c6e5bafb
      Zhang Chen 提交于
      I found upstream codes conflict with COLO and lead to crash,
      and I located to this patch:
      
      commit 386a907b
      Author: Wei Wang <wei.w.wang@intel.com>
      Date:   Tue Dec 11 16:24:49 2018 +0800
      
      migration: use bitmap_mutex in migration_bitmap_clear_dirty
      
      My colleague Wei's patch add bitmap_mutex in migration_bitmap_clear_dirty,
      but COLO didn't initialize the bitmap_mutex. So we always get an error
      when COLO start up. like that:
      qemu-system-x86_64: util/qemu-thread-posix.c:64: qemu_mutex_lock_impl: Assertion `mutex->initialized' failed.
      
      This patch add the bitmap_mutex initialize and destroy in COLO
      lifecycle.
      Signed-off-by: NZhang Chen <chen.zhang@intel.com>
      Message-Id: <20190329222951.28945-1-chen.zhang@intel.com>
      Reviewed-by: NWei Wang <wei.w.wang@intel.com>
      Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      c6e5bafb
    • P
      Merge remote-tracking branch 'remotes/palmer/tags/riscv-for-master-4.0-rc3-v2' into staging · 10546e09
      Peter Maydell 提交于
      RISC-V Patches for 4.0-rc3, v2
      
      This patch set contains a pair of tightly coupled PLIC bug fixes:
      
      * We were calculating the PLIC addresses incorrectly.
      * We were installing the wrong number of PLIC interrupts.
      
      The two bugs togther resulted in a mostly-working system, but they're
      impossible to seperate because fixing one bug would result in
      significant breakage.  As a result they're in the same patch.
      
      There is also a cleanup to use qemu_log_mask(LOG_GUEST_ERROR,...) for
      error reporting.
      
      As far as I know these are the last outstanding RISC-V patches for 4.0.
      
      v2 no longer fails "make check" for me... sorry!
      
      # gpg: Signature made Fri 05 Apr 2019 01:33:57 BST
      # gpg:                using RSA key 00CE76D1834960DFCE886DF8EF4CA1502CCBAB41
      # gpg:                issuer "palmer@dabbelt.com"
      # gpg: Good signature from "Palmer Dabbelt <palmer@dabbelt.com>" [unknown]
      # gpg:                 aka "Palmer Dabbelt <palmer@sifive.com>" [unknown]
      # gpg: WARNING: This key is not certified with a trusted signature!
      # gpg:          There is no indication that the signature belongs to the owner.
      # Primary key fingerprint: 00CE 76D1 8349 60DF CE88  6DF8 EF4C A150 2CCB AB41
      
      * remotes/palmer/tags/riscv-for-master-4.0-rc3-v2:
        riscv: plic: Log guest errors
        riscv: plic: Fix incorrect irq calculation
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      10546e09
    • P
      Merge remote-tracking branch 'remotes/aperard/tags/pull-xen-20190404' into staging · bc939abe
      Peter Maydell 提交于
      Xen queue
      
      xen-block fixes
      
      # gpg: Signature made Thu 04 Apr 2019 18:04:38 BST
      # gpg:                using RSA key F80C006308E22CFD8A92E7980CF5572FD7FB55AF
      # gpg:                issuer "anthony.perard@citrix.com"
      # gpg: Good signature from "Anthony PERARD <anthony.perard@gmail.com>" [marginal]
      # gpg:                 aka "Anthony PERARD <anthony.perard@citrix.com>" [marginal]
      # gpg: WARNING: This key is not certified with sufficiently trusted signatures!
      # gpg:          It is not certain that the signature belongs to the owner.
      # Primary key fingerprint: 5379 2F71 024C 600F 778A  7161 D8D5 7199 DF83 42C8
      #      Subkey fingerprint: F80C 0063 08E2 2CFD 8A92  E798 0CF5 572F D7FB 55AF
      
      * remotes/aperard/tags/pull-xen-20190404:
        xen-block: scale sector based quantities correctly
        xen-block: only advertize discard to the frontend when it is enabled...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      bc939abe
    • A
      riscv: plic: Log guest errors · 79bcac25
      Alistair Francis 提交于
      Instead of using error_report() to print guest errors let's use
      qemu_log_mask(LOG_GUEST_ERROR,...) to log the error.
      Signed-off-by: NAlistair Francis <alistair.francis@wdc.com>
      Signed-off-by: NPalmer Dabbelt <palmer@sifive.com>
      79bcac25
    • A
      riscv: plic: Fix incorrect irq calculation · 0feb4a71
      Alistair Francis 提交于
      This patch fixes four different things, to maintain bisectability they
      have been merged into a single patch. The following fixes are below:
      
      sifive_plic: Fix incorrect irq calculation
      The irq is incorrectly calculated to be off by one. It has worked in the
      past as the priority_base offset has also been set incorrectly. We are
      about to fix the priority_base offset so first first the irq
      calculation.
      
      sifive_u: Fix PLIC priority base offset and numbering
      According to the FU540 manual the PLIC source priority address starts at
      an offset of 0x04 and not 0x00. The same manual also specifies that the
      PLIC only has 53 source priorities. Fix these two incorrect header
      files.
      
      We also need to over extend the plic_gpios[] array as the PLIC sources
      count from 1 and not 0.
      
      riscv: sifive_e: Fix PLIC priority base offset
      According to the FE31 manual the PLIC source priority address starts at
      an offset of 0x04 and not 0x00.
      
      riscv: virt: Fix PLIC priority base offset
      Update the virt offsets based on the newly updated SiFive U and SiFive E
      offsets.
      Signed-off-by: NAlistair Francis <alistair.francis@wdc.com>
      Signed-off-by: NPalmer Dabbelt <palmer@sifive.com>
      0feb4a71
    • P
      xen-block: scale sector based quantities correctly · 2bcd05cf
      Paul Durrant 提交于
      The Xen blkif protocol requires that sector based quantities should be
      interpreted strictly as multiples of 512 bytes. Specifically:
      
      "first_sect and last_sect in blkif_request_segment, as well as
      sector_number in blkif_request, are always expressed in 512-byte units."
      
      Commit fcab2b46 "xen: add header and build dataplane/xen-block.c"
      incorrectly modified behaviour to use the block device logical_block_size
      property as the scale, instead of correctly shifting values by the
      hardcoded BDRV_SECTOR_BITS (and hence scaling them to 512 byte units).
      This patch undoes that change and restores compliance with the spec.
      
      Furthermore, this patch also restores the original xen_disk behaviour
      of advertizing a hardcoded 'sector-size' value of 512 in xenstore and
      scaling 'sectors' accordingly. The realize() method is also modified to
      fail if logical_block_size is set to anything other than 512.
      Signed-off-by: NPaul Durrant <paul.durrant@citrix.com>
      Reviewed-by: NAnthony PERARD <anthony.perard@citrix.com>
      Message-Id: <20190401121719.27208-1-paul.durrant@citrix.com>
      Signed-off-by: NAnthony PERARD <anthony.perard@citrix.com>
      2bcd05cf
  5. 04 4月, 2019 1 次提交
    • P
      xen-block: only advertize discard to the frontend when it is enabled... · 15f08450
      Paul Durrant 提交于
      ...and properly enable it when synthesizing a drive.
      
      The Xen toolstack sets 'discard-enable' to '1' in xenstore when it wants
      to enable discard on a specified image. The code in
      xen_block_drive_create() correctly parses this and uses it to set
      'discard' to 'unmap' for the file_layer, but fails to do the same for the
      driver_layer (which effectively disables it). Meanwhile the code in
      xen_block_realize() advertizes discard support to the frontend in the
      default case (because conf->discard_granularity defaults to -1), even when
      the underlying image may not handle it.
      
      This patch adds the missing option to the driver_layer in
      xen_block_driver_create() and checks whether BDRV_O_UNMAP is actually
      set on the block device before advertizing discard to the frontend.
      In the case that discard is supported it also makes sure that the
      granularity is set to the physical block size.
      Signed-off-by: NPaul Durrant <paul.durrant@citrix.com>
      Reviewed-by: NAnthony PERARD <anthony.perard@citrix.com>
      Message-Id: <20190320142825.24565-1-paul.durrant@citrix.com>
      Signed-off-by: NAnthony PERARD <anthony.perard@citrix.com>
      15f08450
  6. 03 4月, 2019 6 次提交
    • P
      Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20190403' into staging · f4b37171
      Peter Maydell 提交于
      Fix taking address of fields in packed structs warnings
      by gcc 9
      
      # gpg: Signature made Wed 03 Apr 2019 10:58:42 BST
      # gpg:                using RSA key C3D0D66DC3624FF6A8C018CEDECF6B93C6F02FAF
      # gpg:                issuer "cohuck@redhat.com"
      # gpg: Good signature from "Cornelia Huck <conny@cornelia-huck.de>" [unknown]
      # gpg:                 aka "Cornelia Huck <huckc@linux.vnet.ibm.com>" [full]
      # gpg:                 aka "Cornelia Huck <cornelia.huck@de.ibm.com>" [full]
      # gpg:                 aka "Cornelia Huck <cohuck@kernel.org>" [unknown]
      # gpg:                 aka "Cornelia Huck <cohuck@redhat.com>" [unknown]
      # Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF
      
      * remotes/cohuck/tags/s390x-20190403:
        hw/s390x/3270-ccw: avoid taking address of fields in packed struct
        hw/s390x/ipl: avoid taking address of fields in packed struct
        hw/s390/css: avoid taking address members in packed structs
        hw/vfio/ccw: avoid taking address members in packed structs
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      f4b37171
    • D
      hw/s390x/3270-ccw: avoid taking address of fields in packed struct · 7357b221
      Daniel P. Berrangé 提交于
      Compiling with GCC 9 complains
      
      hw/s390x/3270-ccw.c: In function ‘emulated_ccw_3270_cb’:
      hw/s390x/3270-ccw.c:81:19: error: taking address of packed member of ‘struct SCHIB’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
         81 |         SCSW *s = &sch->curr_status.scsw;
            |                   ^~~~~~~~~~~~~~~~~~~~~~
      
      This local variable is only present to save a little bit of
      typing when setting the field later. Get rid of this to avoid
      the warning about unaligned accesses.
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      Message-Id: <20190329111104.17223-15-berrange@redhat.com>
      Reviewed-by: NDavid Hildenbrand <david@redhat.com>
      Reviewed-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NCornelia Huck <cohuck@redhat.com>
      7357b221
    • D
      hw/s390x/ipl: avoid taking address of fields in packed struct · 5d45a332
      Daniel P. Berrangé 提交于
      Compiling with GCC 9 complains
      
      hw/s390x/ipl.c: In function ‘s390_ipl_set_boot_menu’:
      hw/s390x/ipl.c:256:25: warning: taking address of packed member of ‘struct QemuIplParameters’ may result in an unaligned pointer value [-Waddress-of-packed-member]
        256 |     uint32_t *timeout = &ipl->qipl.boot_menu_timeout;
            |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      This local variable is only present to save a little bit of
      typing when setting the field later. Get rid of this to avoid
      the warning about unaligned accesses.
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      Message-Id: <20190329111104.17223-14-berrange@redhat.com>
      Reviewed-by: NDavid Hildenbrand <david@redhat.com>
      Reviewed-by: NThomas Huth <thuth@redhat.com>
      Reviewed-by: NFarhan Ali <alifm@linux.ibm.com>
      Signed-off-by: NCornelia Huck <cohuck@redhat.com>
      5d45a332
    • D
      hw/s390/css: avoid taking address members in packed structs · bea0279b
      Daniel P. Berrangé 提交于
      The GCC 9 compiler complains about many places in s390 code
      that take the address of members of the 'struct SCHIB' which
      is marked packed:
      
      hw/s390x/css.c: In function ‘sch_handle_clear_func’:
      hw/s390x/css.c:698:15: warning: taking address of packed member of ‘struct SCHIB’ may result in an unaligned pointer val\
      ue [-Waddress-of-packed-member]
        698 |     PMCW *p = &sch->curr_status.pmcw;
            |               ^~~~~~~~~~~~~~~~~~~~~~
      hw/s390x/css.c:699:15: warning: taking address of packed member of ‘struct SCHIB’ may result in an unaligned pointer val\
      ue [-Waddress-of-packed-member]
        699 |     SCSW *s = &sch->curr_status.scsw;
            |               ^~~~~~~~~~~~~~~~~~~~~~
      
      ...snip many more...
      
      Almost all of these are just done for convenience to avoid
      typing out long variable/field names when referencing struct
      members. We can get most of this convenience by taking the
      address of the 'struct SCHIB' instead, avoiding triggering
      the compiler warnings.
      
      In a couple of places we copy via a local variable which is
      a technique already applied elsewhere in s390 code for this
      problem.
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      Message-Id: <20190329111104.17223-13-berrange@redhat.com>
      Reviewed-by: NThomas Huth <thuth@redhat.com>
      Reviewed-by: NHalil Pasic <pasic@linux.ibm.com>
      Signed-off-by: NCornelia Huck <cohuck@redhat.com>
      bea0279b
    • D
      hw/vfio/ccw: avoid taking address members in packed structs · e1d0b372
      Daniel P. Berrangé 提交于
      The GCC 9 compiler complains about many places in s390 code
      that take the address of members of the 'struct SCHIB' which
      is marked packed:
      
      hw/vfio/ccw.c: In function ‘vfio_ccw_io_notifier_handler’:
      hw/vfio/ccw.c:133:15: warning: taking address of packed member of ‘struct SCHIB’ may result in an unaligned pointer value \
      [-Waddress-of-packed-member]
        133 |     SCSW *s = &sch->curr_status.scsw;
            |               ^~~~~~~~~~~~~~~~~~~~~~
      hw/vfio/ccw.c:134:15: warning: taking address of packed member of ‘struct SCHIB’ may result in an unaligned pointer value \
      [-Waddress-of-packed-member]
        134 |     PMCW *p = &sch->curr_status.pmcw;
            |               ^~~~~~~~~~~~~~~~~~~~~~
      
      ...snip many more...
      
      Almost all of these are just done for convenience to avoid
      typing out long variable/field names when referencing struct
      members. We can get most of this convenience by taking the
      address of the 'struct SCHIB' instead, avoiding triggering
      the compiler warnings.
      
      In a couple of places we copy via a local variable which is
      a technique already applied elsewhere in s390 code for this
      problem.
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      Message-Id: <20190329111104.17223-12-berrange@redhat.com>
      Reviewed-by: NEric Farman <farman@linux.ibm.com>
      Reviewed-by: NHalil Pasic <pasic@linux.ibm.com>
      Reviewed-by: NFarhan Ali <alifm@linux.ibm.com>
      Signed-off-by: NCornelia Huck <cohuck@redhat.com>
      e1d0b372
    • P
      Update version for v4.0.0-rc2 release · 061b51e9
      Peter Maydell 提交于
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      061b51e9
  7. 02 4月, 2019 21 次提交
    • P
      intel_iommu: Drop extended root field · 81fb1e64
      Peter Xu 提交于
      VTD_RTADDR_RTT is dropped even by the VT-d spec, so QEMU should
      probably do the same thing (after all we never really implemented it).
      Since we've had a field for that in the migration stream, to keep
      compatibility we need to fill the hole up.
      
      Please refer to VT-d spec 10.4.6.
      Signed-off-by: NPeter Xu <peterx@redhat.com>
      Message-Id: <20190329061422.7926-3-peterx@redhat.com>
      Reviewed-by: NLiu, Yi L <yi.l.liu@intel.com>
      Acked-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      81fb1e64
    • P
      intel_iommu: Fix root_scalable migration breakage · 2811af3b
      Peter Xu 提交于
      When introducing the initial support for scalable mode we added a
      new field into vmstate however we blindly migrate that field without
      notice.  That'll break migration no matter forward or backward.
      
      The normal way should be that we use something like
      VMSTATE_UINT32_TEST() or subsections for the new vmstate field however
      for this case of vt-d we can even make it simpler because we've
      already migrated all the registers and it'll be fairly simple that we
      re-generate root_scalable field from the register values during post
      load of the device.
      
      Fixes: fb43cf73 ("intel_iommu: scalable mode emulation")
      Reviewed-by: NYi Sun <yi.y.sun@linux.intel.com>
      Signed-off-by: NPeter Xu <peterx@redhat.com>
      Message-Id: <20190329061422.7926-2-peterx@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      2811af3b
    • Y
      virtio-net: Fix typo in comment · 20f86a75
      Yuval Shaia 提交于
      Signed-off-by: NYuval Shaia <yuval.shaia@oracle.com>
      Message-Id: <20190321161832.10533-1-yuval.shaia@oracle.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      20f86a75
    • A
      intel_iommu: Correct caching-mode error message · 75c5626c
      Alex Williamson 提交于
      If we try to use the intel-iommu device with vfio-pci devices without
      caching mode enabled, we're told:
      
        qemu-system-x86_64: We need to set caching-mode=1 for intel-iommu to enable
        device assignment with IOMMU protection.
      
      But to enable caching mode, the option is actually "caching-mode=on".
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      Message-Id: <155364147432.16467.15898335025013220939.stgit@gimli.home>
      Reviewed-by: NPeter Xu <peterx@redhat.com>
      Reviewed-by: NLaurent Vivier <laurent@vivier.eu>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Signed-off-by: Alex Williamson &lt;<a href="mailto:alex.williamson@redhat.com" target="_blank" rel="noreferrer">alex.williamson@redhat.com</a>&gt;<br>
      Reviewed-by: NEric Auger <eric.auger@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      75c5626c
    • L
      acpi: verify file entries in bios_linker_loader_add_pointer() · 22132828
      Liam Merwick 提交于
      The callers to bios_linker_find_file() assert that the file entry returned
      is not NULL, except for those in bios_linker_loader_add_pointer().  Add two
      asserts in that case for completeness and to facilitate static code analysis.
      Signed-off-by: NLiam Merwick <liam.merwick@oracle.com>
      Message-Id: <1553199229-25318-1-git-send-email-liam.merwick@oracle.com>
      Reviewed-by: NIgor Mammedov <imammedo@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      22132828
    • P
      Merge remote-tracking branch 'remotes/armbru/tags/pull-misc-2019-04-02' into staging · 37301a8d
      Peter Maydell 提交于
      Miscellaneous patches for 2019-04-02
      
      # gpg: Signature made Tue 02 Apr 2019 12:54:27 BST
      # gpg:                using RSA key 3870B400EB918653
      # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
      # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
      # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653
      
      * remotes/armbru/tags/pull-misc-2019-04-02:
        accel: Unbreak accelerator fallback
        vl: Document dependencies hiding in global and compat props
        migration: Support adding migration blockers earlier
        Revert "migration: move only_migratable to MigrationState"
        Revert "vl: Fix to create migration object before block backends again"
        qapi/migration.json: Rename COLOStatus last_mode to last-mode
        qapi/migration.json: Fix ColoStatus member last_mode's version
        vl: Fix error location of positional arguments
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      37301a8d
    • P
      Merge remote-tracking branch 'remotes/berrange/tags/filemon-next-pull-request' into staging · 436960c9
      Peter Maydell 提交于
      filemon: various fixes / improvements to file monitor for USB MTP
      
      Ensure watch IDs unique within a monitor and avoid integer wraparound
      issues when many watches are set & unset over time.
      
      # gpg: Signature made Tue 02 Apr 2019 13:53:40 BST
      # gpg:                using RSA key BE86EBB415104FDF
      # gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>" [full]
      # gpg:                 aka "Daniel P. Berrange <berrange@redhat.com>" [full]
      # Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E  8E3F BE86 EBB4 1510 4FDF
      
      * remotes/berrange/tags/filemon-next-pull-request:
        filemon: fix watch IDs to avoid potential wraparound issues
        filemon: ensure watch IDs are unique to QFileMonitor scope
        tests: refactor file monitor test to make it more understandable
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      436960c9
    • P
      Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging · 9a363f0b
      Peter Maydell 提交于
      Block layer patches:
      
      - file-posix: Ignore unlock failure instead of crashing
      - gluster: Limit the transfer size to 512 MiB
      - stream: Fix backing chain freezing
      - qemu-img: Enable BDRV_REQ_MAY_UNMAP for zero writes in convert
      - iotests fixes
      
      # gpg: Signature made Tue 02 Apr 2019 13:47:43 BST
      # gpg:                using RSA key 7F09B272C88F2FD6
      # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full]
      # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6
      
      * remotes/kevin/tags/for-upstream:
        tests/qemu-iotests/235: Allow fallback to tcg
        block: test block-stream with a base node that is used by block-commit
        block: freeze the backing chain earlier in stream_start()
        block: continue until base is found in bdrv_freeze_backing_chain() et al
        block/file-posix: do not fail on unlock bytes
        tests/qemu-iotests: Remove redundant COPYING file
        block/gluster: limit the transfer size to 512 MiB
        qemu-img: Enable BDRV_REQ_MAY_UNMAP in convert
        iotests: Fix test 200 on s390x without virtio-pci
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      9a363f0b
    • D
      filemon: fix watch IDs to avoid potential wraparound issues · b4682a63
      Daniel P. Berrangé 提交于
      Watch IDs are allocated from incrementing a int counter against
      the QFileMonitor object. In very long life QEMU processes with
      a huge amount of USB MTP activity creating & deleting directories
      it is just about conceivable that the int counter can wrap
      around. This would result in incorrect behaviour of the file
      monitor watch APIs due to clashing watch IDs.
      
      Instead of trying to detect this situation, this patch changes
      the way watch IDs are allocated. It is turned into an int64_t
      variable where the high 32 bits are set from the underlying
      inotify "int" ID. This gives an ID that is guaranteed unique
      for the directory as a whole, and we can rely on the kernel
      to enforce this. QFileMonitor then sets the low 32 bits from
      a per-directory counter.
      
      The USB MTP device only sets watches on the directory as a
      whole, not files within, so there is no risk of guest
      triggered wrap around on the low 32 bits.
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      b4682a63
    • D
      filemon: ensure watch IDs are unique to QFileMonitor scope · ff3dc8fe
      Daniel P. Berrangé 提交于
      The watch IDs are mistakenly only unique within the scope of the
      directory being monitored. This is not useful for clients which are
      monitoring multiple directories. They require watch IDs to be unique
      globally within the QFileMonitor scope.
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Tested-by: NBandan Das <bsd@redhat.com>
      Reviewed-by: NBandan Das <bsd@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      ff3dc8fe
    • D
      tests: refactor file monitor test to make it more understandable · b26c3f9c
      Daniel P. Berrangé 提交于
      The current file monitor unit tests are too clever for their own good
      making it hard to understand the desired output.
      
      Instead of trying to infer the expected events, explicitly list the
      events we expect in the operation sequence.
      
      Instead of dynamically building a matrix of tests, just have one giant
      operation sequence that validates all scenarios in a single test.
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      b26c3f9c
    • M
      accel: Unbreak accelerator fallback · 79b9d4bd
      Markus Armbruster 提交于
      When the user specifies a list of accelerators, we pick the first one
      that initializes successfully.  Recent commit 1a3ec8c1 broke that.
      Reproducer:
      
          $ qemu-system-x86_64 --machine accel=xen:tcg
          xencall: error: Could not obtain handle on privileged command interface: No such file or directory
          xen be core: xen be core: can't open xen interface
          can't open xen interface
          qemu-system-x86_64: failed to initialize Xen: Operation not permitted
          qemu-system-x86_64: /home/armbru/work/qemu/qom/object.c:436: object_set_accelerator_compat_props: Assertion `!object_compat_props[0]' failed.
      
      Root cause: we register accelerator compat properties even when the
      accelerator fails.  The failed assertion is
      object_set_accelerator_compat_props() telling us off.  Fix by calling
      it only for the accelerator that succeeded.
      
      Fixes: 1a3ec8c1Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NIgor Mammedov <imammedo@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <20190401090827.20793-6-armbru@redhat.com>
      79b9d4bd
    • M
      vl: Document dependencies hiding in global and compat props · 0427b625
      Markus Armbruster 提交于
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190401090827.20793-5-armbru@redhat.com>
      Reviewed-by: NIgor Mammedov <imammedo@redhat.com>
      0427b625
    • M
      migration: Support adding migration blockers earlier · daff7f0b
      Markus Armbruster 提交于
      migrate_add_blocker() asserts we have a current_migration object, in
      migrate_get_current().  We do only after migration_object_init().
      
      This contributes to the following dependency cycle:
      
      * configure_blockdev() must run before machine_set_property()
        so machine properties can refer to block backends
      
      * machine_set_property() before configure_accelerator()
        so machine properties like kvm-irqchip get applied
      
      * configure_accelerator() before migration_object_init()
        so that Xen's accelerator compat properties get applied.
      
      * migration_object_init() before configure_blockdev()
        so configure_blockdev() can add migration blockers
      
      The cycle was closed when recent commit cda4aa9a "Create block
      backends before setting machine properties" added the first
      dependency, and satisfied it by violating the last one.  Broke block
      backends that add migration blockers, as demonstrated by qemu-iotests
      055.
      
      To fix it, break the last dependency: make migrate_add_blocker()
      usable before migration_object_init().
      
      The previous commit already removed the use of migrate_get_current()
      from migrate_add_blocker() itself.  Didn't quite do the trick, as
      there's another one hiding in migration_is_idle().
      
      The use there isn't actually necessary: when no migration object has
      been created yet, migration is surely idle.  Make migration_is_idle()
      return true then.
      
      Fixes: cda4aa9aSigned-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190401090827.20793-4-armbru@redhat.com>
      Reviewed-by: NIgor Mammedov <imammedo@redhat.com>
      daff7f0b
    • M
      Revert "migration: move only_migratable to MigrationState" · 811f8652
      Markus Armbruster 提交于
      This reverts commit 3df663e5.
      This reverts commit b605c47b.
      
      Command line option --only-migratable is for disallowing any
      configuration that can block migration.
      
      Initially, --only-migratable set global variable @only_migratable.
      
      Commit 3df663e5 "migration: move only_migratable to MigrationState"
      replaced it by MigrationState member @only_migratable.  That was a
      mistake.
      
      First, it doesn't make sense on the design level.  MigrationState
      captures the state of an individual migration, but --only-migratable
      isn't a property of an individual migration, it's a restriction on
      QEMU configuration.  With fault tolerance, we could have several
      migrations at once.  --only-migratable would certainly protect all of
      them.  Storing it in MigrationState feels inappropriate.
      
      Second, it contributes to a dependency cycle that manifests itself as
      a bug now.
      
      Putting @only_migratable into MigrationState means its available only
      after migration_object_init().
      
      We can't set it before migration_object_init(), so we delay setting it
      with a global property (this is fixup commit b605c47b "migration:
      fix handling for --only-migratable").
      
      We can't get it before migration_object_init(), so anything that uses
      it can only run afterwards.
      
      Since migrate_add_blocker() needs to obey --only-migratable, any code
      adding migration blockers can run only afterwards.  This contributes
      to the following dependency cycle:
      
      * configure_blockdev() must run before machine_set_property()
        so machine properties can refer to block backends
      
      * machine_set_property() before configure_accelerator()
        so machine properties like kvm-irqchip get applied
      
      * configure_accelerator() before migration_object_init()
        so that Xen's accelerator compat properties get applied.
      
      * migration_object_init() before configure_blockdev()
        so configure_blockdev() can add migration blockers
      
      The cycle was closed when recent commit cda4aa9a "Create block
      backends before setting machine properties" added the first
      dependency, and satisfied it by violating the last one.  Broke block
      backends that add migration blockers.
      
      Moving @only_migratable into MigrationState was a mistake.  Revert it.
      
      This doesn't quite break the "migration_object_init() before
      configure_blockdev() dependency, since migrate_add_blocker() still has
      another dependency on migration_object_init().  To be addressed the
      next commit.
      
      Note that the reverted commit made -only-migratable sugar for -global
      migration.only-migratable=on below the hood.  Documentation has only
      ever mentioned -only-migratable.  This commit removes the arcane &
      undocumented alternative to -only-migratable again.  Nobody should be
      using it.
      
      Conflicts:
      	include/migration/misc.h
      	migration/migration.c
      	migration/migration.h
      	vl.c
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190401090827.20793-3-armbru@redhat.com>
      Reviewed-by: NIgor Mammedov <imammedo@redhat.com>
      811f8652
    • M
      Revert "vl: Fix to create migration object before block backends again" · 2fa23277
      Markus Armbruster 提交于
      This reverts commit e60483f2.
      
      Recent commit cda4aa9a moved block backend creation before machine
      property evaluation.  This broke block backends registering migration
      blockers.  Commit e60483f2 fixed it by moving migration object
      creation before block backend creation.  This broke migration with
      Xen.  Turns out we need to configure the accelerator before we create
      the migration object so that Xen's accelerator compat properties get
      applied.  Revert the flawed commit.  This fixes the Xen regression,
      but brings back the block backend regression.  The next commits will
      fix it again.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190401090827.20793-2-armbru@redhat.com>
      Reviewed-by: NIgor Mammedov <imammedo@redhat.com>
      2fa23277
    • Z
      qapi/migration.json: Rename COLOStatus last_mode to last-mode · 5cc8f9eb
      Zhang Chen 提交于
      Signed-off-by: NZhang Chen <chen.zhang@intel.com>
      Message-Id: <20190402085521.17973-1-chen.zhang@intel.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      [Commit message rephrased]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      5cc8f9eb
    • Z
      qapi/migration.json: Fix ColoStatus member last_mode's version · 966c0d49
      Zhang Chen 提交于
      Signed-off-by: NZhang Chen <chen.zhang@intel.com>
      Message-Id: <20190326174510.13303-1-chen.zhang@intel.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      [Commit message tweaked as per Eric's review]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      966c0d49
    • M
      vl: Fix error location of positional arguments · 17f30eae
      Markus Armbruster 提交于
      We blame badness in positional arguments on the last option argument:
      
          $ qemu-system-x86_64 -vnc :1 bad.img
          qemu-system-x86_64: -vnc :1: Could not open 'foo': No such file or directory
      
      I believe we've done this ever since we reported locations.  Fix it to
      
          qemu-system-x86_64: bad.img: Could not open 'bad.img': No such file or directory
      Reported-by: NDaniel P. Berrangé <berrange@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190318183312.4684-1-armbru@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      Reviewed-by: NStefano Garzarella <sgarzare@redhat.com>
      17f30eae
    • T
      tests/qemu-iotests/235: Allow fallback to tcg · f18957b8
      Thomas Huth 提交于
      iotest 235 currently only works with KVM - this is bad for systems where
      it is not available, e.g. CI pipelines. The test also works when using
      "tcg" as accelerator, so we can simply add that to the list of accelerators,
      too.
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      f18957b8
    • A
      block: test block-stream with a base node that is used by block-commit · d20ba603
      Alberto Garcia 提交于
      The base node of a block-stream operation indicates the first image
      from the backing chain starting from which no data is copied to the
      top node.
      
      The block-stream job allows others to use that base image, so a second
      block-stream job could be writing to it at the same time. An important
      restriction is that the base image must not disappear while the stream
      job is ongoing. stream_start() freezes the backing chain from top to
      base with that purpose but it does it too late in the code so there is
      a race condition there.
      
      This bug was fixed in the previous commit, and this patch contains an
      iotest for this scenario.
      Signed-off-by: NAlberto Garcia <berto@igalia.com>
      Reviewed-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      d20ba603