Skip to content
Snippets Groups Projects
  1. May 12, 2021
  2. May 02, 2021
  3. Apr 01, 2021
  4. Mar 24, 2021
  5. Mar 23, 2021
  6. Mar 19, 2021
    • Markus Armbruster's avatar
      qemu-options: New -compat to set policy for deprecated interfaces · 6dd75472
      Markus Armbruster authored
      
      New option -compat lets you configure what to do when deprecated
      interfaces get used.  This is intended for testing users of the
      management interfaces.  It is experimental.
      
      -compat deprecated-input=<input-policy> configures what to do when
      deprecated input is received.  Input policy can be "accept" (accept
      silently), or "reject" (reject the request with an error).
      
      -compat deprecated-output=<out-policy> configures what to do when
      deprecated output is sent.  Output policy can be "accept" (pass on
      unchanged), or "hide" (filter out the deprecated parts).
      
      Default is "accept".  Policies other than "accept" are implemented
      later in this series.
      
      For now, -compat covers only syntactic aspects of QMP, i.e. stuff
      tagged with feature 'deprecated'.  We may want to extend it to cover
      semantic aspects, CLI, and experimental features.
      
      Note that there is no good way for management application to detect
      presence of -compat: it's not visible output of query-qmp-schema or
      query-command-line-options.  Tolerable, because it's meant for
      testing.  If running with -compat fails, skip the test.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Message-Id: <20210318155519.1224118-3-armbru@redhat.com>
      6dd75472
    • Markus Armbruster's avatar
      hw: Replace anti-social QOM type names · e178113f
      Markus Armbruster authored
      
      Several QOM type names contain ',':
      
          ARM,bitband-memory
          etraxfs,pic
          etraxfs,serial
          etraxfs,timer
          fsl,imx25
          fsl,imx31
          fsl,imx6
          fsl,imx6ul
          fsl,imx7
          grlib,ahbpnp
          grlib,apbpnp
          grlib,apbuart
          grlib,gptimer
          grlib,irqmp
          qemu,register
          SUNW,bpp
          SUNW,CS4231
          SUNW,DBRI
          SUNW,DBRI.prom
          SUNW,fdtwo
          SUNW,sx
          SUNW,tcx
          xilinx,zynq_slcr
          xlnx,zynqmp
          xlnx,zynqmp-pmu-soc
          xlnx,zynq-xadc
      
      These are all device types.  They can't be plugged with -device /
      device_add, except for xlnx,zynqmp-pmu-soc, and I doubt that one
      actually works.
      
      They *can* be used with -device / device_add to request help.
      Usability is poor, though: you have to double the comma, like this:
      
          $ qemu-system-x86_64 -device SUNW,,fdtwo,help
      
      Trap for the unwary.  The fact that this was broken in
      device-introspect-test for more than six years until commit e27bd498
      fixed it demonstrates that "the unwary" includes seasoned developers.
      
      One QOM type name contains ' ': "ICH9 SMB".  Because having to
      remember just one way to quote would be too easy.
      
      Rename the "SUNW,FOO types to "sun-FOO".  Summarily replace ',' and '
      ' by '-' in the other type names.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20210304140229.575481-2-armbru@redhat.com>
      Reviewed-by: default avatarMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Acked-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      e178113f
    • Markus Armbruster's avatar
      blockdev: Drop deprecated bogus -drive interface type · fe9f70a1
      Markus Armbruster authored
      
      Drop the crap deprecated in commit a1b40bda "blockdev: Deprecate
      -drive with bogus interface type" (v5.1.0).
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      Reviewed-by: default avatarJohn Snow <jsnow@redhat.com>
      Message-id: 20210309161214.1402527-5-armbru@redhat.com
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      fe9f70a1
    • Paolo Bonzini's avatar
      vl: allow passing JSON to -object · 009ff893
      Paolo Bonzini authored
      
      Extend the ObjectOption code that was added in the previous patch to
      enable passing JSON to -object.  Even though we cannot yet add
      non-scalar properties with the human-friendly comma-separated syntax,
      they can now be added as JSON.
      
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarKevin Wolf <kwolf@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20210312173547.1283477-4-pbonzini@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      009ff893
    • Paolo Bonzini's avatar
      qom: move user_creatable_add_opts logic to vl.c and QAPIfy it · bc2f4fcb
      Paolo Bonzini authored
      
      Emulators are currently using OptsVisitor (via user_creatable_add_opts)
      to parse the -object command line option.  This has one extra feature,
      compared to keyval, which is automatic conversion of integers to lists
      as well as support for lists as repeated options:
      
        -object memory-backend-ram,id=pc.ram,size=1048576000,host-nodes=0,policy=bind
      
      So we cannot replace OptsVisitor with keyval right now.  Still, this
      patch moves the user_creatable_add_opts logic to vl.c since it is
      not needed anywhere else, and makes it go through user_creatable_add_qapi.
      
      In order to minimize code changes, the predicate still takes a string.
      This can be changed later to use the ObjectType QAPI enum directly.
      
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20210312173547.1283477-3-pbonzini@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      bc2f4fcb
  7. Mar 18, 2021
  8. Mar 16, 2021
    • Alexander Bulekov's avatar
      fuzz: move some DMA hooks · 7cac7fea
      Alexander Bulekov authored
      
      For the sparse-mem device, we want the fuzzer to populate entire DMA
      reads from sparse-mem, rather than hooking into the individual MMIO
      memory_region_dispatch_read operations. Otherwise, the fuzzer will treat
      each sequential read separately (and populate it with a separate
      pattern). Work around this by rearranging some DMA hooks. Since the
      fuzzer has it's own logic to skip accidentally writing to MMIO regions,
      we can call the DMA cb, outside the flatview_translate loop.
      
      Signed-off-by: default avatarAlexander Bulekov <alxndr@bu.edu>
      Reviewed-by: default avatarDarren Kenny <darren.kenny@oracle.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      7cac7fea
  9. Mar 15, 2021
    • Thomas Huth's avatar
      usb: Un-deprecate -usbdevice (except for -usbdevice audio which gets removed) · 6db34277
      Thomas Huth authored
      
      When trying to remove the -usbdevice option, there were complaints that
      "-usbdevice braille" is still a very useful shortcut for some people.
      Thus we never remove this option. Since it's not such a big burden to
      keep it around, and it's also convenient in the sense that you don't
      have to worry to enable a host controller explicitly with this option,
      we should remove it from he deprecation list again.
      
      However, there is one exception: "-usbdevice audio" should go away, since
      audio devices without "audiodev=..." parameter are also on the deprecation
      list and you cannot use "-usbdevice audio" with "audiodev".
      
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      Message-Id: <20210310173323.1422754-4-thuth@redhat.com>
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      6db34277
    • David Hildenbrand's avatar
      exec: Get rid of phys_mem_set_alloc() · 25459eb7
      David Hildenbrand authored
      
      As the last user is gone, we can get rid of phys_mem_set_alloc() and
      simplify.
      
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Halil Pasic <pasic@linux.ibm.com>
      Cc: Cornelia Huck <cohuck@redhat.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Thomas Huth <thuth@redhat.com>
      Cc: Igor Mammedov <imammedo@redhat.com>
      Cc: Peter Xu <peterx@redhat.com>
      Signed-off-by: default avatarDavid Hildenbrand <david@redhat.com>
      Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
      Reviewed-by: default avatarIgor Mammedov <imammedo@redhat.com>
      Message-Id: <20210303130916.22553-3-david@redhat.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      25459eb7
  10. Mar 12, 2021
    • Eric Auger's avatar
      dma: Introduce dma_aligned_pow2_mask() · f14fb6c2
      Eric Auger authored
      
      Currently get_naturally_aligned_size() is used by the intel iommu
      to compute the maximum invalidation range based on @size which is
      a power of 2 while being aligned with the @start address and less
      than the maximum range defined by @gaw.
      
      This helper is also useful for other iommu devices (virtio-iommu,
      SMMUv3) to make sure IOMMU UNMAP notifiers only are called with
      power of 2 range sizes.
      
      Let's move this latter into dma-helpers.c and rename it into
      dma_aligned_pow2_mask(). Also rewrite the helper so that it
      accomodates UINT64_MAX values for the size mask and max mask.
      It now returns a mask instead of a size. Change the caller.
      
      Signed-off-by: default avatarEric Auger <eric.auger@redhat.com>
      Reviewed-by: default avatarPeter Xu <peterx@redhat.com>
      Message-id: 20210309102742.30442-3-eric.auger@redhat.com
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      f14fb6c2
  11. Mar 10, 2021
  12. Mar 09, 2021
  13. Mar 06, 2021
    • Alex Bennée's avatar
      accel/tcg: move CF_CLUSTER calculation to curr_cflags · c0ae396a
      Alex Bennée authored
      
      There is nothing special about this compile flag that doesn't mean we
      can't just compute it with curr_cflags() which we should be using when
      building a new set.
      
      Signed-off-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Message-Id: <20210224165811.11567-3-alex.bennee@linaro.org>
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      c0ae396a
    • Paolo Bonzini's avatar
      trace: skip qemu_set_log_filename if no "-D" option was passed · 7520c4f0
      Paolo Bonzini authored
      
      When the "simple" backend is not active but the "log" backend is,
      both "-trace file=" and "-D" will result in a call to
      qemu_set_log_filename.  Unfortunately, QEMU was also calling
      qemu_set_log_filename if "-D" was not passed, so the "-trace
      file=" option had no effect and the tracepoints went back to
      stderr.
      
      Fortunately we can just skip qemu_set_log_filename in that case,
      because the log backend will initialize itself just fine as soon
      as qemu_set_log is called, also in qemu_process_early_options.
      
      Cc: stefanha@redhat.com
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20210209145759.141231-3-pbonzini@redhat.com>
      7520c4f0
    • Paolo Bonzini's avatar
      qemu-config: add error propagation to qemu_config_parse · f7544edc
      Paolo Bonzini authored
      
      This enables some simplification of vl.c via error_fatal, and improves
      error messages.  Before:
      
        $ ./qemu-system-x86_64 -readconfig .
        qemu-system-x86_64: error reading file
        qemu-system-x86_64: -readconfig .: read config .: Invalid argument
        $ /usr/libexec/qemu-kvm -readconfig foo
        qemu-kvm: -readconfig foo: read config foo: No such file or directory
      
      After:
      
        $ ./qemu-system-x86_64 -readconfig .
        qemu-system-x86_64: -readconfig .: Cannot read config file: Is a directory
        $ ./qemu-system-x86_64 -readconfig foo
        qemu-system-x86_64: -readconfig foo: Could not open 'foo': No such file or directory
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20210226170816.231173-1-pbonzini@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      f7544edc
    • Daniel Henrique Barboza's avatar
      vl.c: do not execute trace_init_backends() before daemonizing · 10b6ee16
      Daniel Henrique Barboza authored
      
      Commit v5.2.0-190-g0546c0609c ("vl: split various early command line
      options to a separate function") moved the trace backend init code to
      the qemu_process_early_options(). Which is now being called before
      os_daemonize() via qemu_maybe_daemonize().
      
      Turns out that this change of order causes a problem when executing
      QEMU in daemon mode and with CONFIG_TRACE_SIMPLE. The trace thread
      is now being created by the parent, and the parent is left waiting for
      a trace file flush that was registered via st_init(). The result is
      that the parent process never exits.
      
      To reproduce, fire up a QEMU process with -daemonize and with
      CONFIG_TRACE_SIMPLE enabled. Two QEMU process will be left in the
      host:
      
      $ sudo ./x86_64-softmmu/qemu-system-x86_64 -S -no-user-config -nodefaults \
        -nographic -machine none,accel=kvm:tcg -daemonize
      
      $ ps axf | grep qemu
       529710 pts/3    S+     0:00  |       \_ grep --color=auto qemu
       529697 ?        Ssl    0:00  \_ ./x86_64-softmmu/qemu-system-x86_64 -S -no-user-config -nodefaults -nographic -machine none,accel=kvm:tcg -daemonize
       529699 ?        Sl     0:00      \_ ./x86_64-softmmu/qemu-system-x86_64 -S -no-user-config -nodefaults -nographic -machine none,accel=kvm:tcg -daemonize
      
      The parent thread is hang in flush_trace_file:
      
      $ sudo gdb ./x86_64-softmmu/qemu-system-x86_64 529697
      (..)
      (gdb) bt
       #0  0x00007f9dac6a137d in syscall () at /lib64/libc.so.6
       #1  0x00007f9dacc3c4f3 in g_cond_wait () at /lib64/libglib-2.0.so.0
       #2  0x0000555d12f952da in flush_trace_file (wait=true) at ../trace/simple.c:140
       #3  0x0000555d12f95b4c in st_flush_trace_buffer () at ../trace/simple.c:383
       #4  0x00007f9dac5e43a7 in __run_exit_handlers () at /lib64/libc.so.6
       #5  0x00007f9dac5e4550 in on_exit () at /lib64/libc.so.6
       #6  0x0000555d12d454de in os_daemonize () at ../os-posix.c:255
       #7  0x0000555d12d0bd5c in qemu_maybe_daemonize (pid_file=0x0) at ../softmmu/vl.c:2408
       #8  0x0000555d12d0e566 in qemu_init (argc=8, argv=0x7fffc594d9b8, envp=0x7fffc594da00) at ../softmmu/vl.c:3459
       #9  0x0000555d128edac1 in main (argc=8, argv=0x7fffc594d9b8, envp=0x7fffc594da00) at ../softmmu/main.c:49
      (gdb)
      
      Aside from the 'zombie' process in the host, this is directly impacting
      Libvirt. Libvirt waits for the parent process to exit to be sure that the
      QMP monitor is available in the daemonized process to fetch QEMU
      capabilities, and as is now Libvirt hangs at daemon start waiting
      for the parent thread to exit.
      
      The fix is simple: just move the trace backend related code back to
      be executed after daemonizing.
      
      Fixes: 0546c060
      Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarDaniel Henrique Barboza <danielhb413@gmail.com>
      Message-Id: <20210105181437.538366-2-danielhb413@gmail.com>
      Acked-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      10b6ee16
  14. Feb 25, 2021
    • Paolo Bonzini's avatar
      vl: deprecate -writeconfig · b979c931
      Paolo Bonzini authored
      
      The functionality of -writeconfig is limited and the code
      does not even try to detect cases where it prints incorrect
      syntax (for example if values have a quote in them, since
      qemu_config_parse does not support any kind of escaping)
      so remove it.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      b979c931
  15. Feb 16, 2021
  16. Feb 09, 2021
  17. Feb 08, 2021
Loading