1. 09 2月, 2018 2 次提交
  2. 07 2月, 2018 1 次提交
    • A
      tcg: Replace fprintf(stderr, "*\n" with error_report() · 493d89bf
      Alistair Francis 提交于
      Replace a large number of the fprintf(stderr, "*\n" calls with
      error_report(). The functions were renamed with these commands and then
      compiler issues where manually fixed.
      
      find ./* -type f -exec sed -i \
          'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      Signed-off-by: NAlistair Francis <alistair.francis@xilinx.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Peter Crosthwaite <crosthwaite.peter@gmail.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Stefan Weil <sw@weilnetz.de>
      
      Conversions that aren't followed by exit() dropped, because they might
      be inappropriate.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <20180203084315.20497-14-armbru@redhat.com>
      Reviewed-by: NThomas Huth <thuth@redhat.com>
      493d89bf
  3. 26 1月, 2018 1 次提交
    • T
      usb: Remove legacy -usbdevice options (host, serial, disk and net) · 99761176
      Thomas Huth 提交于
      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: NThomas 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: NGerd Hoffmann <kraxel@redhat.com>
      99761176
  4. 25 1月, 2018 1 次提交
    • G
      sdl: reorganize -no-frame support · 04ff1a39
      Gerd Hoffmann 提交于
      Drop no_frame flag from sdl_display_init argument list, use a global
      variable instead.  This is temporary until -no-frame support is dropped
      altogether when we remove sdl1 support.
      
      Remove any traces of noframe from sdl2 code.  It is just dead code as
      sdl2 doesn't support the SDL_NOFRAME window flag any more.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Message-id: 20180115154855.30850-3-kraxel@redhat.com
      04ff1a39
  5. 19 1月, 2018 1 次提交
    • I
      possible_cpus: add CPUArchId::type field · d342eb76
      Igor Mammedov 提交于
      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: NIgor Mammedov <imammedo@redhat.com>
      Reviewed-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Message-Id: <1515597770-268979-1-git-send-email-imammedo@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      d342eb76
  6. 16 1月, 2018 1 次提交
  7. 15 1月, 2018 1 次提交
  8. 22 12月, 2017 1 次提交
  9. 21 12月, 2017 1 次提交
  10. 18 12月, 2017 2 次提交
  11. 14 12月, 2017 1 次提交
  12. 16 11月, 2017 1 次提交
    • D
      NUMA: Enable adding NUMA node implicitly · 7b8be49d
      Dou Liyang 提交于
      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: NThadeu Lima de Souza Cascardo <cascardo@canonical.com>
      Suggested-by: NIgor Mammedov <imammedo@redhat.com>
      Signed-off-by: NDou 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: NIgor Mammedov <imammedo@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      7b8be49d
  13. 13 11月, 2017 1 次提交
  14. 25 10月, 2017 1 次提交
  15. 13 10月, 2017 1 次提交
  16. 10 10月, 2017 2 次提交
  17. 26 9月, 2017 2 次提交
    • G
      Add --firmwarepath to configure · 3d5eecab
      Gerd Hoffmann 提交于
      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: NGerd Hoffmann <kraxel@redhat.com>
      Message-id: 20170914114236.25343-3-kraxel@redhat.com
      3d5eecab
    • G
      add qemu_add_data_dir() · 2a1cce90
      Gerd Hoffmann 提交于
      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: NGerd Hoffmann <kraxel@redhat.com>
      Message-id: 20170914114236.25343-2-kraxel@redhat.com
      2a1cce90
  18. 22 9月, 2017 2 次提交
    • F
      vl: Don't include vde header · 27ad39ba
      Fam Zheng 提交于
      Nothing in vl.c uses anything from the vde package, do remove the
      unnecessary include.
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Message-Id: <20170907083552.17725-2-famz@redhat.com>
      Reviewed-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NFam Zheng <famz@redhat.com>
      27ad39ba
    • P
      scsi, file-posix: add support for persistent reservation management · 7c9e5276
      Paolo Bonzini 提交于
      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: NPaolo Bonzini <pbonzini@redhat.com>
      7c9e5276
  19. 19 9月, 2017 2 次提交
    • I
      vl.c: convert cpu_model to cpu type and set of global properties before machine_init() · 6063d4c0
      Igor Mammedov 提交于
      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: NIgor Mammedov <imammedo@redhat.com>
      Message-Id: <1505318697-77161-4-git-send-email-imammedo@redhat.com>
      Acked-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      6063d4c0
    • E
      vl: Clean up user-creatable objects when exiting · 9d5139e5
      Eduardo Habkost 提交于
      Delete all user-creatable objects in /objects when exiting QEMU, so they
      can perform cleanup actions.
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <20170824192315.5897-2-ehabkost@redhat.com>
      Acked-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Tested-by: NZack Cornelius <zack.cornelius@kove.net>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      9d5139e5
  20. 15 9月, 2017 5 次提交
  21. 06 9月, 2017 1 次提交
  22. 05 9月, 2017 1 次提交
    • G
      virtfs: error out gracefully when mandatory suboptions are missing · 32b69436
      Greg Kurz 提交于
      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: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      Reviewed-by: NThomas Huth <thuth@redhat.com>
      32b69436
  23. 04 9月, 2017 1 次提交
  24. 08 8月, 2017 2 次提交
    • E
      maint: Include bug-reporting info in --help output · f5048cb7
      Eric Blake 提交于
      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: NEric Blake <eblake@redhat.com>
      Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <20170803163353.19558-5-eblake@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      f5048cb7
    • P
      rcu: completely disable pthread_atfork callbacks as soon as possible · 73c6e401
      Paolo Bonzini 提交于
      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: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Tested-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      73c6e401
  25. 01 8月, 2017 2 次提交
  26. 14 7月, 2017 1 次提交
    • E
      vl: fix breakage of -tb-size · f940488f
      Emilio G. Cota 提交于
      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: NEmilio G. Cota <cota@braap.org>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      f940488f
  27. 13 7月, 2017 1 次提交
    • A
      Convert error_report() to warn_report() · 3dc6f869
      Alistair Francis 提交于
      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: NAlistair Francis <alistair.francis@xilinx.com>
      Suggested-by: NThomas 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: NDavid Gibson <david@gibson.dropbear.id.au>
      Acked-by: NGreg Kurz <groug@kaod.org>
      Acked-by: NCornelia Huck <cohuck@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed by: Peter Chubb <peter.chubb@data61.csiro.au>
      Acked-by: NMax Reitz <mreitz@redhat.com>
      Acked-by: NMarcel Apfelbaum <marcel@redhat.com>
      Message-Id: <e1cfa2cd47087c248dd24caca9c33d9af0c499b0.1499866456.git.alistair.francis@xilinx.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      3dc6f869
  28. 11 7月, 2017 1 次提交