1. 20 2月, 2018 3 次提交
  2. 17 2月, 2018 1 次提交
  3. 15 2月, 2018 1 次提交
    • S
      vl: pause vcpus before stopping iothreads · 00d09fdb
      Stefan Hajnoczi 提交于
      Commit dce8921b ("iothread: Stop threads
      before main() quits") introduced iothread_stop_all() to avoid the
      following virtio-scsi assertion failure:
      
        assert(blk_get_aio_context(d->conf.blk) == s->ctx);
      
      Back then the assertion failed because when bdrv_close_all() made
      d->conf.blk NULL, blk_get_aio_context() returned the global AioContext
      instead of s->ctx.
      
      The same assertion can still fail today when vcpus submit new I/O
      requests after iothread_stop_all() has moved the BDS to the global
      AioContext.
      
      This patch hardens the iothread_stop_all() approach by pausing vcpus
      before calling iothread_stop_all().
      
      Note that the assertion failure is a race condition.  It is not possible
      to reproduce it reliably.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Message-id: 20180201110708.8080-1-stefanha@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      00d09fdb
  4. 09 2月, 2018 3 次提交
  5. 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
  6. 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
  7. 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
  8. 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
  9. 16 1月, 2018 1 次提交
  10. 15 1月, 2018 1 次提交
  11. 22 12月, 2017 1 次提交
  12. 21 12月, 2017 1 次提交
  13. 18 12月, 2017 2 次提交
  14. 14 12月, 2017 1 次提交
  15. 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
  16. 13 11月, 2017 1 次提交
  17. 25 10月, 2017 1 次提交
  18. 13 10月, 2017 1 次提交
  19. 10 10月, 2017 2 次提交
  20. 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
  21. 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
  22. 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
  23. 15 9月, 2017 5 次提交
  24. 06 9月, 2017 1 次提交
  25. 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
  26. 04 9月, 2017 1 次提交
  27. 08 8月, 2017 1 次提交
    • 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