Skip to content
Snippets Groups Projects
  1. Aug 16, 2019
    • Markus Armbruster's avatar
      sysemu: Split sysemu/runstate.h off sysemu/sysemu.h · 54d31236
      Markus Armbruster authored
      
      sysemu/sysemu.h is a rather unfocused dumping ground for stuff related
      to the system-emulator.  Evidence:
      
      * It's included widely: in my "build everything" tree, changing
        sysemu/sysemu.h still triggers a recompile of some 1100 out of 6600
        objects (not counting tests and objects that don't depend on
        qemu/osdep.h, down from 5400 due to the previous two commits).
      
      * It pulls in more than a dozen additional headers.
      
      Split stuff related to run state management into its own header
      sysemu/runstate.h.
      
      Touching sysemu/sysemu.h now recompiles some 850 objects.  qemu/uuid.h
      also drops from 1100 to 850, and qapi/qapi-types-run-state.h from 4400
      to 4200.  Touching new sysemu/runstate.h recompiles some 500 objects.
      
      Since I'm touching MAINTAINERS to add sysemu/runstate.h anyway, also
      add qemu/main-loop.h.
      
      Suggested-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190812052359.30071-30-armbru@redhat.com>
      Reviewed-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      [Unbreak OS-X build]
      54d31236
    • Markus Armbruster's avatar
      Include qemu/main-loop.h less · db725815
      Markus Armbruster authored
      
      In my "build everything" tree, changing qemu/main-loop.h triggers a
      recompile of some 5600 out of 6600 objects (not counting tests and
      objects that don't depend on qemu/osdep.h).  It includes block/aio.h,
      which in turn includes qemu/event_notifier.h, qemu/notify.h,
      qemu/processor.h, qemu/qsp.h, qemu/queue.h, qemu/thread-posix.h,
      qemu/thread.h, qemu/timer.h, and a few more.
      
      Include qemu/main-loop.h only where it's needed.  Touching it now
      recompiles only some 1700 objects.  For block/aio.h and
      qemu/event_notifier.h, these numbers drop from 5600 to 2800.  For the
      others, they shrink only slightly.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190812052359.30071-21-armbru@redhat.com>
      Reviewed-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Tested-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      db725815
  2. Jul 02, 2019
  3. Jun 12, 2019
    • Markus Armbruster's avatar
      Include qemu-common.h exactly where needed · a8d25326
      Markus Armbruster authored
      
      No header includes qemu-common.h after this commit, as prescribed by
      qemu-common.h's file comment.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190523143508.25387-5-armbru@redhat.com>
      [Rebased with conflicts resolved automatically, except for
      include/hw/arm/xlnx-zynqmp.h hw/arm/nrf51_soc.c hw/arm/msf2-soc.c
      block/qcow2-refcount.c block/qcow2-cluster.c block/qcow2-cache.c
      target/arm/cpu.h target/lm32/cpu.h target/m68k/cpu.h target/mips/cpu.h
      target/moxie/cpu.h target/nios2/cpu.h target/openrisc/cpu.h
      target/riscv/cpu.h target/tilegx/cpu.h target/tricore/cpu.h
      target/unicore32/cpu.h target/xtensa/cpu.h; bsd-user/main.c and
      net/tap-bsd.c fixed up]
      a8d25326
  4. Feb 06, 2019
  5. Jan 11, 2019
  6. Aug 28, 2018
  7. Aug 23, 2018
  8. Jun 29, 2018
  9. Apr 09, 2018
    • Eric Blake's avatar
      dump: Fix build with newer gcc · 84c868f6
      Eric Blake authored
      
      gcc 8 on rawhide is picky enough to complain:
      
      /home/dummy/qemu/dump.c: In function 'create_header32':
      /home/dummy/qemu/dump.c:817:5: error: 'strncpy' output truncated before terminating nul copying 8 bytes from a string of the same length [-Werror=stringop-truncation]
           strncpy(dh->signature, KDUMP_SIGNATURE, strlen(KDUMP_SIGNATURE));
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      But we already have SIG_LEN defined as the right length without needing
      to do a strlen(), and memcpy() is better than strncpy() when we know
      we do not want a trailing NUL byte.
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      84c868f6
  10. Mar 21, 2018
    • Yasmin Beatriz's avatar
      dump.c: allow fd_write_vmcore to return errno on failure · 0c33659d
      Yasmin Beatriz authored
      
      fd_write_vmcore can fail to execute for a lot of reasons that can be
      retrieved by errno, but it only returns -1. This makes difficult for
      the caller to know what happened and only a generic error message is
      propagated back to the user. This is an example using dump-guest-memory:
      
      (qemu) dump-guest-memory /home/yasmin/mnt/test.dump
      dump: failed to save memory
      
      All callers of fd_write_vmcore of dump.c does error handling via
      error_setg(), so at first it seems feasible to add the Error pointer as
      an argument of fd_write_vmcore. This proved to be more complex than it
      first looked. fd_write_vmcore is used by write_elf64_notes and
      write_elf32_notes as a WriteCoreDumpFunction prototype. WriteCoreDumpFunction
      is declared in include/qom/cpu.h and is used all around the code. This
      leaves us with few alternatives:
      
      - change the WriteCoreDumpFunction prototype to include an error pointer.
      This would require to change all functions that implements this prototype
      to also receive an Error pointer;
      
      - change both write_elf64_notes and write_elf32_notes to no use the
      WriteCoreDumpFunction. These functions use not only fd_write_vmcore
      but also buf_write_note, so this would require to change buf_write_note
      to handle an Error pointer. Considerable easier than the alternative
      above, but it's still a lot of code just for the benefit of the callers
      of fd_write_vmcore.
      
      This patch presents an easier solution that benefits all fd_write_vmcore
      callers:
      
      - instead of returning -1 on error, return -errno. All existing callers
      already checks for ret < 0 so there is no need to change the caller's
      logic too much. This also allows the retrieval of the errno.
      
      - all callers were updated to use error_setg_errno instead of just
      errno_setg. Now that fd_write_vmcore can return an errno, let's update
      all callers so they can benefit from a more detailed error message.
      
      This is the same dump-guest-memory example with this patch applied:
      
      (qemu) dump-guest-memory /home/yasmin/mnt/test.dump
      dump: failed to save memory: No space left on device
      (qemu)
      
      This example illustrates an error of fd_write_vmcore when called
      from write_data. All other callers will benefit from better
      error messages as well.
      
      Reported-by: default avatar <yilzhang@redhat.com>
      Cc: Jose Ricardo Ziviani <joserz@linux.vnet.ibm.com>
      Signed-off-by: default avatarYasmin Beatriz <yasmins@linux.vnet.ibm.com>
      Signed-off-by: default avatarDaniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
      Message-Id: <20180212142506.28445-2-danielhb@linux.vnet.ibm.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      0c33659d
  11. Mar 19, 2018
  12. Mar 02, 2018
    • Markus Armbruster's avatar
      qapi: Empty out qapi-schema.json · 112ed241
      Markus Armbruster authored
      
      The previous commit improved compile time by including less of the
      generated QAPI headers.  This is impossible for stuff defined directly
      in qapi-schema.json, because that ends up in headers that that pull in
      everything.
      
      Move everything but include directives from qapi-schema.json to new
      sub-module qapi/misc.json, then include just the "misc" shard where
      possible.
      
      It's possible everywhere, except:
      
      * monitor.c needs qmp-command.h to get qmp_init_marshal()
      
      * monitor.c, ui/vnc.c and the generated qapi-event-FOO.c need
        qapi-event.h to get enum QAPIEvent
      
      Perhaps we'll get rid of those some other day.
      
      Adding a type to qapi/migration.json now recompiles some 120 instead
      of 2300 out of 5100 objects.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20180211093607.27351-25-armbru@redhat.com>
      [eblake: rebase to master]
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      112ed241
  13. Feb 09, 2018
  14. Jan 02, 2018
  15. Oct 15, 2017
  16. Sep 19, 2017
  17. Sep 14, 2017
  18. Aug 30, 2017
  19. May 05, 2017
    • Fam Zheng's avatar
      dump: Acquire BQL around vm_start() in dump thread · 6796b400
      Fam Zheng authored
      
      This fixes an assertion failure in the following backtrace:
      
          __GI___assert_fail
          memory_region_transaction_commit
          memory_region_add_eventfd
          virtio_pci_ioeventfd_assign
          virtio_bus_set_host_notifier
          virtio_blk_data_plane_start
          virtio_bus_start_ioeventfd
          virtio_vmstate_change
          vm_state_notify
          vm_prepare_start
          vm_start
          dump_cleanup
          dump_process
          dump_thread
          start_thread
          clone
      
      vm_start need BQL, acquire it if doing cleaning up from main thread.
      
      Signed-off-by: default avatarFam Zheng <famz@redhat.com>
      Message-Id: <20170503072819.14462-1-famz@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      6796b400
  20. Jun 20, 2016
  21. Mar 22, 2016
  22. Feb 22, 2016
  23. Feb 04, 2016
    • Peter Maydell's avatar
      all: Clean up includes · d38ea87a
      Peter Maydell authored
      
      Clean up includes so that osdep.h is included first and headers
      which it implies are not included manually.
      
      This commit was created with scripts/clean-includes.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1454089805-5470-16-git-send-email-peter.maydell@linaro.org
      d38ea87a
  24. Jan 15, 2016
  25. Jun 22, 2015
Loading