1. 21 Dec, 2017 25 commits
  2. 20 Dec, 2017 15 commits
    • Paolo Bonzini's avatar
      contrib: add systemd unit files · 2ba60ec1
      Paolo Bonzini authored
      This lets distros standardize on how QEMU should install systemd
      services for qemu-ga and qemu-pr-helper.
      
      The qemu-ga unit file comes from Fedora, but I checked that
      Debian is using the same path for the virtio-serisal port.
      
      I would like to include this in 2.11, so that the qemu-pr-helper
      socket can be standardized across distros.  Note however that
      the files are not installed.  We can add a configure option
      in 2.12 perhaps, but it's too late now; documenting the files
      in the release notes should do.
      Suggested-by: 's avatarDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: 's avatarPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20171124164422.3960-1-pbonzini@redhat.com>
      Signed-off-by: 's avatarPaolo Bonzini <pbonzini@redhat.com>
      2ba60ec1
    • Paolo Bonzini's avatar
      qemu-pr-helper: miscellaneous fixes · a4a9b6ea
      Paolo Bonzini authored
      1) Return a generic sense if TEST UNIT READY does not provide one;
      
      2) Fix two mistakes in copying from the spec.
      
      Cc: qemu-stable@nongnu.org
      Reported-by: 's avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: 's avatarPaolo Bonzini <pbonzini@redhat.com>
      a4a9b6ea
    • linzhecheng's avatar
      qemu-thread: fix races on threads that exit very quickly · 68a93982
      linzhecheng authored
      If we create a thread with QEMU_THREAD_DETACHED mode, QEMU may get a segfault with low probability.
      
      The backtrace is:
         #0  0x00007f46c60291d7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
         #1  0x00007f46c602a8c8 in __GI_abort () at abort.c:90
         #2  0x00000000008543c9 in PAT_abort ()
         #3  0x000000000085140d in patchIllInsHandler ()
         #4  <signal handler called>
         #5  pthread_detach (th=139933037614848) at pthread_detach.c:50
         #6  0x0000000000829759 in qemu_thread_create (thread=thread@entry=0x7ffdaa8205e0, name=name@entry=0x94d94a "io-task-worker", start_routine=start_routine@entry=0x7eb9a0 <qio_task_thread_worker>,
             arg=arg@entry=0x3f5cf70, mode=mode@entry=1) at util/qemu_thread_posix.c:512
         #7  0x00000000007ebc96 in qio_task_run_in_thread (task=0x31db2c0, worker=worker@entry=0x7e7e40 <qio_channel_socket_connect_worker>, opaque=0xcd23380, destroy=0x7f1180 <qapi_free_SocketAddress>)
             at io/task.c:141
         #8  0x00000000007e7f33 in qio_channel_socket_connect_async (ioc=ioc@entry=0x626c0b0, addr=<optimized out>, callback=callback@entry=0x55e080 <qemu_chr_socket_connected>, opaque=opaque@entry=0x42862c0,
             destroy=destroy@entry=0x0) at io/channel_socket.c:194
         #9  0x000000000055bdd1 in socket_reconnect_timeout (opaque=0x42862c0) at qemu_char.c:4744
         #10 0x00007f46c72483b3 in g_timeout_dispatch () from /usr/lib64/libglib-2.0.so.0
         #11 0x00007f46c724799a in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
         #12 0x000000000076c646 in glib_pollfds_poll () at main_loop.c:228
         #13 0x000000000076c6eb in os_host_main_loop_wait (timeout=348000000) at main_loop.c:273
         #14 0x000000000076c815 in main_loop_wait (nonblocking=nonblocking@entry=0) at main_loop.c:521
         #15 0x000000000056a511 in main_loop () at vl.c:2076
         #16 0x0000000000420705 in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at vl.c:4940
      
      The cause of this problem is a glibc bug; for more information, see
      https://sourceware.org/bugzilla/show_bug.cgi?id=19951.
      The solution for this bug is to use pthread_attr_setdetachstate.
      
      There is a similar issue with pthread_setname_np, which is moved
      from creating thread to created thread.
      Signed-off-by: 's avatarlinzhecheng <linzhecheng@huawei.com>
      Message-Id: <20171128044656.10592-1-linzhecheng@huawei.com>
      Reviewed-by: 's avatarFam Zheng <famz@redhat.com>
      [Simplify the code by removing qemu_thread_set_name, and free the arguments
       before invoking the start routine. - Paolo]
      Signed-off-by: 's avatarPaolo Bonzini <pbonzini@redhat.com>
      68a93982
    • Paolo Bonzini's avatar
      memfd: fix configure test · 75e5b70e
      Paolo Bonzini authored
      Recent glibc added memfd_create in sys/mman.h.  This conflicts with
      the definition in util/memfd.c:
      
          /builddir/build/BUILD/qemu-2.11.0-rc1/util/memfd.c:40:12: error: static declaration of memfd_create follows non-static declaration
      
      Fix the configure test, and remove the sys/memfd.h inclusion since the
      file actually does not exist---it is a typo in the memfd_create(2) man
      page.
      
      Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: 's avatarPaolo Bonzini <pbonzini@redhat.com>
      75e5b70e
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/armbru/tags/pull-cmdline-2017-12-18-v2' into staging · 200780a3
      Peter Maydell authored
      Command line patches for 2017-12-18
      
      # gpg: Signature made Wed 20 Dec 2017 08:11:57 GMT
      # 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-cmdline-2017-12-18-v2:
        option: Drop unused get_param_value(), get_next_param_value()
        option: Remove shadowing opt decl from qemu_opt_print()
        qemu-options: Belatedly document --watchdog-action inject-nmi
        qemu-options: Polish section "Character device options"
        qemu-options: Polish section "TPM device options"
        qemu-options: Add missing -iscsi Texinfo documentation
        qemu-options: Move -iscsi under "Block device options"
        qemu-options qemu-doc: Move "Device URL Syntax" to qemu-doc
        qemu-options: Fix markup of -netdev l2tpv3
        qemu-options: Remove stray colons from output of --help
      Signed-off-by: 's avatarPeter Maydell <peter.maydell@linaro.org>
      200780a3
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging · f1faf2d5
      Peter Maydell authored
      Pull request
      
      v2:
       * Fixed incorrect virtio_blk_data_plane_create() local_err refactoring in
         "hw/block: Use errp directly rather than local_err" that broke virtio-blk
         over virtio-mmio [Peter]
      
      # gpg: Signature made Tue 19 Dec 2017 15:08:14 GMT
      # 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: (23 commits)
        qemu-iotests: add 203 savevm with IOThreads test
        iothread: fix iothread_stop() race condition
        iotests: add VM.add_object()
        blockdev: add x-blockdev-set-iothread force boolean
        docs: mark nested AioContext locking as a legacy API
        block: avoid recursive AioContext acquire in bdrv_inactivate_all()
        virtio-blk: reject configs with logical block size > physical block size
        virtio-blk: make queue size configurable
        qemu-iotests: add 202 external snapshots IOThread test
        blockdev: add x-blockdev-set-iothread testing command
        iothread: add iothread_by_id() API
        block: drop unused BlockDirtyBitmapState->aio_context field
        block: don't keep AioContext acquired after internal_snapshot_prepare()
        block: don't keep AioContext acquired after blockdev_backup_prepare()
        block: don't keep AioContext acquired after drive_backup_prepare()
        block: don't keep AioContext acquired after external_snapshot_prepare()
        blockdev: hold AioContext for bdrv_unref() in external_snapshot_clean()
        qdev: drop unused #include "sysemu/iothread.h"
        dev-storage: Fix the unusual function name
        hw/block: Use errp directly rather than local_err
        ...
      Signed-off-by: 's avatarPeter Maydell <peter.maydell@linaro.org>
      
      # Conflicts:
      #	hw/core/qdev-properties-system.c
      f1faf2d5
    • Markus Armbruster's avatar
      option: Drop unused get_param_value(), get_next_param_value() · 3e05349d
      Markus Armbruster authored
      Their last user went away in commit f51074cd, "pci-hotplug-old: Has
      been dead for five major releases, bury", v2.3.0.  Remove them, as new
      code should use QemuOpts or maybe keyval_parse() instead.
      Signed-off-by: 's avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20171006131645.17729-1-armbru@redhat.com>
      Reviewed-by: 's avatarEric Blake <eblake@redhat.com>
      3e05349d
    • Dr. David Alan Gilbert's avatar
      option: Remove shadowing opt decl from qemu_opt_print() · da78e382
      Dr. David Alan Gilbert authored
      opt was declared as a separate local inside the last loop,
      shadowing the local at the top of the function.
      Signed-off-by: 's avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Message-Id: <20171005190725.18712-1-dgilbert@redhat.com>
      Reviewed-by: 's avatarEric Blake <eblake@redhat.com>
      Signed-off-by: 's avatarMarkus Armbruster <armbru@redhat.com>
      da78e382
    • Markus Armbruster's avatar
      qemu-options: Belatedly document --watchdog-action inject-nmi · 7ad9270e
      Markus Armbruster authored
      Missed in commit 795dc6e4, v2.4.0.
      Signed-off-by: 's avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20171002140307.5292-9-armbru@redhat.com>
      Reviewed-by: 's avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      7ad9270e
    • Markus Armbruster's avatar
      qemu-options: Polish section "Character device options" · dddba068
      Markus Armbruster authored
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      CC: Marc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: 's avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20171002140307.5292-8-armbru@redhat.com>
      Reviewed-by: 's avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      dddba068
    • Markus Armbruster's avatar
      qemu-options: Polish section "TPM device options" · 2252aaf0
      Markus Armbruster authored
      Cc: Stefan Berger <stefanb@linux.vnet.ibm.com>
      Signed-off-by: 's avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20171002140307.5292-7-armbru@redhat.com>
      Reviewed-by: 's avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      2252aaf0
    • Markus Armbruster's avatar
      qemu-options: Add missing -iscsi Texinfo documentation · 44743148
      Markus Armbruster authored
      Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Max Reitz <mreitz@redhat.com>
      Cc: qemu-block@nongnu.org
      Signed-off-by: 's avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20171002140307.5292-6-armbru@redhat.com>
      Reviewed-by: 's avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Reviewed-by: 's avatarRonnie Sahlberg <ronniesahlberg@gmail.com>
      44743148
    • Markus Armbruster's avatar
      qemu-options: Move -iscsi under "Block device options" · 61d70487
      Markus Armbruster authored
      -iscsi ended up under the "Device URL Syntax" heading by a sequence of
      errors, as explained in the previous commit.  Move it under the "Block
      device options" heading.  Nothing left under "Device URL Syntax";
      drop the heading.
      
      Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Max Reitz <mreitz@redhat.com>
      Cc: qemu-block@nongnu.org
      Signed-off-by: 's avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20171002140307.5292-5-armbru@redhat.com>
      Reviewed-by: 's avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Reviewed-by: 's avatarRonnie Sahlberg <ronniesahlberg@gmail.com>
      61d70487
    • Markus Armbruster's avatar
      qemu-options qemu-doc: Move "Device URL Syntax" to qemu-doc · e896d0f9
      Markus Armbruster authored
      Commit 0f5314a2 (v1.0) added section "Device URL Syntax" to
      qemu-options.hx.  It's enclosed in STEXI..ETEXI, thus affects only
      qemu-options.texi, not --help.  It appears as a subsection under
      section "Invocation".  Similarly, qemu.1 has it as a subsection under
      "OPTIONS".
      
      Commit f9dadc98 (v1.1.0) dropped new option -iscsi into the middle of
      this section.  No effect on qemu-options.texi.  It appears in --help
      run together with the "Bluetooth(R) options:" header.
      
      Commit c70a01e4 (v1.5.0) gives it is own heading in --help by moving
      commit 0f5314a2's DEFHEADING(Device URL Syntax:) outside STEXI..ETEXI.
      Trouble is the heading makes no sense for -iscsi.
      
      Move all of the "Device URL Syntax" Texinfo to qemu-doc.texi.  Mark it
      for inclusion in qemu.1 with '@c man begin NOTES'.  This turns it into
      a separate section outside the list of options both in qemu-doc and in
      qemu.1.
      
      There's substantial overlap with the existing qemu-doc section "Disk
      Images".  Mark with a TODO comment.
      
      Output of --help will be fixed next.
      
      Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Max Reitz <mreitz@redhat.com>
      Cc: qemu-block@nongnu.org
      Signed-off-by: 's avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20171002140307.5292-4-armbru@redhat.com>
      Reviewed-by: 's avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Reviewed-by: 's avatarRonnie Sahlberg <ronniesahlberg@gmail.com>
      [Unwanted @node dropped]
      e896d0f9
    • Markus Armbruster's avatar
      qemu-options: Fix markup of -netdev l2tpv3 · 1e9a7379
      Markus Armbruster authored
      The table of option parameters lacks @table and @end table.  The
      parameters become items in the enclosing table of options.  Screwed up
      when l2tpv3 was added in commit 3fb69aa1.  Fix the obvious way.
      
      Cc: Jason Wang <jasowang@redhat.com>
      Signed-off-by: 's avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20171002140307.5292-3-armbru@redhat.com>
      Reviewed-by: 's avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      1e9a7379