Skip to content
Snippets Groups Projects
  1. Jun 22, 2022
  2. Mar 02, 2022
  3. Dec 19, 2020
    • Markus Armbruster's avatar
      migration: Replace migration's JSON writer by the general one · 3ddba9a9
      Markus Armbruster authored
      
      Commit 8118f095 "migration: Append JSON description of migration
      stream" needs a JSON writer.  The existing qobject_to_json() wasn't a
      good fit, because it requires building a QObject to convert.  Instead,
      migration got its very own JSON writer, in commit 190c882c "QJSON:
      Add JSON writer".  It tacitly limits numbers to int64_t, and strings
      contents to characters that don't need escaping, unlike
      qobject_to_json().
      
      The previous commit factored the JSON writer out of qobject_to_json().
      Replace migration's JSON writer by it.
      
      Cc: Juan Quintela <quintela@redhat.com>
      Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20201211171152.146877-17-armbru@redhat.com>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      3ddba9a9
  4. Oct 26, 2020
  5. Feb 28, 2020
  6. 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
  7. May 14, 2019
  8. Jan 21, 2019
  9. Nov 27, 2018
  10. Aug 22, 2018
  11. Jun 01, 2018
  12. Sep 27, 2017
  13. Jun 13, 2017
  14. Jun 01, 2017
  15. May 18, 2017
  16. Mar 16, 2017
  17. Feb 28, 2017
    • Halil Pasic's avatar
      migration/vmstate: fix array of ptr with nullptrs · 07d4e691
      Halil Pasic authored
      
      Make VMS_ARRAY_OF_POINTER cope with null pointers. Previously the
      reward for trying to migrate an array with some null pointers in it was
      an illegal memory access, that is a swift and painless death of the
      process.  Let's make vmstate cope with this scenario.
      
      The general approach is, when we encounter a null pointer (element),
      instead of following the pointer to save/load the data behind it, we
      save/load a placeholder. This way we can detect if we expected a null
      pointer at the load side but not null data was saved instead.
      
      Signed-off-by: default avatarHalil Pasic <pasic@linux.vnet.ibm.com>
      Reviewed-by: default avatarGuenther Hutzl <hutzl@linux.vnet.ibm.com>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Message-Id: <20170222160119.52771-4-pasic@linux.vnet.ibm.com>
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      07d4e691
    • Halil Pasic's avatar
      migration/vmstate: split up vmstate_base_addr · cbfda0e6
      Halil Pasic authored
      
      Currently vmstate_base_addr does several things: it pinpoints the field
      within the struct, possibly allocates memory and possibly does the first
      pointer dereference. Obviously allocation is needed only for load.
      
      Let us split up the functionality in vmstate_base_addr and move the
      address manipulations (that is everything but the allocation logic) to
      load and save so it becomes more obvious what is actually going on. Like
      this all the address calculations (and the handling of the flags
      controlling these) is in one place and the sequence is more obvious.
      
      The newly introduced function vmstate_handle_alloc also fixes the
      allocation for the unused VMS_VBUFFER|VMS_MULTIPLY|VMS_ALLOC scenario
      and is substantially simpler than the original vmstate_base_addr.
      
      In load and save some asserts are added so it's easier to debug
      situations where we would end up with a null pointer dereference.
      
      Signed-off-by: default avatarHalil Pasic <pasic@linux.vnet.ibm.com>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Message-Id: <20170222160119.52771-3-pasic@linux.vnet.ibm.com>
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      cbfda0e6
    • Halil Pasic's avatar
      migration/vmstate: renames in (load|save)_state · e84641f7
      Halil Pasic authored
      
      The vmstate_(load|save)_state start out with an a void *opaque pointing
      to some struct, and manipulate one or more elements of one field within
      that struct.
      
      First the field within the struct is pinpointed as opaque + offset, then
      if this is a pointer the pointer is dereferenced to obtain a pointer to
      the first element of the vmstate field. Pointers to further elements if
      any are calculated as first_element + i * element_size (where i is the
      zero based index of the element in question).
      
      Currently base_addr and addr is used as a variable name for the pointer
      to the first element and the pointer to the current element being
      processed. This is suboptimal because base_addr is somewhat
      counter-intuitive (because obtained as base + offset) and both base_addr
      and addr not very descriptive (that we have a pointer should be clear
      from the fact that it is declared as a pointer).
      
      Let make things easier to understand by renaming base_addr to first_elem
      and addr to curr_elem. This has the additional benefit of harmonizing
      with other names within the scope (n_elems, vmstate_n_elems).
      
      Signed-off-by: default avatarHalil Pasic <pasic@linux.vnet.ibm.com>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Message-Id: <20170222160119.52771-2-pasic@linux.vnet.ibm.com>
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      e84641f7
  18. Feb 13, 2017
    • Dr. David Alan Gilbert's avatar
      migration: Add VMSTATE_WITH_TMP · bcf45131
      Dr. David Alan Gilbert authored
      
      VMSTATE_WITH_TMP is for handling structures where some calculation
      or rearrangement of the data needs to be performed before the data
      hits the wire.
      For example,  where the value on the wire is an offset from a
      non-migrated base, but the data in the structure is the actual pointer.
      
      To use it, a temporary type is created and a vmsd used on that type.
      The first element of the type must be 'parent' a pointer back to the
      type of the main structure.  VMSTATE_WITH_TMP takes care of allocating
      and freeing the temporary before running the child vmsd.
      
      The post_load/pre_save on the child vmsd can copy things from the parent
      to the temporary using the parent pointer and do any other calculations
      needed; it can then use normal VMSD entries to do the actual data
      storage without having to fiddle around with qemu_get_*/qemu_put_*
      
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Reviewed-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
      Message-Id: <20170203160651.19917-3-dgilbert@redhat.com>
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      bcf45131
    • Halil Pasic's avatar
      migration: consolidate VMStateField.start · 59046ec2
      Halil Pasic authored
      
      The member VMStateField.start is used for two things, partial data
      migration for VBUFFER data (basically provide migration for a
      sub-buffer) and for locating next in QTAILQ.
      
      The implementation of the VBUFFER feature is broken when VMSTATE_ALLOC
      is used. This however goes unnoticed because actually partial migration
      for VBUFFER is not used at all.
      
      Let's consolidate the usage of VMStateField.start by removing support
      for partial migration for VBUFFER.
      
      Signed-off-by: default avatarHalil Pasic <pasic@linux.vnet.ibm.com>
      
      Message-Id: <20170203175217.45562-1-pasic@linux.vnet.ibm.com>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      59046ec2
  19. Jan 24, 2017
  20. Oct 13, 2016
  21. Jun 17, 2016
  22. May 23, 2016
  23. Jan 29, 2016
  24. Jan 16, 2016
  25. Jul 07, 2015
  26. Jun 12, 2015
Loading