Skip to content
Snippets Groups Projects
  1. Sep 08, 2023
  2. Sep 07, 2023
  3. Aug 07, 2023
  4. Jun 27, 2023
  5. Jun 20, 2023
  6. Jun 05, 2023
  7. Apr 20, 2023
    • Peter Maydell's avatar
      chardev: Allow setting file chardev input file on the command line · 5b18a6bf
      Peter Maydell authored
      
      Our 'file' chardev backend supports both "output from this chardev
      is written to a file" and "input from this chardev should be read
      from a file" (except on Windows). However, you can only set up
      the input file if you're using the QMP interface -- there is no
      command line syntax to do it.
      
      Add command line syntax to allow specifying an input file
      as well as an output file, using a new 'input-path' suboption.
      
      The specific use case I have is that I'd like to be able to
      feed fuzzer reproducer input into qtest without having to use
      '-qtest stdio' and put the input onto stdin. Being able to
      use a file chardev like this:
       -chardev file,id=repro,path=/dev/null,input-path=repro.txt -qtest chardev:repro
      means that stdio is free for use by gdb.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Message-Id: <20230413150724.404304-3-peter.maydell@linaro.org>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      [thuth: Replace "input-file=" typo with "input-path="]
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      5b18a6bf
  8. Mar 20, 2023
  9. Mar 13, 2023
  10. 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
  11. Feb 06, 2023
  12. Feb 04, 2023
  13. Jan 19, 2023
  14. Jan 11, 2023
  15. Jan 09, 2023
  16. Jan 05, 2023
  17. Dec 14, 2022
  18. Nov 21, 2022
  19. Sep 29, 2022
  20. Sep 22, 2022
  21. Sep 02, 2022
  22. May 16, 2022
    • Leonardo Bras's avatar
      QIOChannel: Add flags on io_writev and introduce io_flush callback · b88651cb
      Leonardo Bras authored
      
      Add flags to io_writev and introduce io_flush as optional callback to
      QIOChannelClass, allowing the implementation of zero copy writes by
      subclasses.
      
      How to use them:
      - Write data using qio_channel_writev*(...,QIO_CHANNEL_WRITE_FLAG_ZERO_COPY),
      - Wait write completion with qio_channel_flush().
      
      Notes:
      As some zero copy write implementations work asynchronously, it's
      recommended to keep the write buffer untouched until the return of
      qio_channel_flush(), to avoid the risk of sending an updated buffer
      instead of the buffer state during write.
      
      As io_flush callback is optional, if a subclass does not implement it, then:
      - io_flush will return 0 without changing anything.
      
      Also, some functions like qio_channel_writev_full_all() were adapted to
      receive a flag parameter. That allows shared code between zero copy and
      non-zero copy writev, and also an easier implementation on new flags.
      
      Signed-off-by: default avatarLeonardo Bras <leobras@redhat.com>
      Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      Reviewed-by: default avatarPeter Xu <peterx@redhat.com>
      Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
      Message-Id: <20220513062836.965425-3-leobras@redhat.com>
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      b88651cb
  23. May 11, 2022
  24. May 03, 2022
  25. Apr 06, 2022
  26. Jan 07, 2022
  27. Dec 21, 2021
  28. Nov 19, 2021
Loading