1. 26 Jan, 2018 1 commit
    • Thomas Huth's avatar
      usb: Remove legacy -usbdevice options (host, serial, disk and net) · 99761176
      Thomas Huth authored
      The option have been marked as deprecated since QEMU 2.10, and so far
      nobody complained that the host, serial, disk and net options are urgently
      required anymore. So let's now get rid at least of this legacy pile, to
      simplify the usb code quite a bit.
      
      This patch removes the usbdevices host, serial, disk and net. These devices
      use their own complicated parameter parsing mechanisms, so they are just
      ugly to maintain, without real benefit for the users (the users can use the
      corresponding "-device" parameters instead which have the same complexity
      as the "-usbdevice" devices here).
      
      Note that the other rather simple -usbdevice options (mouse, tablet, etc.)
      are not removed yet (the code is really simple here, so it does not hurt
      much to keep it), as well as the two devices "braille" and "bt" which are
      easier to use with -usbdevice than with -device.
      Signed-off-by: 's avatarThomas Huth <thuth@redhat.com>
      Message-id: 1515519171-20315-1-git-send-email-thuth@redhat.com
      
      [kraxel] delete some usb_host_device_open() leftovers.
      Signed-off-by: 's avatarGerd Hoffmann <kraxel@redhat.com>
      99761176
  2. 19 Jan, 2018 1 commit
    • Igor Mammedov's avatar
      possible_cpus: add CPUArchId::type field · d342eb76
      Igor Mammedov authored
      Remove dependency of possible_cpus on 1st CPU instance,
      which decouples configuration data from CPU instances that
      are created using that data.
      
      Also later it would be used for enabling early cpu to numa node
      configuration at runtime qmp_query_hotpluggable_cpus() should
      provide a list of available cpu slots at early stage,
      before machine_init() is called and the 1st cpu is created,
      so that mgmt might be able to call it and use output to set
      numa mapping.
      
      Use MachineClass::possible_cpu_arch_ids() callback to set
      cpu type info, along with the rest of possible cpu properties,
      to let machine define which cpu type* will be used.
      
      * for SPAPR it will be a spapr core type and for ARM/s390x/x86
        a respective descendant of CPUClass.
      
      Move parse_numa_opts() in vl.c after cpu_model is parsed into
      cpu_type so that possible_cpu_arch_ids() would know which
      cpu_type to use during layout initialization.
      Signed-off-by: 's avatarIgor Mammedov <imammedo@redhat.com>
      Reviewed-by: 's avatarDavid Gibson <david@gibson.dropbear.id.au>
      Message-Id: <1515597770-268979-1-git-send-email-imammedo@redhat.com>
      Signed-off-by: 's avatarEduardo Habkost <ehabkost@redhat.com>
      d342eb76
  3. 16 Jan, 2018 1 commit
  4. 15 Jan, 2018 1 commit
  5. 22 Dec, 2017 1 commit
  6. 21 Dec, 2017 1 commit
  7. 18 Dec, 2017 2 commits
  8. 14 Dec, 2017 1 commit
  9. 16 Nov, 2017 1 commit
    • Dou Liyang's avatar
      NUMA: Enable adding NUMA node implicitly · 7b8be49d
      Dou Liyang authored
      Linux and Windows need ACPI SRAT table to make memory hotplug work properly,
      however currently QEMU doesn't create SRAT table if numa options aren't present
      on CLI.
      
      Which breaks both linux and windows guests in certain conditions:
       * Windows: won't enable memory hotplug without SRAT table at all
       * Linux: if QEMU is started with initial memory all below 4Gb and no SRAT table
         present, guest kernel will use nommu DMA ops, which breaks 32bit hw drivers
         when memory is hotplugged and guest tries to use it with that drivers.
      
      Fix above issues by automatically creating a numa node when QEMU is started with
      memory hotplug enabled but without '-numa' options on CLI.
      (PS: auto-create numa node only for new machine types so not to break migration).
      
      Which would provide SRAT table to guests without explicit -numa options on CLI
      and would allow:
       * Windows: to enable memory hotplug
       * Linux: switch to SWIOTLB DMA ops, to bounce DMA transfers to 32bit allocated
         buffers that legacy drivers/hw can handle.
      
      [Rewritten by Igor]
      Reported-by: 's avatarThadeu Lima de Souza Cascardo <cascardo@canonical.com>
      Suggested-by: 's avatarIgor Mammedov <imammedo@redhat.com>
      Signed-off-by: 's avatarDou Liyang <douly.fnst@cn.fujitsu.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Marcel Apfelbaum <marcel@redhat.com>
      Cc: Igor Mammedov <imammedo@redhat.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: Thomas Huth <thuth@redhat.com>
      Cc: Alistair Francis <alistair23@gmail.com>
      Cc: Takao Indoh <indou.takao@jp.fujitsu.com>
      Cc: Izumi Taku <izumi.taku@jp.fujitsu.com>
      Reviewed-by: 's avatarIgor Mammedov <imammedo@redhat.com>
      Reviewed-by: 's avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: 's avatarMichael S. Tsirkin <mst@redhat.com>
      7b8be49d
  10. 13 Nov, 2017 1 commit
  11. 25 Oct, 2017 1 commit
  12. 13 Oct, 2017 1 commit
  13. 10 Oct, 2017 2 commits
  14. 26 Sep, 2017 2 commits
    • Gerd Hoffmann's avatar
      Add --firmwarepath to configure · 3d5eecab
      Gerd Hoffmann authored
      Add a firmware path config option to configure.  Multiple directories
      are accepted, with the usual colon as separator.  Default value is
      ${prefix}/share/qemu-firmware.  The path is searched in addition to the
      current search path (typically ${prefix}/share/qemu).
      
      This prepares qemu for the planned split of the prebuilt firmware blobs
      into a separate project.
      
      Distributions can also use this to get rid of the firmware symlink farm
      and add -- for example -- /usr/share/seabios to the firmware path
      instead.
      Signed-off-by: 's avatarGerd Hoffmann <kraxel@redhat.com>
      Message-id: 20170914114236.25343-3-kraxel@redhat.com
      3d5eecab
    • Gerd Hoffmann's avatar
      add qemu_add_data_dir() · 2a1cce90
      Gerd Hoffmann authored
      Add helper function to add a directory to the qemu search path, so we
      don't duplicate the checks.  Add a check for duplicate entries, so we
      stop trying to open files twice.
      Signed-off-by: 's avatarGerd Hoffmann <kraxel@redhat.com>
      Message-id: 20170914114236.25343-2-kraxel@redhat.com
      2a1cce90
  15. 22 Sep, 2017 1 commit
  16. 21 Sep, 2017 1 commit
    • Paolo Bonzini's avatar
      scsi, file-posix: add support for persistent reservation management · 7c9e5276
      Paolo Bonzini authored
      It is a common requirement for virtual machine to send persistent
      reservations, but this currently requires either running QEMU with
      CAP_SYS_RAWIO, or using out-of-tree patches that let an unprivileged
      QEMU bypass Linux's filter on SG_IO commands.
      
      As an alternative mechanism, the next patches will introduce a
      privileged helper to run persistent reservation commands without
      expanding QEMU's attack surface unnecessarily.
      
      The helper is invoked through a "pr-manager" QOM object, to which
      file-posix.c passes SG_IO requests for PERSISTENT RESERVE OUT and
      PERSISTENT RESERVE IN commands.  For example:
      
        $ qemu-system-x86_64
            -device virtio-scsi \
            -object pr-manager-helper,id=helper0,path=/var/run/qemu-pr-helper.sock
            -drive if=none,id=hd,driver=raw,file.filename=/dev/sdb,file.pr-manager=helper0
            -device scsi-block,drive=hd
      
      or:
      
        $ qemu-system-x86_64
            -device virtio-scsi \
            -object pr-manager-helper,id=helper0,path=/var/run/qemu-pr-helper.sock
            -blockdev node-name=hd,driver=raw,file.driver=host_device,file.filename=/dev/sdb,file.pr-manager=helper0
            -device scsi-block,drive=hd
      
      Multiple pr-manager implementations are conceivable and possible, though
      only one is implemented right now.  For example, a pr-manager could:
      
      - talk directly to the multipath daemon from a privileged QEMU
        (i.e. QEMU links to libmpathpersist); this makes reservation work
        properly with multipath, but still requires CAP_SYS_RAWIO
      
      - use the Linux IOC_PR_* ioctls (they require CAP_SYS_ADMIN though)
      
      - more interestingly, implement reservations directly in QEMU
        through file system locks or a shared database (e.g. sqlite)
      Signed-off-by: 's avatarPaolo Bonzini <pbonzini@redhat.com>
      7c9e5276
  17. 19 Sep, 2017 2 commits
    • Igor Mammedov's avatar
      vl.c: convert cpu_model to cpu type and set of global properties before machine_init() · 6063d4c0
      Igor Mammedov authored
      All machines that support user specified cpu_model either call
      cpu_generic_init() or cpu_class_by_name()/CPUClass::parse_features
      to parse feature string and to get CPU type to create.
      
      Which leads to code duplication and hard-codding default CPU model
      within machine_foo_init() code. Which makes it impossible to
      get CPU type before machine_init() is run.
      
      So instead of setting default CPUs models and doing parsing in
      target specific machine_foo_init() in various ways, provide
      a generic data driven cpu_model parsing before machine_init()
      is called.
      
      in follow up per target patches, it will allow to:
        * define default CPU type in consistent/generic manner
          per machine type and drop custom code that fallbacks
          to default if cpu_model is NULL
        * drop custom features parsing in targets and do it
          in centralized way.
        * for cases of
            cpu_generic_init(TYPE_BASE/DEFAULT_CPU, "some_cpu")
          replace it with
            cpu_create(machine->cpu_type) || cpu_create(TYPE_FOO)
          depending if CPU type is user settable or not.
          not doing useless parsing and clearly documenting where
          CPU model is user settable or fixed one.
      
      Patch allows machine subclasses to define default CPU type
      per machine class at class_init() time and if that is set
      generic code will parse cpu_model into a MachineState::cpu_type
      which will be used to create CPUs for that machine instance
      and allows gradual per board conversion.
      Signed-off-by: 's avatarIgor Mammedov <imammedo@redhat.com>
      Message-Id: <1505318697-77161-4-git-send-email-imammedo@redhat.com>
      Acked-by: 's avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Signed-off-by: 's avatarEduardo Habkost <ehabkost@redhat.com>
      6063d4c0
    • Eduardo Habkost's avatar
      vl: Clean up user-creatable objects when exiting · 9d5139e5
      Eduardo Habkost authored
      Delete all user-creatable objects in /objects when exiting QEMU, so they
      can perform cleanup actions.
      Signed-off-by: 's avatarEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <20170824192315.5897-2-ehabkost@redhat.com>
      Acked-by: 's avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Tested-by: 's avatarZack Cornelius <zack.cornelius@kove.net>
      Signed-off-by: 's avatarEduardo Habkost <ehabkost@redhat.com>
      9d5139e5
  18. 15 Sep, 2017 5 commits
  19. 06 Sep, 2017 1 commit
  20. 05 Sep, 2017 1 commit
    • Greg Kurz's avatar
      virtfs: error out gracefully when mandatory suboptions are missing · 32b69436
      Greg Kurz authored
      We internally convert -virtfs to -fsdev/-device. If the user doesn't
      provide the path or security_model suboptions, and the fsdev backend
      requires them, we hit an assertion when populating the internal -fsdev
      option:
      
      util/qemu-option.c:547: opt_set: Assertion `opt->str' failed.
      Aborted (core dumped)
      
      Let's test the suboption presence on the command line before trying
      to set it in the internal -fsdev option, and let the backend code
      error out gracefully (ie, like it already does when the user passes
      -fsdev on the command line).
      Reported-by: 's avatarThomas Huth <thuth@redhat.com>
      Signed-off-by: 's avatarGreg Kurz <groug@kaod.org>
      Reviewed-by: 's avatarThomas Huth <thuth@redhat.com>
      32b69436
  21. 04 Sep, 2017 1 commit
  22. 08 Aug, 2017 2 commits
    • Eric Blake's avatar
      maint: Include bug-reporting info in --help output · f5048cb7
      Eric Blake authored
      These days, many programs are including a bug-reporting address,
      or better yet, a link to the project web site, at the tail of
      their --help output.  However, we were not very consistent at
      doing so: only qemu-nbd and qemu-qa mentioned anything, with the
      latter pointing to an individual person instead of the project.
      
      Add a new #define that sets up a uniform string, mentioning both
      bug reporting instructions and overall project details, and which
      a downstream vendor could tweak if they want bugs to go to a
      downstream database.  Then use it in all of our binaries which
      have --help output.
      
      The canned text intentionally references http:// instead of https://
      because our https website currently causes certificate errors in
      some browsers.  That can be tweaked later once we have resolved the
      web site issued.
      Signed-off-by: 's avatarEric Blake <eblake@redhat.com>
      Reviewed-by: 's avatarDaniel P. Berrange <berrange@redhat.com>
      Reviewed-by: 's avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <20170803163353.19558-5-eblake@redhat.com>
      Signed-off-by: 's avatarPaolo Bonzini <pbonzini@redhat.com>
      f5048cb7
    • Paolo Bonzini's avatar
      rcu: completely disable pthread_atfork callbacks as soon as possible · 73c6e401
      Paolo Bonzini authored
      Because of -daemonize, system mode QEMU sometimes needs to fork() and
      keep RCU enabled in the child.  However, there is a possible deadlock
      with synchronize_rcu:
      
      - the CPU thread is inside a RCU critical section and wants to take
        the BQL in order to do MMIO
      
      - the monitor thread, which is owning the BQL, calls rcu_init_lock
        which tries to take the rcu_sync_lock
      
      - the call_rcu thread has taken rcu_sync_lock in synchronize_rcu, but
        synchronize_rcu needs the CPU thread to end the critical section
        before returning.
      
      This cannot happen for user-mode emulation, because it does not have
      a BQL.
      
      To fix it, assume that system mode QEMU only forks in preparation for
      exec (except when daemonizing) and disable pthread_atfork as soon as
      the double fork has happened.
      Reported-by: 's avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Tested-by: 's avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: 's avatarPaolo Bonzini <pbonzini@redhat.com>
      73c6e401
  23. 01 Aug, 2017 2 commits
  24. 14 Jul, 2017 1 commit
    • Emilio G. Cota's avatar
      vl: fix breakage of -tb-size · f940488f
      Emilio G. Cota authored
      Commit e7b161d5 ("vl: add tcg_enabled() for tcg related code") adds
      a check to exit the program when !tcg_enabled() while parsing the -tb-size
      flag.
      
      It turns out that when the -tb-size flag is evaluated, tcg_enabled() can
      only return 0, since it is set (or not) much later by configure_accelerator().
      
      Fix it by unconditionally exiting if the flag is passed to a QEMU binary
      built with !CONFIG_TCG.
      Signed-off-by: 's avatarEmilio G. Cota <cota@braap.org>
      Signed-off-by: 's avatarPaolo Bonzini <pbonzini@redhat.com>
      f940488f
  25. 13 Jul, 2017 1 commit
    • Alistair Francis's avatar
      Convert error_report() to warn_report() · 3dc6f869
      Alistair Francis authored
      Convert all uses of error_report("warning:"... to use warn_report()
      instead. This helps standardise on a single method of printing warnings
      to the user.
      
      All of the warnings were changed using these two commands:
          find ./* -type f -exec sed -i \
            's|error_report(".*warning[,:] |warn_report("|Ig' {} +
      
      Indentation fixed up manually afterwards.
      
      The test-qdev-global-props test case was manually updated to ensure that
      this patch passes make check (as the test cases are case sensitive).
      Signed-off-by: 's avatarAlistair Francis <alistair.francis@xilinx.com>
      Suggested-by: 's avatarThomas Huth <thuth@redhat.com>
      Cc: Jeff Cody <jcody@redhat.com>
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Max Reitz <mreitz@redhat.com>
      Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Peter Lieven <pl@kamp.de>
      Cc: Josh Durgin <jdurgin@redhat.com>
      Cc: "Richard W.M. Jones" <rjones@redhat.com>
      Cc: Markus Armbruster <armbru@redhat.com>
      Cc: Peter Crosthwaite <crosthwaite.peter@gmail.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
      Cc: Greg Kurz <groug@kaod.org>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: Peter Chubb <peter.chubb@nicta.com.au>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: Marcel Apfelbaum <marcel@redhat.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Igor Mammedov <imammedo@redhat.com>
      Cc: David Gibson <david@gibson.dropbear.id.au>
      Cc: Alexander Graf <agraf@suse.de>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Cornelia Huck <cohuck@redhat.com>
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Acked-by: 's avatarDavid Gibson <david@gibson.dropbear.id.au>
      Acked-by: 's avatarGreg Kurz <groug@kaod.org>
      Acked-by: 's avatarCornelia Huck <cohuck@redhat.com>
      Reviewed-by: 's avatarStefan Hajnoczi <stefanha@redhat.com>
      Reviewed by: Peter Chubb <peter.chubb@data61.csiro.au>
      Acked-by: 's avatarMax Reitz <mreitz@redhat.com>
      Acked-by: 's avatarMarcel Apfelbaum <marcel@redhat.com>
      Message-Id: <e1cfa2cd47087c248dd24caca9c33d9af0c499b0.1499866456.git.alistair.francis@xilinx.com>
      Reviewed-by: 's avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: 's avatarMarkus Armbruster <armbru@redhat.com>
      3dc6f869
  26. 10 Jul, 2017 2 commits
  27. 04 Jul, 2017 2 commits
  28. 28 Jun, 2017 1 commit