Skip to content
Snippets Groups Projects
  1. Sep 08, 2023
  2. Aug 07, 2023
  3. Mar 03, 2023
    • Yajun Wu's avatar
      chardev/char-socket: set s->listener = NULL in char_socket_finalize · b8a7f51f
      Yajun Wu authored
      
      After live migration with virtio block device, qemu crash at:
      
      	#0  0x000055914f46f795 in object_dynamic_cast_assert (obj=0x559151b7b090, typename=0x55914f80fbc4 "qio-channel", file=0x55914f80fb90 "/images/testvfe/sw/qemu.gerrit/include/io/channel.h", line=30, func=0x55914f80fcb8 <__func__.17257> "QIO_CHANNEL") at ../qom/object.c:872
      	#1  0x000055914f480d68 in QIO_CHANNEL (obj=0x559151b7b090) at /images/testvfe/sw/qemu.gerrit/include/io/channel.h:29
      	#2  0x000055914f4812f8 in qio_net_listener_set_client_func_full (listener=0x559151b7a720, func=0x55914f580b97 <tcp_chr_accept>, data=0x5591519f4ea0, notify=0x0, context=0x0) at ../io/net-listener.c:166
      	#3  0x000055914f580059 in tcp_chr_update_read_handler (chr=0x5591519f4ea0) at ../chardev/char-socket.c:637
      	#4  0x000055914f583dca in qemu_chr_be_update_read_handlers (s=0x5591519f4ea0, context=0x0) at ../chardev/char.c:226
      	#5  0x000055914f57b7c9 in qemu_chr_fe_set_handlers_full (b=0x559152bf23a0, fd_can_read=0x0, fd_read=0x0, fd_event=0x0, be_change=0x0, opaque=0x0, context=0x0, set_open=false, sync_state=true) at ../chardev/char-fe.c:279
      	#6  0x000055914f57b86d in qemu_chr_fe_set_handlers (b=0x559152bf23a0, fd_can_read=0x0, fd_read=0x0, fd_event=0x0, be_change=0x0, opaque=0x0, context=0x0, set_open=false) at ../chardev/char-fe.c:304
      	#7  0x000055914f378caf in vhost_user_async_close (d=0x559152bf21a0, chardev=0x559152bf23a0, vhost=0x559152bf2420, cb=0x55914f2fb8c1 <vhost_user_blk_disconnect>) at ../hw/virtio/vhost-user.c:2725
      	#8  0x000055914f2fba40 in vhost_user_blk_event (opaque=0x559152bf21a0, event=CHR_EVENT_CLOSED) at ../hw/block/vhost-user-blk.c:395
      	#9  0x000055914f58388c in chr_be_event (s=0x5591519f4ea0, event=CHR_EVENT_CLOSED) at ../chardev/char.c:61
      	#10 0x000055914f583905 in qemu_chr_be_event (s=0x5591519f4ea0, event=CHR_EVENT_CLOSED) at ../chardev/char.c:81
      	#11 0x000055914f581275 in char_socket_finalize (obj=0x5591519f4ea0) at ../chardev/char-socket.c:1083
      	#12 0x000055914f46f073 in object_deinit (obj=0x5591519f4ea0, type=0x5591519055c0) at ../qom/object.c:680
      	#13 0x000055914f46f0e5 in object_finalize (data=0x5591519f4ea0) at ../qom/object.c:694
      	#14 0x000055914f46ff06 in object_unref (objptr=0x5591519f4ea0) at ../qom/object.c:1202
      	#15 0x000055914f4715a4 in object_finalize_child_property (obj=0x559151b76c50, name=0x559151b7b250 "char3", opaque=0x5591519f4ea0) at ../qom/object.c:1747
      	#16 0x000055914f46ee86 in object_property_del_all (obj=0x559151b76c50) at ../qom/object.c:632
      	#17 0x000055914f46f0d2 in object_finalize (data=0x559151b76c50) at ../qom/object.c:693
      	#18 0x000055914f46ff06 in object_unref (objptr=0x559151b76c50) at ../qom/object.c:1202
      	#19 0x000055914f4715a4 in object_finalize_child_property (obj=0x559151b6b560, name=0x559151b76630 "chardevs", opaque=0x559151b76c50) at ../qom/object.c:1747
      	#20 0x000055914f46ef67 in object_property_del_child (obj=0x559151b6b560, child=0x559151b76c50) at ../qom/object.c:654
      	#21 0x000055914f46f042 in object_unparent (obj=0x559151b76c50) at ../qom/object.c:673
      	#22 0x000055914f58632a in qemu_chr_cleanup () at ../chardev/char.c:1189
      	#23 0x000055914f16c66c in qemu_cleanup () at ../softmmu/runstate.c:830
      	#24 0x000055914eee7b9e in qemu_default_main () at ../softmmu/main.c:38
      	#25 0x000055914eee7bcc in main (argc=86, argv=0x7ffc97cb8d88) at ../softmmu/main.c:48
      
      In char_socket_finalize after s->listener freed, event callback function
      vhost_user_blk_event will be called to handle CHR_EVENT_CLOSED.
      vhost_user_blk_event is calling qio_net_listener_set_client_func_full which
      is still using s->listener.
      
      Setting s->listener = NULL after object_unref(OBJECT(s->listener)) can
      solve this issue.
      
      Signed-off-by: default avatarYajun Wu <yajunw@nvidia.com>
      Acked-by: default avatarJiri Pirko <jiri@nvidia.com>
      Message-Id: <20230214021430.3638579-1-yajunw@nvidia.com>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      b8a7f51f
  4. Feb 06, 2023
  5. Dec 14, 2022
  6. Sep 02, 2022
  7. May 03, 2022
  8. Jan 07, 2022
  9. Dec 21, 2021
  10. Sep 27, 2021
    • Markus Armbruster's avatar
      qapi: Convert simple union SocketAddressLegacy to flat one · 935a867c
      Markus Armbruster authored
      
      Simple unions predate flat unions.  Having both complicates the QAPI
      schema language and the QAPI generator.  We haven't been using simple
      unions in new code for a long time, because they are less flexible and
      somewhat awkward on the wire.
      
      To prepare for their removal, convert simple union SocketAddressLegacy
      to an equivalent flat one, with existing enum SocketAddressType
      replacing implicit enum type SocketAddressLegacyKind.  Adds some
      boilerplate to the schema, which is a bit ugly, but a lot easier to
      maintain than the simple union feature.
      
      Cc: "Daniel P. Berrangé" <berrange@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Message-Id: <20210917143134.412106-9-armbru@redhat.com>
      935a867c
  11. Aug 04, 2021
  12. Jun 29, 2021
  13. Apr 01, 2021
    • Lukas Straub's avatar
      chardev: Fix yank with the chardev-change case · feb774ca
      Lukas Straub authored
      
      When changing from chardev-socket (which supports yank) to
      chardev-socket again, it fails, because the new chardev attempts
      to register a new yank instance. This in turn fails, as there
      still is the yank instance from the current chardev. Also,
      the old chardev shouldn't unregister the yank instance when it
      is freed.
      
      To fix this, now the new chardev only registers a yank instance if
      the current chardev doesn't support yank and thus hasn't registered
      one already. Also, when the old chardev is freed, it now only
      unregisters the yank instance if the new chardev doesn't need it.
      
      If the initialization of the new chardev fails, it still has
      chr->handover_yank_instance set and won't unregister the yank
      instance when it is freed.
      
      s->registered_yank is always true here, as chardev-change only works
      on user-visible chardevs and those are guraranteed to register a
      yank instance as they are initialized via
      chardev_new()
       qemu_char_open()
        cc->open() (qmp_chardev_open_socket()).
      
      Signed-off-by: default avatarLukas Straub <lukasstraub2@web.de>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Tested-by: default avatarLi Zhang <li.zhang@cloud.ionos.com>
      Message-Id: <9637888d7591d2971975188478bb707299a1dc04.1617127849.git.lukasstraub2@web.de>
      feb774ca
    • Lukas Straub's avatar
      yank: Remove dependency on qiochannel · 1a92d6d5
      Lukas Straub authored
      
      Remove dependency on qiochannel by removing yank_generic_iochannel and
      letting migration and chardev use their own yank function for
      iochannel.
      
      Signed-off-by: default avatarLukas Straub <lukasstraub2@web.de>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <20ff143fc2db23e27cd41d38043e481376c9cec1.1616521341.git.lukasstraub2@web.de>
      1a92d6d5
  14. Mar 18, 2021
  15. Mar 06, 2021
    • Paolo Bonzini's avatar
      chardev: add nodelay option · a9b1315f
      Paolo Bonzini authored
      
      The "delay" option was introduced as a way to enable Nagle's algorithm
      with ",nodelay".  Since the short form for boolean options has now been
      deprecated, introduce a more properly named "nodelay" option.  The "delay"
      option remains as an undocumented option.
      
      "delay" and "nodelay" are mutually exclusive.  Because the check is
      done at consumption time, the code also rejects them if one of the
      two is specified via -set.
      
      Based-on: <20210226080526.651705-1-pbonzini@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      a9b1315f
  16. Feb 25, 2021
  17. Feb 04, 2021
  18. Jan 13, 2021
  19. Nov 03, 2020
    • Markus Armbruster's avatar
      sockets: Make abstract UnixSocketAddress depend on CONFIG_LINUX · 8acefc79
      Markus Armbruster authored
      
      The abstract socket namespace is a non-portable Linux extension.  An
      attempt to use it elsewhere should fail with ENOENT (the abstract
      address looks like a "" pathname, which does not resolve).  We report
      this failure like
      
          Failed to connect socket abc: No such file or directory
      
      Tolerable, although ENOTSUP would be better.
      
      However, introspection lies: it has @abstract regardless of host
      support.  Easy enough to fix: since Linux provides them since 2.2,
      'if': 'defined(CONFIG_LINUX)' should do.
      
      The above failure becomes
      
          Parameter 'backend.data.addr.data.abstract' is unexpected
      
      I consider this an improvement.
      
      Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      8acefc79
    • Markus Armbruster's avatar
      char-socket: Fix qemu_chr_socket_address() for abstract sockets · dea7cd17
      Markus Armbruster authored
      
      Commit 776b97d3 "qemu-sockets: add abstract UNIX domain socket
      support" neglected to update qemu_chr_socket_address().  It shows
      shows neither @abstract nor @tight.  Fix that.
      
      Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      dea7cd17
    • Markus Armbruster's avatar
      sockets: Fix default of UnixSocketAddress member @tight · b08cc97d
      Markus Armbruster authored
      
      An optional bool member of a QAPI struct can be false, true, or absent.
      The previous commit demonstrated that socket_listen() and
      socket_connect() are broken for absent @tight, and indeed QMP chardev-
      add also defaults absent member @tight to false instead of true.
      
      In C, QAPI members are represented by two fields, has_MEMBER and MEMBER.
      We have:
      
                  has_MEMBER    MEMBER
          false         true     false
          true          true      true
          absent       false  false/ignore
      
      When has_MEMBER is false, MEMBER should be set to false on write, and
      ignored on read.
      
      For QMP, the QAPI visitors handle absent @tight by setting both
      @has_tight and @tight to false.  unix_listen_saddr() and
      unix_connect_saddr() however use @tight only, disregarding @has_tight.
      This is wrong and means that absent @tight defaults to false whereas it
      should default to true.
      
      The same is true for @has_abstract, though @abstract defaults to
      false and therefore has the same behavior for all of QMP, HMP and CLI.
      Fix unix_listen_saddr() and unix_connect_saddr() to check
      @has_abstract/@has_tight, and to default absent @tight to true.
      
      However, this is only half of the story.  HMP chardev-add and CLI
      -chardev so far correctly defaulted @tight to true, but defaults to
      false again with the above fix for HMP and CLI.  In fact, the "tight"
      and "abstract" options now break completely.
      
      Digging deeper, we find that qemu_chr_parse_socket() also ignores
      @has_tight, leaving it false when it sets @tight.  That is also wrong,
      but the two wrongs cancelled out.  Fix qemu_chr_parse_socket() to set
      @has_tight and @has_abstract; writing testcases for HMP and CLI is left
      for another day.
      
      Fixes: 776b97d3
      Reported-by: default avatarKevin Wolf <kwolf@redhat.com>
      Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      b08cc97d
  20. Sep 09, 2020
  21. Jul 13, 2020
    • Marc-André Lureau's avatar
      char: fix use-after-free with dup chardev & reconnect · 68066019
      Marc-André Lureau authored
      
      With a reconnect socket, qemu_char_open() will start a background
      thread. It should keep a reference on the chardev.
      
      Fixes invalid read:
      READ of size 8 at 0x6040000ac858 thread T7
          #0 0x5555598d37b8 in unix_connect_saddr /home/elmarco/src/qq/util/qemu-sockets.c:954
          #1 0x5555598d4751 in socket_connect /home/elmarco/src/qq/util/qemu-sockets.c:1109
          #2 0x555559707c34 in qio_channel_socket_connect_sync /home/elmarco/src/qq/io/channel-socket.c:145
          #3 0x5555596adebb in tcp_chr_connect_client_task /home/elmarco/src/qq/chardev/char-socket.c:1104
          #4 0x555559723d55 in qio_task_thread_worker /home/elmarco/src/qq/io/task.c:123
          #5 0x5555598a6731 in qemu_thread_start /home/elmarco/src/qq/util/qemu-thread-posix.c:519
          #6 0x7ffff40d4431 in start_thread (/lib64/libpthread.so.0+0x9431)
          #7 0x7ffff40029d2 in __clone (/lib64/libc.so.6+0x1019d2)
      
      Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      Message-Id: <20200420112012.567284-1-marcandre.lureau@redhat.com>
      68066019
    • Li Feng's avatar
      char-socket: initialize reconnect timer only when the timer doesn't start · 2b61bb71
      Li Feng authored
      
      When the disconnect event is triggered in the connecting stage,
      the tcp_chr_disconnect_locked may be called twice.
      
      The first call:
          #0  qemu_chr_socket_restart_timer (chr=0x55555582ee90) at chardev/char-socket.c:120
          #1  0x000055555558e38c in tcp_chr_disconnect_locked (chr=<optimized out>) at chardev/char-socket.c:490
          #2  0x000055555558e3cd in tcp_chr_disconnect (chr=0x55555582ee90) at chardev/char-socket.c:497
          #3  0x000055555558ea32 in tcp_chr_new_client (chr=chr@entry=0x55555582ee90, sioc=sioc@entry=0x55555582f0b0) at chardev/char-socket.c:892
          #4  0x000055555558eeb8 in qemu_chr_socket_connected (task=0x55555582f300, opaque=<optimized out>) at chardev/char-socket.c:1090
          #5  0x0000555555574352 in qio_task_complete (task=task@entry=0x55555582f300) at io/task.c:196
          #6  0x00005555555745f4 in qio_task_thread_result (opaque=0x55555582f300) at io/task.c:111
          #7  qio_task_wait_thread (task=0x55555582f300) at io/task.c:190
          #8  0x000055555558f17e in tcp_chr_wait_connected (chr=0x55555582ee90, errp=0x555555802a08 <error_abort>) at chardev/char-socket.c:1013
          #9  0x0000555555567cbd in char_socket_client_reconnect_test (opaque=0x5555557fe020 <client8unix>) at tests/test-char.c:1152
      The second call:
          #0  0x00007ffff5ac3277 in raise () from /lib64/libc.so.6
          #1  0x00007ffff5ac4968 in abort () from /lib64/libc.so.6
          #2  0x00007ffff5abc096 in __assert_fail_base () from /lib64/libc.so.6
          #3  0x00007ffff5abc142 in __assert_fail () from /lib64/libc.so.6
          #4  0x000055555558d10a in qemu_chr_socket_restart_timer (chr=0x55555582ee90) at chardev/char-socket.c:125
          #5  0x000055555558df0c in tcp_chr_disconnect_locked (chr=<optimized out>) at chardev/char-socket.c:490
          #6  0x000055555558df4d in tcp_chr_disconnect (chr=0x55555582ee90) at chardev/char-socket.c:497
          #7  0x000055555558e5b2 in tcp_chr_new_client (chr=chr@entry=0x55555582ee90, sioc=sioc@entry=0x55555582f0b0) at chardev/char-socket.c:892
          #8  0x000055555558e93a in tcp_chr_connect_client_sync (chr=chr@entry=0x55555582ee90, errp=errp@entry=0x7fffffffd178) at chardev/char-socket.c:944
          #9  0x000055555558ec78 in tcp_chr_wait_connected (chr=0x55555582ee90, errp=0x555555802a08 <error_abort>) at chardev/char-socket.c:1035
          #10 0x000055555556804b in char_socket_client_test (opaque=0x5555557fe020 <client8unix>) at tests/test-char.c:1023
      
      Run test/test-char to reproduce this issue.
      
      test-char: chardev/char-socket.c:125: qemu_chr_socket_restart_timer: Assertion `!s->reconnect_timer' failed.
      
      Signed-off-by: default avatarLi Feng <fengli@smartx.com>
      Acked-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <20200522025554.41063-1-fengli@smartx.com>
      2b61bb71
  22. Jul 02, 2020
  23. Jun 10, 2020
  24. Jun 09, 2020
    • Dima Stepanov's avatar
      char-socket: return -1 in case of disconnect during tcp_chr_write · 27109447
      Dima Stepanov authored
      
      During testing of the vhost-user-blk reconnect functionality the qemu
      SIGSEGV was triggered:
       start qemu as:
       x86_64-softmmu/qemu-system-x86_64 -m 1024M -M q35 \
         -object memory-backend-file,id=ram-node0,size=1024M,mem-path=/dev/shm/qemu,share=on \
         -numa node,cpus=0,memdev=ram-node0 \
         -chardev socket,id=chardev0,path=./vhost.sock,noserver,reconnect=1 \
         -device vhost-user-blk-pci,chardev=chardev0,num-queues=4 --enable-kvm
       start vhost-user-blk daemon:
       ./vhost-user-blk -s ./vhost.sock -b test-img.raw
      
      If vhost-user-blk will be killed during the vhost initialization
      process, for instance after getting VHOST_SET_VRING_CALL command, then
      QEMU will fail with the following backtrace:
      
      Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault.
      0x00005555559272bb in vhost_user_read (dev=0x7fffef2d53e0, msg=0x7fffffffd5b0)
          at ./hw/virtio/vhost-user.c:260
      260         CharBackend *chr = u->user->chr;
      
       #0  0x00005555559272bb in vhost_user_read (dev=0x7fffef2d53e0, msg=0x7fffffffd5b0)
          at ./hw/virtio/vhost-user.c:260
       #1  0x000055555592acb8 in vhost_user_get_config (dev=0x7fffef2d53e0, config=0x7fffef2d5394 "", config_len=60)
          at ./hw/virtio/vhost-user.c:1645
       #2  0x0000555555925525 in vhost_dev_get_config (hdev=0x7fffef2d53e0, config=0x7fffef2d5394 "", config_len=60)
          at ./hw/virtio/vhost.c:1490
       #3  0x00005555558cc46b in vhost_user_blk_device_realize (dev=0x7fffef2d51a0, errp=0x7fffffffd8f0)
          at ./hw/block/vhost-user-blk.c:429
       #4  0x0000555555920090 in virtio_device_realize (dev=0x7fffef2d51a0, errp=0x7fffffffd948)
          at ./hw/virtio/virtio.c:3615
       #5  0x0000555555a9779c in device_set_realized (obj=0x7fffef2d51a0, value=true, errp=0x7fffffffdb88)
          at ./hw/core/qdev.c:891
       ...
      
      The problem is that vhost_user_write doesn't get an error after
      disconnect and try to call vhost_user_read(). The tcp_chr_write()
      routine should return -1 in case of disconnect. Indicate the EIO error
      if this routine is called in the disconnected state.
      
      Signed-off-by: default avatarDima Stepanov <dimastep@yandex-team.ru>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <aeb7806bfc945faadf09f64dcfa30f59de3ac053.1590396396.git.dimastep@yandex-team.ru>
      Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      27109447
  25. May 27, 2020
  26. May 20, 2020
  27. May 15, 2020
    • Markus Armbruster's avatar
      qom: Drop parameter @errp of object_property_add() & friends · d2623129
      Markus Armbruster authored
      
      The only way object_property_add() can fail is when a property with
      the same name already exists.  Since our property names are all
      hardcoded, failure is a programming error, and the appropriate way to
      handle it is passing &error_abort.
      
      Same for its variants, except for object_property_add_child(), which
      additionally fails when the child already has a parent.  Parentage is
      also under program control, so this is a programming error, too.
      
      We have a bit over 500 callers.  Almost half of them pass
      &error_abort, slightly fewer ignore errors, one test case handles
      errors, and the remaining few callers pass them to their own callers.
      
      The previous few commits demonstrated once again that ignoring
      programming errors is a bad idea.
      
      Of the few ones that pass on errors, several violate the Error API.
      The Error ** argument must be NULL, &error_abort, &error_fatal, or a
      pointer to a variable containing NULL.  Passing an argument of the
      latter kind twice without clearing it in between is wrong: if the
      first call sets an error, it no longer points to NULL for the second
      call.  ich9_pm_add_properties(), sparc32_ledma_realize(),
      sparc32_dma_realize(), xilinx_axidma_realize(), xilinx_enet_realize()
      are wrong that way.
      
      When the one appropriate choice of argument is &error_abort, letting
      users pick the argument is a bad idea.
      
      Drop parameter @errp and assert the preconditions instead.
      
      There's one exception to "duplicate property name is a programming
      error": the way object_property_add() implements the magic (and
      undocumented) "automatic arrayification".  Don't drop @errp there.
      Instead, rename object_property_add() to object_property_try_add(),
      and add the obvious wrapper object_property_add().
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20200505152926.18877-15-armbru@redhat.com>
      [Two semantic rebase conflicts resolved]
      d2623129
  28. Sep 03, 2019
  29. Aug 21, 2019
    • Alberto Garcia's avatar
      char-socket: Lock tcp_chr_disconnect() and socket_reconnect_timeout() · 78d01598
      Alberto Garcia authored
      
      There's a race condition in which the tcp_chr_read() ioc handler can
      close a connection that is being written to from another thread.
      
      Running iotest 136 in a loop triggers this problem and crashes QEMU.
      
       (gdb) bt
       #0  0x00005558b842902d in object_get_class (obj=0x0) at qom/object.c:860
       #1  0x00005558b84f92db in qio_channel_writev_full (ioc=0x0, iov=0x7ffc355decf0, niov=1, fds=0x0, nfds=0, errp=0x0) at io/channel.c:76
       #2  0x00005558b84e0e9e in io_channel_send_full (ioc=0x0, buf=0x5558baf5beb0, len=138, fds=0x0, nfds=0) at chardev/char-io.c:123
       #3  0x00005558b84e4a69 in tcp_chr_write (chr=0x5558ba460380, buf=0x5558baf5beb0 "...", len=138) at chardev/char-socket.c:135
       #4  0x00005558b84dca55 in qemu_chr_write_buffer (s=0x5558ba460380, buf=0x5558baf5beb0 "...", len=138, offset=0x7ffc355dedd0, write_all=false) at chardev/char.c:112
       #5  0x00005558b84dcbc2 in qemu_chr_write (s=0x5558ba460380, buf=0x5558baf5beb0 "...", len=138, write_all=false) at chardev/char.c:147
       #6  0x00005558b84dfb26 in qemu_chr_fe_write (be=0x5558ba476610, buf=0x5558baf5beb0 "...", len=138) at chardev/char-fe.c:42
       #7  0x00005558b8088c86 in monitor_flush_locked (mon=0x5558ba476610) at monitor.c:406
       #8  0x00005558b8088e8c in monitor_puts (mon=0x5558ba476610, str=0x5558ba921e49 "") at monitor.c:449
       #9  0x00005558b8089178 in qmp_send_response (mon=0x5558ba476610, rsp=0x5558bb161600) at monitor.c:498
       #10 0x00005558b808920c in monitor_qapi_event_emit (event=QAPI_EVENT_SHUTDOWN, qdict=0x5558bb161600) at monitor.c:526
       #11 0x00005558b8089307 in monitor_qapi_event_queue_no_reenter (event=QAPI_EVENT_SHUTDOWN, qdict=0x5558bb161600) at monitor.c:551
       #12 0x00005558b80896c0 in qapi_event_emit (event=QAPI_EVENT_SHUTDOWN, qdict=0x5558bb161600) at monitor.c:626
       #13 0x00005558b855f23b in qapi_event_send_shutdown (guest=false, reason=SHUTDOWN_CAUSE_HOST_QMP_QUIT) at qapi/qapi-events-run-state.c:43
       #14 0x00005558b81911ef in qemu_system_shutdown (cause=SHUTDOWN_CAUSE_HOST_QMP_QUIT) at vl.c:1837
       #15 0x00005558b8191308 in main_loop_should_exit () at vl.c:1885
       #16 0x00005558b819140d in main_loop () at vl.c:1924
       #17 0x00005558b8198c84 in main (argc=18, argv=0x7ffc355df3f8, envp=0x7ffc355df490) at vl.c:4665
      
      This patch adds a lock to protect tcp_chr_disconnect() and
      socket_reconnect_timeout()
      
      Signed-off-by: default avatarAlberto Garcia <berto@igalia.com>
      Signed-off-by: default avatarAndrey Shinkevich <andrey.shinkevich@virtuozzo.com>
      Message-Id: <1565625509-404969-3-git-send-email-andrey.shinkevich@virtuozzo.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      78d01598
  30. Jun 12, 2019
  31. Apr 16, 2019
Loading