Skip to content
Snippets Groups Projects
  1. Feb 12, 2019
    • Artem Pisarenko's avatar
      chardev: fix mess in OPENED/CLOSED events when muxed · 7a9657ef
      Artem Pisarenko authored
      
      When chardev is multiplexed (mux=on) there are a lot of cases where
      CHR_EVENT_OPENED/CHR_EVENT_CLOSED events pairing (expected from
      frontend side) is broken. There are either generation of multiple
      repeated or extra CHR_EVENT_OPENED events, or CHR_EVENT_CLOSED just
      isn't generated at all.
      This is mostly because 'qemu_chr_fe_set_handlers()' function makes its
      own (and often wrong) implicit decision on updated frontend state and
      invokes 'fd_event' callback with 'CHR_EVENT_OPENED'. And even worse,
      it doesn't do symmetric action in opposite direction, as someone may
      expect (i.e. it doesn't invoke previously set 'fd_event' with
      'CHR_EVENT_CLOSED'). Muxed chardev uses trick by calling this function
      again to replace callback handlers with its own ones, but it doesn't
      account for such side effect.
      Fix that using extended version of this function with added argument
      for disabling side effect and keep original function for compatibility
      with lots of frontends already using this interface and being
      "tolerant" to its side effects.
      One more source of event duplication is just line of code in
      char-mux.c, which does far more than comment above says (obvious fix).
      
      Signed-off-by: default avatarArtem Pisarenko <artem.k.pisarenko@gmail.com>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <7dde6abbd21682857f8294644013173c0b9949b3.1541507990.git.artem.k.pisarenko@gmail.com>
      Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      7a9657ef
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging · 0b5e750b
      Peter Maydell authored
      
      Pull request
      
      # gpg: Signature made Tue 12 Feb 2019 03:58:58 GMT
      # gpg:                using RSA key 9CA4ABB381AB73C8
      # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full]
      # gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>" [full]
      # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8
      
      * remotes/stefanha/tags/block-pull-request:
        virtio-blk: cleanup using VirtIOBlock *s and VirtIODevice *vdev
        qemugdb/coroutine: fix arch_prctl has unknown return type
        iothread: fix iothread hang when stop too soon
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      0b5e750b
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2019-02-11' into staging · d85e60e9
      Peter Maydell authored
      
      nbd patches for 2019-02-11
      
      - Add qcow2 bitmap details to 'qemu-img info'
      
      # gpg: Signature made Mon 11 Feb 2019 20:38:32 GMT
      # gpg:                using RSA key A7A16B4A2527436A
      # gpg: Good signature from "Eric Blake <eblake@redhat.com>" [full]
      # gpg:                 aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>" [full]
      # gpg:                 aka "[jpeg image of size 6874]" [full]
      # Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2  F3AA A7A1 6B4A 2527 436A
      
      * remotes/ericb/tags/pull-nbd-2019-02-11:
        qcow2: list of bitmaps new test 242
        qcow2: Add list of bitmaps to ImageInfoSpecificQCow2
        bdrv_query_image_info Error parameter added
        nbd/server: Kill pointless shadowed variable
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      d85e60e9
    • Stefano Garzarella's avatar
      virtio-blk: cleanup using VirtIOBlock *s and VirtIODevice *vdev · 9a6719d5
      Stefano Garzarella authored
      
      In several part we still using req->dev or VIRTIO_DEVICE(req->dev)
      when we have already defined s and vdev pointers:
          VirtIOBlock *s = req->dev;
          VirtIODevice *vdev = VIRTIO_DEVICE(s);
      
      Signed-off-by: default avatarStefano Garzarella <sgarzare@redhat.com>
      Reviewed-by: default avatarLiam Merwick <liam.merwick@oracle.com>
      Message-id: 20190208142347.214815-1-sgarzare@redhat.com
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      9a6719d5
    • Vladimir Sementsov-Ogievskiy's avatar
      qemugdb/coroutine: fix arch_prctl has unknown return type · 6eaa20c8
      Vladimir Sementsov-Ogievskiy authored
      qemu coroutine command results in following error output:
      
      Python Exception <class 'gdb.error'> 'arch_prctl' has unknown return
      type; cast the call to its declared return type: Error occurred in
      Python command: 'arch_prctl' has unknown return type; cast the call to
      its declared return type
      
      Fix it by giving it what it wants: arch_prctl return type.
      
      Information on the topic:
         https://sourceware.org/gdb/onlinedocs/gdb/Calling.html
      
      
      
      Signed-off-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-id: 20190206151425.105871-1-vsementsov@virtuozzo.com
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      6eaa20c8
    • Peter Xu's avatar
      iothread: fix iothread hang when stop too soon · 6c95363d
      Peter Xu authored
      
      Lukas reported an hard to reproduce QMP iothread hang on s390 that
      QEMU might hang at pthread_join() of the QMP monitor iothread before
      quitting:
      
        Thread 1
        #0  0x000003ffad10932c in pthread_join
        #1  0x0000000109e95750 in qemu_thread_join
            at /home/thuth/devel/qemu/util/qemu-thread-posix.c:570
        #2  0x0000000109c95a1c in iothread_stop
        #3  0x0000000109bb0874 in monitor_cleanup
        #4  0x0000000109b55042 in main
      
      While the iothread is still in the main loop:
      
        Thread 4
        #0  0x000003ffad0010e4 in ??
        #1  0x000003ffad553958 in g_main_context_iterate.isra.19
        #2  0x000003ffad553d90 in g_main_loop_run
        #3  0x0000000109c9585a in iothread_run
            at /home/thuth/devel/qemu/iothread.c:74
        #4  0x0000000109e94752 in qemu_thread_start
            at /home/thuth/devel/qemu/util/qemu-thread-posix.c:502
        #5  0x000003ffad10825a in start_thread
        #6  0x000003ffad00dcf2 in thread_start
      
      IMHO it's because there's a race between the main thread and iothread
      when stopping the thread in following sequence:
      
          main thread                       iothread
          ===========                       ==============
                                            aio_poll()
          iothread_get_g_main_context
            set iothread->worker_context
          iothread_stop
            schedule iothread_stop_bh
                                              execute iothread_stop_bh [1]
                                                set iothread->running=false
                                                (since main_loop==NULL so
                                                 skip to quit main loop.
                                                 Note: although main_loop is
                                                 NULL but worker_context is
                                                 not!)
                                            atomic_read(&iothread->worker_context) [2]
                                              create main_loop object
                                              g_main_loop_run() [3]
          pthread_join() [4]
      
      We can see that when execute iothread_stop_bh() at [1] it's possible
      that main_loop is still NULL because it's only created until the first
      check of the worker_context later at [2].  Then the iothread will hang
      in the main loop [3] and it'll starve the main thread too [4].
      
      Here the simple solution should be that we check again the "running"
      variable before check against worker_context.
      
      CC: Thomas Huth <thuth@redhat.com>
      CC: Dr. David Alan Gilbert <dgilbert@redhat.com>
      CC: Stefan Hajnoczi <stefanha@redhat.com>
      CC: Lukáš Doktor <ldoktor@redhat.com>
      CC: Markus Armbruster <armbru@redhat.com>
      CC: Eric Blake <eblake@redhat.com>
      CC: Paolo Bonzini <pbonzini@redhat.com>
      Reported-by: default avatarLukáš Doktor <ldoktor@redhat.com>
      Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
      Tested-by: default avatarThomas Huth <thuth@redhat.com>
      Message-id: 20190129051432.22023-1-peterx@redhat.com
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      6c95363d
  2. Feb 11, 2019
  3. Feb 08, 2019
  4. Feb 07, 2019
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/thibault/tags/samuel-thibault' into staging · e47f81b6
      Peter Maydell authored
      
      More work towards libslirp
      
      Marc-André Lureau (27):
        slirp: generalize guestfwd with a callback based approach
        net/slirp: simplify checking for cmd: prefix
        net/slirp: free forwarding rules on cleanup
        net/slirp: fix leaks on forwarding rule registration error
        slirp: add callbacks for timer
        slirp: replace trace functions with DEBUG calls
        slirp: replace QEMU_PACKED with SLIRP_PACKED
        slirp: replace most qemu socket utilities with slirp own version
        slirp: replace qemu_set_nonblock()
        slirp: add unregister_poll_fd() callback
        slirp: replace qemu_notify_event() with a callback
        slirp: move QEMU state saving to a separate unit
        slirp: do not include qemu headers in libslirp.h public API header
        slirp: improve windows headers inclusion
        slirp: add slirp own version of pstrcpy
        slirp: remove qemu timer.h dependency
        slirp: remove now useless QEMU headers inclusions
        slirp: replace net/eth.h inclusion with own defines
        slirp: replace qemu qtailq with slirp own copy
        slirp: replace remaining qemu headers dependency
        slirp: prefer c99 types over BSD kind
        slirp: improve send_packet() callback
        slirp: replace global polling with per-instance & notifier
        slirp: remove slirp_instances list
        slirp: use polling callbacks, drop glib requirement
        slirp: pass opaque to all callbacks
        slirp: API is extern C
      
      Peter Maydell (2):
        slirp: Avoid marking naturally packed structs as QEMU_PACKED
        slirp: Don't mark struct ipq or struct ipasfrag as packed
      
      Samuel Thibault (3):
        slirp: Avoid unaligned 16bit memory access
        slirp: replace QEMU_BUILD_BUG_ON with G_STATIC_ASSERT
        slirp: Move g_spawn_async_with_fds_qemu compatibility to slirp/
      
      # gpg: Signature made Thu 07 Feb 2019 14:02:41 GMT
      # gpg:                using RSA key E61DBB15D4172BDEC97E92D9DB550E89F0FA54F3
      # gpg: Good signature from "Samuel Thibault <samuel.thibault@aquilenet.fr>" [unknown]
      # gpg:                 aka "Samuel Thibault <sthibault@debian.org>" [marginal]
      # gpg:                 aka "Samuel Thibault <samuel.thibault@gnu.org>" [unknown]
      # gpg:                 aka "Samuel Thibault <samuel.thibault@inria.fr>" [marginal]
      # gpg:                 aka "Samuel Thibault <samuel.thibault@labri.fr>" [marginal]
      # gpg:                 aka "Samuel Thibault <samuel.thibault@ens-lyon.org>" [marginal]
      # gpg:                 aka "Samuel Thibault <samuel.thibault@u-bordeaux.fr>" [unknown]
      # 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: 900C B024 B679 31D4 0F82  304B D017 8C76 7D06 9EE6
      #      Subkey fingerprint: E61D BB15 D417 2BDE C97E  92D9 DB55 0E89 F0FA 54F3
      
      * remotes/thibault/tags/samuel-thibault: (32 commits)
        slirp: API is extern C
        slirp: pass opaque to all callbacks
        slirp: use polling callbacks, drop glib requirement
        slirp: remove slirp_instances list
        slirp: replace global polling with per-instance & notifier
        slirp: improve send_packet() callback
        slirp: prefer c99 types over BSD kind
        slirp: replace remaining qemu headers dependency
        slirp: Move g_spawn_async_with_fds_qemu compatibility to slirp/
        slirp: replace QEMU_BUILD_BUG_ON with G_STATIC_ASSERT
        slirp: replace qemu qtailq with slirp own copy
        slirp: replace net/eth.h inclusion with own defines
        slirp: remove now useless QEMU headers inclusions
        slirp: remove qemu timer.h dependency
        slirp: add slirp own version of pstrcpy
        slirp: improve windows headers inclusion
        slirp: do not include qemu headers in libslirp.h public API header
        slirp: move QEMU state saving to a separate unit
        slirp: replace qemu_notify_event() with a callback
        slirp: add unregister_poll_fd() callback
        ...
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      e47f81b6
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-4.0-pull-request' into staging · ff372bb5
      Peter Maydell authored
      
      - add new netlink type from linux v4.18 and v4.19
      - fix coverity warning (CID 1390634)
      - fix ioctl(SIOCGIFCONF) crash
      
      # gpg: Signature made Thu 07 Feb 2019 13:12:53 GMT
      # gpg:                using RSA key F30C38BD3F2FBE3C
      # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
      # gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
      # gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
      # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C
      
      * remotes/vivier2/tags/linux-user-for-4.0-pull-request:
        linux-user: add new netlink types
        linux-user: Check sscanf return value in open_net_route()
        Fix linux-user crashes in ioctl(SIOCGIFCONF) when ifc_buf is NULL.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      ff372bb5
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/mcayland/tags/qemu-sparc-20190206' into staging · d55451dc
      Peter Maydell authored
      
      qemu-sparc queue
      
      # gpg: Signature made Wed 06 Feb 2019 21:25:18 GMT
      # gpg:                using RSA key CC621AB98E82200D915CC9C45BC2C56FAE0F321F
      # gpg:                issuer "mark.cave-ayland@ilande.co.uk"
      # gpg: Good signature from "Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>" [full]
      # Primary key fingerprint: CC62 1AB9 8E82 200D 915C  C9C4 5BC2 C56F AE0F 321F
      
      * remotes/mcayland/tags/qemu-sparc-20190206:
        sun4m: pass initrd size to OpenBIOS via fw_cfg interface
        sun4u: add power_mem_read routine
        hw/sparc64: Create VGA device only if it has really been requested
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      d55451dc
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/vivier2/tags/trivial-patches-pull-request' into staging · 4f0444fc
      Peter Maydell authored
      
      Trivial patches:
      * Update copyright
      * Fix LGPL in target/moxie
      * configure portability fix
      * Drop useless inclusion of "hw/i386/pc.h"
      * Mark the cpu-cluster device with user_creatable = false
      * tsc210x: Fix building with no verbosity
      
      # gpg: Signature made Wed 06 Feb 2019 15:27:35 GMT
      # gpg:                using RSA key F30C38BD3F2FBE3C
      # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
      # gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
      # gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
      # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C
      
      * remotes/vivier2/tags/trivial-patches-pull-request:
        hw/input/tsc210x: Fix building with no verbosity
        hw/cpu/cluster: Mark the cpu-cluster device with user_creatable = false
        hw/unicore32/puv3: Drop useless inclusion of "hw/i386/pc.h"
        hw/sparc64/sun4u: Drop useless inclusion of "hw/i386/pc.h"
        configure: Avoid non-portable 'test -o/-a'
        target/moxie: Fix LGPL information in the file headers
        qemu-common.h: Update copyright string for 2019
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      4f0444fc
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/elmarco/tags/dump-pull-request' into staging · 632351e0
      Peter Maydell authored
      
      Pull request
      
      # gpg: Signature made Wed 06 Feb 2019 14:57:54 GMT
      # gpg:                using RSA key DAE8E10975969CE5
      # gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" [full]
      # gpg:                 aka "Marc-André Lureau <marcandre.lureau@gmail.com>" [full]
      # Primary key fingerprint: 87A9 BD93 3F87 C606 D276  F62D DAE8 E109 7596 9CE5
      
      * remotes/elmarco/tags/dump-pull-request:
        dump: Set correct vaddr for ELF dump
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      632351e0
    • Marc-André Lureau's avatar
      slirp: API is extern C · ee261c02
      Marc-André Lureau authored
      
      Make it possible to use headers easily with C++ projects.
      
      Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: default avatarSamuel Thibault <samuel.thibault@ens-lyon.org>
      ee261c02
Loading