1. 29 3月, 2017 6 次提交
    • L
      spapr: fix memory hot-unplugging · fe6824d1
      Laurent Vivier 提交于
      If, once the kernel has booted, we try to remove a memory
      hotplugged while the kernel was not started, QEMU crashes on
      an assert:
      
          qemu-system-ppc64: hw/virtio/vhost.c:651:
                             vhost_commit: Assertion `r >= 0' failed.
          ...
          #4  in vhost_commit
          #5  in memory_region_transaction_commit
          #6  in pc_dimm_memory_unplug
          #7  in spapr_memory_unplug
          #8  spapr_machine_device_unplug
          #9  in hotplug_handler_unplug
          #10 in spapr_lmb_release
          #11 in detach
          #12 in set_allocation_state
          #13 in rtas_set_indicator
          ...
      
      If we take a closer look to the guest kernel log, we can see when
      we try to unplug the memory:
      
          pseries-hotplug-mem: Attempting to hot-add 4 LMB(s)
      
      What happens:
      
          1- The kernel has ignored the memory hotplug event because
             it was not started when it was generated.
      
          2- When we hot-unplug the memory,
             QEMU starts to remove the memory,
                  generates an hot-unplug event,
              and signals the kernel of the incoming new event
      
          3- as the kernel is started, on the QEMU signal, it reads
             the event list, decodes the hotplug event and tries to
             finish the hotplugging.
      
          4- QEMU receive the the hotplug notification while it
             is trying to hot-unplug the memory. This moves the memory
             DRC to an invalid state
      
      This patch prevents this by not allowing to set the allocation
      state to USABLE while the DRC is awaiting release.
      
      RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1432382Signed-off-by: NLaurent Vivier <lvivier@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      fe6824d1
    • M
      spapr: fix buffer-overflow · 24ec2863
      Marc-André Lureau 提交于
      Running postcopy-test with ASAN produces the following error:
      
      QTEST_QEMU_BINARY=ppc64-softmmu/qemu-system-ppc64  tests/postcopy-test
      ...
      =================================================================
      ==23641==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7f1556600000 at pc 0x55b8e9d28208 bp 0x7f1555f4d3c0 sp 0x7f1555f4d3b0
      READ of size 8 at 0x7f1556600000 thread T6
          #0 0x55b8e9d28207 in htab_save_first_pass /home/elmarco/src/qq/hw/ppc/spapr.c:1528
          #1 0x55b8e9d2939c in htab_save_iterate /home/elmarco/src/qq/hw/ppc/spapr.c:1665
          #2 0x55b8e9beae3a in qemu_savevm_state_iterate /home/elmarco/src/qq/migration/savevm.c:1044
          #3 0x55b8ea677733 in migration_thread /home/elmarco/src/qq/migration/migration.c:1976
          #4 0x7f15845f46c9 in start_thread (/lib64/libpthread.so.0+0x76c9)
          #5 0x7f157d9d0f7e in clone (/lib64/libc.so.6+0x107f7e)
      
      0x7f1556600000 is located 0 bytes to the right of 2097152-byte region [0x7f1556400000,0x7f1556600000)
      allocated by thread T0 here:
          #0 0x7f159bb76980 in posix_memalign (/lib64/libasan.so.3+0xc7980)
          #1 0x55b8eab185b2 in qemu_try_memalign /home/elmarco/src/qq/util/oslib-posix.c:106
          #2 0x55b8eab186c8 in qemu_memalign /home/elmarco/src/qq/util/oslib-posix.c:122
          #3 0x55b8e9d268a8 in spapr_reallocate_hpt /home/elmarco/src/qq/hw/ppc/spapr.c:1214
          #4 0x55b8e9d26e04 in ppc_spapr_reset /home/elmarco/src/qq/hw/ppc/spapr.c:1261
          #5 0x55b8ea12e913 in qemu_system_reset /home/elmarco/src/qq/vl.c:1697
          #6 0x55b8ea13fa40 in main /home/elmarco/src/qq/vl.c:4679
          #7 0x7f157d8e9400 in __libc_start_main (/lib64/libc.so.6+0x20400)
      
      Thread T6 created by T0 here:
          #0 0x7f159bae0488 in __interceptor_pthread_create (/lib64/libasan.so.3+0x31488)
          #1 0x55b8eab1d9cb in qemu_thread_create /home/elmarco/src/qq/util/qemu-thread-posix.c:465
          #2 0x55b8ea67874c in migrate_fd_connect /home/elmarco/src/qq/migration/migration.c:2096
          #3 0x55b8ea66cbb0 in migration_channel_connect /home/elmarco/src/qq/migration/migration.c:500
          #4 0x55b8ea678f38 in socket_outgoing_migration /home/elmarco/src/qq/migration/socket.c:87
          #5 0x55b8eaa5a03a in qio_task_complete /home/elmarco/src/qq/io/task.c:142
          #6 0x55b8eaa599cc in gio_task_thread_result /home/elmarco/src/qq/io/task.c:88
          #7 0x7f15823e38e6  (/lib64/libglib-2.0.so.0+0x468e6)
      SUMMARY: AddressSanitizer: heap-buffer-overflow /home/elmarco/src/qq/hw/ppc/spapr.c:1528 in htab_save_first_pass
      
      index seems to be wrongly incremented, unless I miss something that
      would be worth a comment.
      Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      24ec2863
    • P
      Update version for v2.9.0-rc2 release · df904636
      Peter Maydell 提交于
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      df904636
    • P
      Merge remote-tracking branch 'remotes/armbru/tags/pull-misc-2017-03-28' into staging · a634bbba
      Peter Maydell 提交于
      Miscellaneous patches for 2017-03-28
      
      # gpg: Signature made Tue 28 Mar 2017 17:51:06 BST
      # gpg:                using RSA key 0x3870B400EB918653
      # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
      # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>"
      # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653
      
      * remotes/armbru/tags/pull-misc-2017-03-28:
        sockets: Fix socket_address_to_string() hostname truncation
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      a634bbba
    • M
      sockets: Fix socket_address_to_string() hostname truncation · 44fdc764
      Markus Armbruster 提交于
      We first snprintf() to a fixed buffer, then g_strdup() the result
      *boggle*.
      
      Worse, the size of the fixed buffer INET6_ADDRSTRLEN + 5 + 4 is bogus:
      the 4 correctly accounts for '[', ']', ':' and '\0', but
      INET6_ADDRSTRLEN is not a suitable limit for inet->host, and 5 is not
      one for inet->port!  They are for host and port in *numeric* form
      (exploiting that INET6_ADDRSTRLEN > INET_ADDRSTRLEN), but inet->host
      can also be a hostname, and inet->port can be a service name, to be
      resolved with getaddrinfo().
      
      Fortunately, the only user so far is the "socket" network backend's
      net_socket_connected(), which uses it to initialize a NetSocketState's
      info_str[].  info_str[] has considerable more space: 256 instead of
      55.  So the bug's impact appears to be limited to truncated "info
      networks" with the "socket" network backend.
      
      The fix is obvious: use g_strdup_printf().
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1490268208-23368-1-git-send-email-armbru@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      44fdc764
    • P
      Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging · b8dc35b2
      Peter Maydell 提交于
      # gpg: Signature made Tue 28 Mar 2017 15:22:59 BST
      # gpg:                using RSA key 0x9CA4ABB381AB73C8
      # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
      # gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>"
      # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8
      
      * remotes/stefanha/tags/tracing-pull-request:
        trace: fix tcg tracing build breakage
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      b8dc35b2
  2. 28 3月, 2017 27 次提交
    • P
      Merge remote-tracking branch 'remotes/cody/tags/block-pull-request' into staging · aba0fb1e
      Peter Maydell 提交于
      # gpg: Signature made Tue 28 Mar 2017 15:02:40 BST
      # gpg:                using RSA key 0xBDBE7B27C0DE3057
      # gpg: Good signature from "Jeffrey Cody <jcody@redhat.com>"
      # gpg:                 aka "Jeffrey Cody <jeff@codyprime.org>"
      # gpg:                 aka "Jeffrey Cody <codyprime@gmail.com>"
      # Primary key fingerprint: 9957 4B4D 3474 90E7 9D98  D624 BDBE 7B27 C0DE 3057
      
      * remotes/cody/tags/block-pull-request:
        rbd: Fix bugs around -drive parameter "server"
        rbd: Revert -blockdev parameter password-secret
        rbd: Revert -blockdev and -drive parameter auth-supported
        rbd: Clean up qemu_rbd_create()'s detour through QemuOpts
        rbd: Clean up runtime_opts, fix -drive to reject filename
        rbd: Don't accept -drive driver=rbd, keyvalue-pairs=...
        rbd: Clean up after the previous commit
        rbd: Don't limit length of parameter values
        rbd: Fix to cleanly reject -drive without pool or image
        rbd: Reject -blockdev server.*.{numeric, to, ipv4, ipv6}
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      aba0fb1e
    • M
      rbd: Fix bugs around -drive parameter "server" · 2836284d
      Markus Armbruster 提交于
      qemu_rbd_open() takes option parameters as a flattened QDict, with
      keys of the form server.%d.host, server.%d.port, where %d counts up
      from zero.
      
      qemu_rbd_array_opts() extracts these values as follows.  First, it
      calls qdict_array_entries() to find the list's length.  For each list
      element, it formats the list's key prefix (e.g. "server.0."), then
      creates a new QDict holding the options with that key prefix, then
      converts that to a QemuOpts, so it can finally get the member values
      from there.
      
      If there's one surefire way to make code using QDict more awkward,
      it's creating more of them and mixing in QemuOpts for good measure.
      
      The extraction of keys starting with server.%d into another QDict
      makes us ignore parameters like server.0.neither-host-nor-port
      silently.
      
      The conversion to QemuOpts abuses runtime_opts, as described a few
      commits ago.
      
      Rewrite to simply get the values straight from the options QDict.
      
      Fixes -drive not to crash when server.*.* are present, but
      server.*.host is absent.
      
      Fixes -drive to reject invalid server.*.*.
      
      Permits cleaning up runtime_opts.  Do that, and fix -drive to reject
      bogus parameters host and port instead of silently ignoring them.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Message-id: 1490691368-32099-11-git-send-email-armbru@redhat.com
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      2836284d
    • M
      rbd: Revert -blockdev parameter password-secret · 577d8c9a
      Markus Armbruster 提交于
      This reverts a part of commit 8a47e8eb.  We're having second thoughts
      on the QAPI schema (and thus the external interface), and haven't
      reached consensus, yet.  Issues include:
      
      * BlockdevOptionsRbd member @password-secret isn't actually a
        password, it's a key generated by Ceph.
      
      * We're not sure where member @password-secret belongs (see the
        previous commit).
      
      * How @password-secret interacts with settings from a configuration
        file specified with @conf is undocumented.
      
      Let's avoid painting ourselves into a corner now, and revert the
      feature for 2.9.
      
      Note that users can still configure an authentication key with a
      configuration file.  They probably do that anyway if they use Ceph
      outside QEMU as well.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Message-id: 1490691368-32099-10-git-send-email-armbru@redhat.com
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      577d8c9a
    • M
      rbd: Revert -blockdev and -drive parameter auth-supported · 464444fc
      Markus Armbruster 提交于
      This reverts half of commit 0a55679b.  We're having second thoughts on
      the QAPI schema (and thus the external interface), and haven't reached
      consensus, yet.  Issues include:
      
      * The implementation uses deprecated rados_conf_set() key
        "auth_supported".  No biggie.
      
      * The implementation makes -drive silently ignore invalid parameters
        "auth" and "auth-supported.*.X" where X isn't "auth".  Fixable (in
        fact I'm going to fix similar bugs around parameter server), so
        again no biggie.
      
      * BlockdevOptionsRbd member @password-secret applies only to
        authentication method cephx.  Should it be a variant member of
        RbdAuthMethod?
      
      * BlockdevOptionsRbd member @user could apply to both methods cephx
        and none, but I'm not sure it's actually used with none.  If it
        isn't, should it be a variant member of RbdAuthMethod?
      
      * The client offers a *set* of authentication methods, not a list.
        Should the methods be optional members of BlockdevOptionsRbd instead
        of members of list @auth-supported?  The latter begs the question
        what multiple entries for the same method mean.  Trivial question
        now that RbdAuthMethod contains nothing but @type, but less so when
        RbdAuthMethod acquires other members, such the ones discussed above.
      
      * How BlockdevOptionsRbd member @auth-supported interacts with
        settings from a configuration file specified with @conf is
        undocumented.  I suspect it's untested, too.
      
      Let's avoid painting ourselves into a corner now, and revert the
      feature for 2.9.
      
      Note that users can still configure authentication methods with a
      configuration file.  They probably do that anyway if they use Ceph
      outside QEMU as well.
      
      Further note that this doesn't affect use of key "auth-supported" in
      -drive file=rbd:...:key=value.
      
      qemu_rbd_array_opts()'s parameter @type now must be RBD_MON_HOST,
      which is silly.  This will be cleaned up shortly.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Message-id: 1490691368-32099-9-git-send-email-armbru@redhat.com
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      464444fc
    • M
      rbd: Clean up qemu_rbd_create()'s detour through QemuOpts · 07846397
      Markus Armbruster 提交于
      The conversion from QDict to QemuOpts is pointless.  Simply get the
      stuff straight from the QDict.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Message-id: 1490691368-32099-8-git-send-email-armbru@redhat.com
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      07846397
    • M
      rbd: Clean up runtime_opts, fix -drive to reject filename · cbf036b4
      Markus Armbruster 提交于
      runtime_opts is used for three different purposes:
      
      * qemu_rbd_open() uses it to accept options it recognizes, such as
        "pool" and "image".  Other .bdrv_open() methods do it similarly.
      
      * qemu_rbd_open() accepts additional list-valued options
        auth-supported and server, with the help of qemu_rbd_array_opts().
        The list elements are again dictionaries.  qemu_rbd_array_opts()
        uses runtime_opts to accept their members.  Thus, runtime_opts
        contains recognized sub-sub-options "auth", "host", "port" in
        addition to recognized options.  No other block driver does that.
      
      * qemu_rbd_create() uses it to convert the QDict produced by
        qemu_rbd_parse_filename() to QemuOpts.  No other block driver does
        that.  The keys produced by qemu_rbd_parse_filename() are "pool",
        "image", "snapshot", "conf", "user" and "keyvalue-pairs".
        qemu_rbd_open() accepts these, so no additional ones here.
      
      This is a confusing mess.  Dates back to commit 0f9d252d.  First step
      to clean it up is documenting runtime_opts.desc[]:
      
      * Reorder entries to match the QAPI schema, like we do in other block
        drivers.
      
      * Document why the schema's "server" and "auth-supported" aren't in
        .desc[].
      
      * Document why "keyvalue-pairs", "host", "port" and "auth" are in
        .desc[], but not the schema.
      
      * Delete "filename", because none of the three users actually uses it.
        This fixes -drive to reject parameter filename instead of silently
        ignoring it.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Message-id: 1490691368-32099-7-git-send-email-armbru@redhat.com
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      cbf036b4
    • M
      rbd: Don't accept -drive driver=rbd, keyvalue-pairs=... · 82f20e85
      Markus Armbruster 提交于
      The way we communicate extra key-value pairs from
      qemu_rbd_parse_filename() to qemu_rbd_open() exposes option parameter
      "keyvalue-pairs" on the command line.  It's not wanted there.  Hack:
      rename the parameter to "=keyvalue-pairs" to make it inaccessible.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Message-id: 1490691368-32099-6-git-send-email-armbru@redhat.com
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      82f20e85
    • M
      rbd: Clean up after the previous commit · 8efb339d
      Markus Armbruster 提交于
      This code in qemu_rbd_parse_filename()
      
          found_str = qemu_rbd_next_tok(p, '\0', &p);
          p = found_str;
      
      has no effect.  Drop it, and simplify qemu_rbd_next_tok().
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Message-id: 1490691368-32099-5-git-send-email-armbru@redhat.com
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      8efb339d
    • M
      rbd: Don't limit length of parameter values · 730b00bb
      Markus Armbruster 提交于
      We laboriously enforce that parameter values are between one and some
      arbitrary limit in length.  Only RBD_MAX_IMAGE_NAME_SIZE comes from
      librbd.h, and I'm not sure it applies.  Where the other limits come
      from is unclear.
      
      Drop the length checking.  The limits librbd actually imposes must be
      checked by librbd anyway.
      
      There's one minor complication: BDRVRBDState member name is a
      fixed-size array.  Depends on the length limit.  Make it a pointer to
      a dynamically allocated string.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Message-id: 1490691368-32099-4-git-send-email-armbru@redhat.com
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      730b00bb
    • M
      rbd: Fix to cleanly reject -drive without pool or image · f51c363c
      Markus Armbruster 提交于
      qemu_rbd_open() neglects to check pool and image are present.  Missing
      image is caught by rbd_open(), but missing pool crashes.  Reproducer:
      
          $ qemu-system-x86_64 -nodefaults -drive driver=rbd,id=rbd,image=i,...
          terminate called after throwing an instance of 'std::logic_error'
            what():  basic_string::_M_construct null not valid
          Aborted (core dumped)
      
      where ... is a working server.0.{host,port} configuration.
      
      Doesn't affect -drive with file=..., because qemu_rbd_parse_filename()
      always sets both pool and image.
      
      Doesn't affect -blockdev, because pool and image are mandatory in the
      QAPI schema.
      
      Fix by adding the missing checks.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Message-id: 1490691368-32099-3-git-send-email-armbru@redhat.com
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      f51c363c
    • M
      rbd: Reject -blockdev server.*.{numeric, to, ipv4, ipv6} · eb87203b
      Markus Armbruster 提交于
      We use InetSocketAddress in the QAPI schema.  However, the code
      doesn't use inet_connect_saddr(), but formats "host" and "port" into a
      configuration string for rados_conf_set().  Thus, members "numeric",
      "to", "ipv4" and "ipv6" are silently ignored.  Not nice.  Example:
      
          -blockdev rbd,node-name=nn,pool=p,image=i,server.0.host=h0,server.0.port=12345,server.0.ipv4=off
      
      Factor a suitable InetSocketAddressBase out of InetSocketAddress, and
      use that.  "numeric", "to", "ipv4" and "ipv6" are now rejected.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Message-id: 1490691368-32099-2-git-send-email-armbru@redhat.com
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      eb87203b
    • P
      Merge remote-tracking branch 'remotes/armbru/tags/pull-block-2017-03-28' into staging · 4d2bee82
      Peter Maydell 提交于
      Block patches for 2017-03-28
      
      # gpg: Signature made Tue 28 Mar 2017 14:41:37 BST
      # gpg:                using RSA key 0x3870B400EB918653
      # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
      # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>"
      # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653
      
      * remotes/armbru/tags/pull-block-2017-03-28:
        block: Declare blockdev-add and blockdev-del supported
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      4d2bee82
    • M
      block: Declare blockdev-add and blockdev-del supported · 79b7a77e
      Markus Armbruster 提交于
      It's been a long journey, but here we are.
      
      The supported blockdev-add is not compatible to its experimental
      predecessors; bump all Since: tags to 2.9.
      
      x-blockdev-remove-medium, x-blockdev-insert-medium and
      x-blockdev-change need a bit more work, so leave them alone for now.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      79b7a77e
    • P
      Merge remote-tracking branch 'remotes/stsquad/tags/pull-mttcg-fixups-for-rc2-280317-1' into staging · 0491c221
      Peter Maydell 提交于
      MTTCG regression fixes for rc2
      
      # gpg: Signature made Tue 28 Mar 2017 10:54:38 BST
      # gpg:                using RSA key 0xFBD0DB095A9E2A44
      # gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>"
      # Primary key fingerprint: 6685 AE99 E751 67BC AFC8  DF35 FBD0 DB09 5A9E 2A44
      
      * remotes/stsquad/tags/pull-mttcg-fixups-for-rc2-280317-1:
        replay/replay.c: bump REPLAY_VERSION
        tcg: Add a new line after incompatibility warning
        ui/console: use exclusive mechanism directly
        ui/console: ensure do_safe_dpy_refresh holds BQL
        bsd-user: align use of mmap_lock to that of linux-user
        user-exec: handle synchronous signals from QEMU gracefully
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      0491c221
    • P
      Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging · 142b9ca5
      Peter Maydell 提交于
      # gpg: Signature made Tue 28 Mar 2017 11:07:02 BST
      # gpg:                using RSA key 0x9CA4ABB381AB73C8
      # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
      # gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>"
      # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8
      
      * remotes/stefanha/tags/block-pull-request:
        parallels: wrong call to bdrv_truncate
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      142b9ca5
    • S
      trace: fix tcg tracing build breakage · 7609ffb9
      Stefan Hajnoczi 提交于
      Commit 0ab8ed18 ("trace: switch to
      modular code generation for sub-directories") forgot to convert "tcg"
      trace events to the modular code generation approach where each
      sub-directory has its own trace-events file.
      
      This patch fixes compilation for "tcg" trace events.  Currently they are
      only used in the root ./trace-events file.
      
      "tcg" trace events can only be used in the root ./trace-events file for
      the time being.
      Reported-by: NPeter Maydell <peter.maydell@linaro.org>
      Tested-by: NEmilio G. Cota <cota@braap.org>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Message-id: 20170327131718.18268-1-stefanha@redhat.com
      Suggested-by: NEmilio G. Cota <cota@braap.org>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      7609ffb9
    • D
      parallels: wrong call to bdrv_truncate · dc62da88
      Denis V. Lunev 提交于
      Parallels driver should not call bdrv_truncate if the image was opened
      in the read-only mode. Without the patch
          qemu-img check harddisk.hds
      asserts with
          bdrv_truncate: Assertion `child->perm & BLK_PERM_RESIZE' failed.
      
      Parameters used on the write path are not needed if the image is opened
      in the read-only mode.
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      Reported-by: NEdgar Kaziahmedov <edos@virtuozzo.mipt.ru>
      Message-id: 1490625488-7980-1-git-send-email-den@openvz.org
      CC: Stefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      dc62da88
    • A
      replay/replay.c: bump REPLAY_VERSION · 5b12c163
      Alex Bennée 提交于
      A previous commit (3d4d16f4) added support for audio record/playback.
      However this breaks the logfile ABI due to the re-ordering of the
      ReplayEvents enum. The REPLAY_VERSION check is meant to prevent you
      from using old log files in newer QEMUs but this is currently broken.
      Signed-off-by: NAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: NPavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      5b12c163
    • P
    • A
      ui/console: use exclusive mechanism directly · 00961090
      Alex Bennée 提交于
      The previous commit (8bb93c6f) using async_safe_run_on_cpu() doesn't
      work on graphics sub-system which restrict which threads can do GUI
      updates. Rather the special casing MacOS we just directly call the
      helper and move all the exclusive handling into do_dafe_dpy_refresh().
      
      The unfortunate bouncing of the BQL is to ensure there is no deadlock
      as vCPUs waiting on the BQL are kicked into their quiescent state.
      Signed-off-by: NAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NGerd Hoffmann <kraxel@redhat.com>
      00961090
    • A
      ui/console: ensure do_safe_dpy_refresh holds BQL · 85390939
      Alex Bennée 提交于
      I missed the fact that when an exclusive work item runs it drops the
      BQL to ensure all no vCPUs are stuck waiting for it, hence causing a
      deadlock. However the actual helper needs to take the BQL especially
      as we'll be messing with device emulation bits during the update which
      all assume BQL is held.
      
      We make a minor cpu_reloading_memory_map which must try and unlock the
      RCU if we are actually outside the running context.
      Reported-by: NLaurent Desnogues <laurent.desnogues@gmail.com>
      Signed-off-by: NAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NGerd Hoffmann <kraxel@redhat.com>
      85390939
    • A
      bsd-user: align use of mmap_lock to that of linux-user · 95992b67
      Alex Bennée 提交于
      The introduction of stricter mmap_lock checking in translate-all broke
      the BSD user build. The working mmap_lock functions were hidden behind
      CONFIG_USE_NPTL which is never defined. This patch brings them inline
      with linux-user.
      
      Despite the disapearence of the comment "We aren't threadsafe to start
      with..." this doesn't make bsd-user so. It will still need the rest of
      the fixes that have been done in linux-user ported over.
      Signed-off-by: NAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      95992b67
    • A
      user-exec: handle synchronous signals from QEMU gracefully · 02bed6bd
      Alex Bennée 提交于
      When "tcg: enable thread-per-vCPU" (commit 37257942) was merged the
      lifetime of current_cpu was changed. Previously a broken linux-user
      call might abort() which can eventually escalate into a SIGSEGV which
      would then crash qemu as it attempted to deref a NULL current_cpu.
      After commit 37257942 it would attempt to fixup state and re-start the
      run-loop and much hilarity (i.e. a looping lockup) would ensue from
      jumping into a stale jmp_env.
      
      As we can actually tell if we are in the run-loop from looking at the
      cpu->running flag we should catch this badness first and abort()
      cleanly rather than try to soldier on. There is a theoretical race
      between the flag being set and sigsetjmp refreshing the jump buffer
      but we can try really hard to not introduce crashes into that code.
      
      [LV: setgroups03 fails on powerpc LTP]
      Reported-by: NLaurent Vivier <laurent@vivier.eu>
      Signed-off-by: NAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: NRichard Henderson <rth@twiddle.net>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      02bed6bd
    • P
      Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging · 8c9ee217
      Peter Maydell 提交于
      This series fixes potential memory/fd leaks in 9pfs and a crash when
      running tests/virtio-9p-test on SPARC hosts.
      
      # gpg: Signature made Tue 28 Mar 2017 09:44:05 BST
      # gpg:                using DSA key 0x02FC3AEB0101DBC2
      # gpg: Good signature from "Greg Kurz <groug@kaod.org>"
      # gpg:                 aka "Greg Kurz <groug@free.fr>"
      # gpg:                 aka "Greg Kurz <gkurz@linux.vnet.ibm.com>"
      # gpg:                 aka "Gregory Kurz (Groug) <groug@free.fr>"
      # gpg:                 aka "[jpeg image of size 3330]"
      # 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: 2BD4 3B44 535E C0A7 9894  DBA2 02FC 3AEB 0101 DBC2
      
      * remotes/gkurz/tags/for-upstream:
        tests/virtio-9p-test: Don't call le*_to_cpus on fields of packed struct
        9pfs: fix file descriptor leak
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      8c9ee217
    • P
      tests/virtio-9p-test: Don't call le*_to_cpus on fields of packed struct · 34ef723c
      Peter Maydell 提交于
      For a packed struct like 'P9Hdr' the fields within it may not be
      aligned as much as the natural alignment for their types.  This means
      it is not valid to pass the address of such a field to a function
      like le32_to_cpus() which operate on uint32_t* and assume alignment.
      Doing this results in a SIGBUS on hosts like SPARC which have strict
      alignment requirements.
      
      Use ldl_le_p() instead, which is specified to correctly handle
      unaligned pointers.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      34ef723c
    • L
      9pfs: fix file descriptor leak · d63fb193
      Li Qiang 提交于
      The v9fs_create() and v9fs_lcreate() functions are used to create a file
      on the backend and to associate it to a fid. The fid shouldn't be already
      in-use, otherwise both functions may silently leak a file descriptor or
      allocated memory. The current code doesn't check that.
      
      This patch ensures that the fid isn't already associated to anything
      before using it.
      Signed-off-by: NLi Qiang <liqiang6-s@360.cn>
      (reworded the changelog, Greg Kurz)
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      d63fb193
    • P
      Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging · eb06c9e2
      Peter Maydell 提交于
      * MTTCG fix for win32
      * virtio-scsi assertion failure
      * mem-prealloc coverity fix
      * x86 migration revert which requires more thought
      * x86 instruction limit (avoids >2 page translation blocks)
      * nbd dead code cleanup
      * small memory.c logic fix
      
      # gpg: Signature made Mon 27 Mar 2017 17:03:04 BST
      # gpg:                using RSA key 0xBFFBD25F78C7AE83
      # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>"
      # gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>"
      # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
      #      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83
      
      * remotes/bonzini/tags/for-upstream:
        scsi-generic: Fill in opt_xfer_len in INQUIRY reply if it is zero
        Revert "apic: save apic_delivered flag"
        nbd: drop unused NBDClientSession.is_unix field
        win32: replace custom mutex and condition variable with native primitives
        mem-prealloc: fix sysconf(_SC_NPROCESSORS_ONLN) failure case.
        tcg/i386: Check the size of instruction being translated
        virtio-scsi: Fix acquire/release in dataplane handlers
        virtio-scsi: Make virtio_scsi_acquire/release public
        clear pending status before calling memory commit
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      eb06c9e2
  3. 27 3月, 2017 7 次提交