1. 19 1月, 2018 2 次提交
    • 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
    • E
      machine: Replace has_dynamic_sysbus with list of allowed devices · 0bd1909d
      Eduardo Habkost 提交于
      The existing has_dynamic_sysbus flag makes the machine accept
      every user-creatable sysbus device type on the command-line.
      Replace it with a list of allowed device types, so machines can
      easily accept some sysbus devices while rejecting others.
      
      To keep exactly the same behavior as before, the existing
      has_dynamic_sysbus=true assignments are replaced with a
      TYPE_SYS_BUS_DEVICE entry on the allowed list.  Other patches
      will replace the TYPE_SYS_BUS_DEVICE entries with more specific
      lists of devices.
      
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: Marcel Apfelbaum <marcel@redhat.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Alexander Graf <agraf@suse.de>
      Cc: David Gibson <david@gibson.dropbear.id.au>
      Cc: Stefano Stabellini <sstabellini@kernel.org>
      Cc: Anthony Perard <anthony.perard@citrix.com>
      Cc: qemu-arm@nongnu.org
      Cc: qemu-ppc@nongnu.org
      Cc: xen-devel@lists.xenproject.org
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <20171125151610.20547-2-ehabkost@redhat.com>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      Reviewed-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Reviewed-by: NMarcel Apfelbaum <marcel@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      0bd1909d
  2. 18 12月, 2017 1 次提交
  3. 10 10月, 2017 1 次提交
  4. 20 9月, 2017 1 次提交
    • I
      numa: cpu: calculate/set default node-ids after all -numa CLI options are parsed · 79e07936
      Igor Mammedov 提交于
      Calculating default node-ids for CPUs in possible_cpu_arch_ids()
      is rather fragile since defaults calculation uses nb_numa_nodes but
      callback might be potentially called early before all -numa CLI
      options are parsed, which would lead to cpus assigned only upto
      nb_numa_nodes at the time possible_cpu_arch_ids() is called.
      
      Issue was introduced by
      (7c88e65d numa: mirror cpu to node mapping in MachineState::possible_cpus)
      and for example CLI:
        -smp 4 -numa node,cpus=0 -numa node
      would set props.node-id in possible_cpus array for every non
      explicitly mapped CPU to the first node.
      
      Issue is not visible to guest nor to mgmt interface due to
        1) implictly mapped cpus are forced to the first node in
           case of partial mapping
        2) in case of default mapping possible_cpu_arch_ids() is
           called after all -numa options are parsed (resulting
           in correct mapping).
      
      However it's fragile to rely on late execution of
      possible_cpu_arch_ids(), therefore add machine specific
      callback that returns node-id for CPU and use it to calculate/
      set defaults at machine_numa_finish_init() time when all -numa
      options are parsed.
      Reported-by: NEduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
      Message-Id: <1496314408-163972-1-git-send-email-imammedo@redhat.com>
      Reviewed-by: NEduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      79e07936
  5. 18 7月, 2017 1 次提交
  6. 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
  7. 28 6月, 2017 1 次提交
  8. 06 6月, 2017 2 次提交
    • I
      numa: make sure that all cpus have has_node_id set if numa is enabled · d41f3e75
      Igor Mammedov 提交于
      It fixes/add missing _PXM object for non mapped CPU (x86)
      and missing fdt node (virt-arm).
      
      It ensures that possible_cpus contains complete mapping if
      numa is enabled by the time machine_init() is executed.
      
      As result non completely mapped CPUs:
       1) appear in ACPI/fdt blobs
       2) QMP query-hotpluggable-cpus command shows bound nodes for such CPUs
       3) allows to drop checks for has_node_id in numa only code,
         reducing number of invariants incomplete mapping could produce
       4) moves fixup/implicit node init from runtime numa_cpu_pre_plug()
         (when CPU object is created) to machine_numa_finish_init() which
         helps to fix [1, 2] and make possible_cpus complete source
         of numa mapping available even before CPUs are created.
      Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
      Message-Id: <1496161442-96665-4-git-send-email-imammedo@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      d41f3e75
    • I
      numa: move default mapping init to machine · 60bed6a3
      Igor Mammedov 提交于
      there is no need use cpu_index_to_instance_props() for setting
      default cpu -> node mapping. Generic machine code can do it
      without cpu_index by just enabling already preset defaults
      in possible_cpus.
      
      PS:
      as bonus it makes one less user of cpu_index_to_instance_props()
      Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
      Message-Id: <1496161442-96665-3-git-send-email-imammedo@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      60bed6a3
  9. 23 5月, 2017 1 次提交
  10. 12 5月, 2017 4 次提交
  11. 22 3月, 2017 1 次提交
    • L
      numa,spapr: align default numa node memory size to 256MB · 55641213
      Laurent Vivier 提交于
      Since commit 224245bf ("spapr: Add LMB DR connectors"), NUMA node
      memory size must be aligned to 256MB (SPAPR_MEMORY_BLOCK_SIZE).
      
      But when "-numa" option is provided without "mem" parameter,
      the memory is equally divided between nodes, but 8MB aligned.
      This can be not valid for pseries.
      
      In that case we can have:
      $ ./ppc64-softmmu/qemu-system-ppc64 -m 4G -numa node -numa node -numa node
      qemu-system-ppc64: Node 0 memory size 0x55000000 is not aligned to 256 MiB
      
      With this patch, we have:
      (qemu) info numa
      3 nodes
      node 0 cpus: 0
      node 0 size: 1280 MB
      node 1 cpus:
      node 1 size: 1280 MB
      node 2 cpus:
      node 2 size: 1536 MB
      Signed-off-by: NLaurent Vivier <lvivier@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      55641213
  12. 15 3月, 2017 1 次提交
    • E
      machine: Convert abstract typename on compat_props to subclass names · 0bcba41f
      Eduardo Habkost 提交于
      Original problem description by Greg Kurz:
      
      > Since commit "9a4c0e22 hw/virtio-pci: fix virtio
      > behaviour", passing -device virtio-blk-pci.disable-modern=off
      > has no effect on 2.6 machine types because the internal
      > virtio-pci.disable-modern=on compat property always prevail.
      
      The same bug also affects other abstract type names mentioned on
      compat_props by machine-types: apic-common, i386-cpu, pci-device,
      powerpc64-cpu, s390-skeys, spapr-pci-host-bridge, usb-device,
      virtio-pci, x86_64-cpu.
      
      The right fix for this problem is to make sure compat_props and
      -global options are always applied in the order they are
      registered, instead of reordering them based on the type
      hierarchy. But changing the ordering rules of -global is risky
      and might break existing configurations, so we shouldn't do that
      on a stable branch.
      
      This is a temporary hack that will work around the bug when
      registering compat_props properties: if we find an abstract class
      on compat_props, register properties for all its non-abstract
      subtypes instead. This will make sure -global won't be overridden
      by compat_props, while keeping the existing ordering rules on
      -global options.
      
      Note that there's one case that won't be fixed by this hack:
      "-global spapr-pci-vfio-host-bridge.<option>=<value>" won't be
      able to override compat_props, because spapr-pci-host-bridge is
      not an abstract class.
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <1481575745-26120-1-git-send-email-ehabkost@redhat.com>
      Reviewed-by: NCornelia Huck <cornelia.huck@de.ibm.com>
      Reviewed-by: NHalil Pasic <pasic@linux.vnet.ibm.com>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      Tested-by: NGreg Kurz <groug@kaod.org>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      0bcba41f
  13. 22 2月, 2017 1 次提交
  14. 18 10月, 2016 1 次提交
  15. 28 9月, 2016 1 次提交
  16. 08 9月, 2016 1 次提交
  17. 27 7月, 2016 1 次提交
  18. 08 7月, 2016 2 次提交
  19. 04 7月, 2016 1 次提交
  20. 21 5月, 2016 2 次提交
  21. 23 3月, 2016 2 次提交
    • V
      util: move declarations out of qemu-common.h · f348b6d1
      Veronia Bahaa 提交于
      Move declarations out of qemu-common.h for functions declared in
      utils/ files: e.g. include/qemu/path.h for utils/path.c.
      Move inline functions out of qemu-common.h and into new files (e.g.
      include/qemu/bcd.h)
      Signed-off-by: NVeronia Bahaa <veroniabahaa@gmail.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      f348b6d1
    • M
      include/qemu/osdep.h: Don't include qapi/error.h · da34e65c
      Markus Armbruster 提交于
      Commit 57cb38b3 included qapi/error.h into qemu/osdep.h to get the
      Error typedef.  Since then, we've moved to include qemu/osdep.h
      everywhere.  Its file comment explains: "To avoid getting into
      possible circular include dependencies, this file should not include
      any other QEMU headers, with the exceptions of config-host.h,
      compiler.h, os-posix.h and os-win32.h, all of which are doing a
      similar job to this file and are under similar constraints."
      qapi/error.h doesn't do a similar job, and it doesn't adhere to
      similar constraints: it includes qapi-types.h.  That's in excess of
      100KiB of crap most .c files don't actually need.
      
      Add the typedef to qemu/typedefs.h, and include that instead of
      qapi/error.h.  Include qapi/error.h in .c files that need it and don't
      get it now.  Include qapi-types.h in qom/object.h for uint16List.
      
      Update scripts/clean-includes accordingly.  Update it further to match
      reality: replace config.h by config-target.h, add sysemu/os-posix.h,
      sysemu/os-win32.h.  Update the list of includes in the qemu/osdep.h
      comment quoted above similarly.
      
      This reduces the number of objects depending on qapi/error.h from "all
      of them" to less than a third.  Unfortunately, the number depending on
      qapi-types.h shrinks only a little.  More work is needed for that one.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      [Fix compilation without the spice devel packages. - Paolo]
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      da34e65c
  22. 28 2月, 2016 1 次提交
  23. 09 2月, 2016 2 次提交
    • E
      qom: Swap 'name' next to visitor in ObjectPropertyAccessor · d7bce999
      Eric Blake 提交于
      Similar to the previous patch, it's nice to have all functions
      in the tree that involve a visitor and a name for conversion to
      or from QAPI to consistently stick the 'name' parameter next
      to the Visitor parameter.
      
      Done by manually changing include/qom/object.h and qom/object.c,
      then running this Coccinelle script and touching up the fallout
      (Coccinelle insisted on adding some trailing whitespace).
      
          @ rule1 @
          identifier fn;
          typedef Object, Visitor, Error;
          identifier obj, v, opaque, name, errp;
          @@
           void fn
          - (Object *obj, Visitor *v, void *opaque, const char *name,
          + (Object *obj, Visitor *v, const char *name, void *opaque,
             Error **errp) { ... }
      
          @@
          identifier rule1.fn;
          expression obj, v, opaque, name, errp;
          @@
           fn(obj, v,
          -   opaque, name,
          +   name, opaque,
              errp)
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <1454075341-13658-20-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      d7bce999
    • E
      qapi: Swap visit_* arguments for consistent 'name' placement · 51e72bc1
      Eric Blake 提交于
      JSON uses "name":value, but many of our visitor interfaces were
      called with visit_type_FOO(v, &value, name, errp).  This can be
      a bit confusing to have to mentally swap the parameter order to
      match JSON order.  It's particularly bad for visit_start_struct(),
      where the 'name' parameter is smack in the middle of the
      otherwise-related group of 'obj, kind, size' parameters! It's
      time to do a global swap of the parameter ordering, so that the
      'name' parameter is always immediately after the Visitor argument.
      
      Additional reason in favor of the swap: the existing include/qjson.h
      prefers listing 'name' first in json_prop_*(), and I have plans to
      unify that file with the qapi visitors; listing 'name' first in
      qapi will minimize churn to the (admittedly few) qjson.h clients.
      
      Later patches will then fix docs, object.h, visitor-impl.h, and
      those clients to match.
      
      Done by first patching scripts/qapi*.py by hand to make generated
      files do what I want, then by running the following Coccinelle
      script to affect the rest of the code base:
       $ spatch --sp-file script `git grep -l '\bvisit_' -- '**/*.[ch]'`
      I then had to apply some touchups (Coccinelle insisted on TAB
      indentation in visitor.h, and botched the signature of
      visit_type_enum() by rewriting 'const char *const strings[]' to
      the syntactically invalid 'const char*const[] strings').  The
      movement of parameters is sufficient to provoke compiler errors
      if any callers were missed.
      
          // Part 1: Swap declaration order
          @@
          type TV, TErr, TObj, T1, T2;
          identifier OBJ, ARG1, ARG2;
          @@
           void visit_start_struct
          -(TV v, TObj OBJ, T1 ARG1, const char *name, T2 ARG2, TErr errp)
          +(TV v, const char *name, TObj OBJ, T1 ARG1, T2 ARG2, TErr errp)
           { ... }
      
          @@
          type bool, TV, T1;
          identifier ARG1;
          @@
           bool visit_optional
          -(TV v, T1 ARG1, const char *name)
          +(TV v, const char *name, T1 ARG1)
           { ... }
      
          @@
          type TV, TErr, TObj, T1;
          identifier OBJ, ARG1;
          @@
           void visit_get_next_type
          -(TV v, TObj OBJ, T1 ARG1, const char *name, TErr errp)
          +(TV v, const char *name, TObj OBJ, T1 ARG1, TErr errp)
           { ... }
      
          @@
          type TV, TErr, TObj, T1, T2;
          identifier OBJ, ARG1, ARG2;
          @@
           void visit_type_enum
          -(TV v, TObj OBJ, T1 ARG1, T2 ARG2, const char *name, TErr errp)
          +(TV v, const char *name, TObj OBJ, T1 ARG1, T2 ARG2, TErr errp)
           { ... }
      
          @@
          type TV, TErr, TObj;
          identifier OBJ;
          identifier VISIT_TYPE =~ "^visit_type_";
          @@
           void VISIT_TYPE
          -(TV v, TObj OBJ, const char *name, TErr errp)
          +(TV v, const char *name, TObj OBJ, TErr errp)
           { ... }
      
          // Part 2: swap caller order
          @@
          expression V, NAME, OBJ, ARG1, ARG2, ERR;
          identifier VISIT_TYPE =~ "^visit_type_";
          @@
          (
          -visit_start_struct(V, OBJ, ARG1, NAME, ARG2, ERR)
          +visit_start_struct(V, NAME, OBJ, ARG1, ARG2, ERR)
          |
          -visit_optional(V, ARG1, NAME)
          +visit_optional(V, NAME, ARG1)
          |
          -visit_get_next_type(V, OBJ, ARG1, NAME, ERR)
          +visit_get_next_type(V, NAME, OBJ, ARG1, ERR)
          |
          -visit_type_enum(V, OBJ, ARG1, ARG2, NAME, ERR)
          +visit_type_enum(V, NAME, OBJ, ARG1, ARG2, ERR)
          |
          -VISIT_TYPE(V, OBJ, NAME, ERR)
          +VISIT_TYPE(V, NAME, OBJ, ERR)
          )
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <1454075341-13658-19-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      51e72bc1
  24. 29 1月, 2016 1 次提交
  25. 22 12月, 2015 1 次提交
  26. 18 12月, 2015 1 次提交
  27. 17 11月, 2015 1 次提交
  28. 19 9月, 2015 2 次提交
  29. 10 9月, 2015 1 次提交
  30. 04 6月, 2015 1 次提交