1. 16 8月, 2019 1 次提交
    • M
      Include sysemu/sysemu.h a lot less · 46517dd4
      Markus Armbruster 提交于
      In my "build everything" tree, changing sysemu/sysemu.h triggers a
      recompile of some 5400 out of 6600 objects (not counting tests and
      objects that don't depend on qemu/osdep.h).
      
      hw/qdev-core.h includes sysemu/sysemu.h since recent commit e965ffa7
      "qdev: add qdev_add_vm_change_state_handler()".  This is a bad idea:
      hw/qdev-core.h is widely included.
      
      Move the declaration of qdev_add_vm_change_state_handler() to
      sysemu/sysemu.h, and drop the problematic include from hw/qdev-core.h.
      
      Touching sysemu/sysemu.h now recompiles some 1800 objects.
      qemu/uuid.h also drops from 5400 to 1800.  A few more headers show
      smaller improvement: qemu/notify.h drops from 5600 to 5200,
      qemu/timer.h from 5600 to 4500, and qapi/qapi-types-run-state.h from
      5500 to 5000.
      
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NAlistair Francis <alistair.francis@wdc.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Message-Id: <20190812052359.30071-28-armbru@redhat.com>
      Reviewed-by: NAlex Bennée <alex.bennee@linaro.org>
      46517dd4
  2. 12 6月, 2019 1 次提交
    • M
      Include qemu-common.h exactly where needed · a8d25326
      Markus Armbruster 提交于
      No header includes qemu-common.h after this commit, as prescribed by
      qemu-common.h's file comment.
      Signed-off-by: NMarkus 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
  3. 25 5月, 2019 1 次提交
    • P
      hw/arm: Use object_initialize_child for correct reference counting · d0313798
      Philippe Mathieu-Daudé 提交于
      As explained in commit aff39be0:
      
        Both functions, object_initialize() and object_property_add_child()
        increase the reference counter of the new object, so one of the
        references has to be dropped afterwards to get the reference
        counting right. Otherwise the child object will not be properly
        cleaned up when the parent gets destroyed.
        Thus let's use now object_initialize_child() instead to get the
        reference counting here right.
      
      This patch was generated using the following Coccinelle script
      (with a bit of manual fix-up for overly long lines):
      
       @use_object_initialize_child@
       expression parent_obj;
       expression child_ptr;
       expression child_name;
       expression child_type;
       expression child_size;
       expression errp;
       @@
       (
       -   object_initialize(child_ptr, child_size, child_type);
       +   object_initialize_child(parent_obj, child_name,  child_ptr, child_size,
       +                           child_type, &error_abort, NULL);
           ... when != parent_obj
       -   object_property_add_child(parent_obj, child_name, OBJECT(child_ptr), NULL);
           ...
       ?-  object_unref(OBJECT(child_ptr));
       |
       -   object_initialize(child_ptr, child_size, child_type);
       +   object_initialize_child(parent_obj, child_name,  child_ptr, child_size,
       +                            child_type, errp, NULL);
           ... when != parent_obj
       -   object_property_add_child(parent_obj, child_name, OBJECT(child_ptr), errp);
           ...
       ?-  object_unref(OBJECT(child_ptr));
       )
      
       @use_sysbus_init_child_obj@
       expression parent_obj;
       expression dev;
       expression child_ptr;
       expression child_name;
       expression child_type;
       expression child_size;
       expression errp;
       @@
       (
       -   object_initialize_child(parent_obj, child_name, child_ptr, child_size,
       -                           child_type, errp, NULL);
       +   sysbus_init_child_obj(parent_obj, child_name, child_ptr, child_size,
       +                         child_type);
           ...
       -   qdev_set_parent_bus(DEVICE(child_ptr), sysbus_get_default());
       |
       -   object_initialize_child(parent_obj, child_name, child_ptr, child_size,
       -                           child_type, errp, NULL);
       +   sysbus_init_child_obj(parent_obj, child_name, child_ptr, child_size,
       +                         child_type);
       -   dev = DEVICE(child_ptr);
       -   qdev_set_parent_bus(dev, sysbus_get_default());
       )
      
      While the object_initialize() function doesn't take an
      'Error *errp' argument, the object_initialize_child() does.
      Since this code is used when a machine is created (and is not
      yet running), we deliberately choose to use the &error_abort
      argument instead of ignoring errors if an object creation failed.
      This choice also matches when using sysbus_init_child_obj(),
      since its code is:
      
        void sysbus_init_child_obj(Object *parent,
                                   const char *childname, void *child,
                                   size_t childsize, const char *childtype)
        {
            object_initialize_child(parent, childname, child, childsize,
                                    childtype, &error_abort, NULL);
      
            qdev_set_parent_bus(DEVICE(child), sysbus_get_default());
        }
      Suggested-by: NEduardo Habkost <ehabkost@redhat.com>
      Inspired-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      Message-Id: <20190507163416.24647-9-philmd@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NAlistair Francis <alistair.francis@wdc.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      d0313798
  4. 30 4月, 2019 1 次提交
  5. 26 4月, 2018 1 次提交
  6. 07 9月, 2017 1 次提交
  7. 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
  8. 23 3月, 2016 2 次提交
    • P
      hw: explicitly include qemu-common.h and cpu.h · 4771d756
      Paolo Bonzini 提交于
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      4771d756
    • 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
  9. 09 2月, 2016 1 次提交
  10. 19 1月, 2016 1 次提交
  11. 13 1月, 2016 1 次提交
  12. 19 9月, 2015 1 次提交
  13. 07 9月, 2015 1 次提交
  14. 13 8月, 2015 2 次提交
  15. 09 4月, 2015 1 次提交
  16. 09 9月, 2014 1 次提交
  17. 28 5月, 2014 1 次提交
  18. 28 8月, 2013 1 次提交
    • M
      hw: Clean up bogus default boot order · c1654732
      Markus Armbruster 提交于
      We set default boot order "cad" in every single machine definition
      except "pseries" and "moxiesim", even though very few boards actually
      care for boot order, and "cad" makes sense for even fewer.
      
      Machines that care:
      
      * pc and its variants
      
        Accept up to three letters 'a', 'b' (undocumented alias for 'a'),
        'c', 'd' and 'n'.  Reject all others (fatal with -boot).
      
      * nseries (n800, n810)
      
        Check whether order starts with 'n'.  Silently ignored otherwise.
      
      * prep, g3beige, mac99
      
        Extract the first character the machine understands (subset of
        'a'..'f').  Silently ignored otherwise.
      
      * spapr
      
        Accept an arbitrary string (vl.c restricts it to contain only
        'a'..'p', no duplicates).
      
      * sun4[mdc]
      
        Use the first character.  Silently ignored otherwise.
      
      Strip characters these machines ignore from their default boot order.
      
      For all other machines, remove the unused default boot order
      alltogether.
      
      Note that my rename of QEMUMachine member boot_order to
      default_boot_order and QEMUMachineInitArgs member boot_device to
      boot_order has a welcome side effect: it makes every use of boot
      orders visible in this patch, for easy review.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      c1654732
  19. 20 8月, 2013 1 次提交
  20. 04 7月, 2013 1 次提交
  21. 15 4月, 2013 1 次提交
  22. 09 4月, 2013 1 次提交
    • P
      hw: move headers to include/ · 0d09e41a
      Paolo Bonzini 提交于
      Many of these should be cleaned up with proper qdev-/QOM-ification.
      Right now there are many catch-all headers in include/hw/ARCH depending
      on cpu.h, and this makes it necessary to compile these files per-target.
      However, fixing this does not belong in these patches.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      0d09e41a
  23. 01 3月, 2013 2 次提交
  24. 16 1月, 2013 1 次提交
  25. 19 12月, 2012 3 次提交
  26. 23 10月, 2012 1 次提交
  27. 20 10月, 2012 1 次提交
    • E
      create struct for machine initialization arguments · 5f072e1f
      Eduardo Habkost 提交于
      This should help us to:
      - More easily add or remove machine initialization arguments without
        having to change every single machine init function;
      - More easily make mechanical changes involving the machine init
        functions in the future;
      - Let machine initialization forward the init arguments to other
        functions more easily.
      
      This change was half-mechanical process: first the struct was added with
      the local ram_size, boot_device, kernel_*, initrd_*, and cpu_model local
      variable initialization to all functions. Then the compiler helped me
      locate the local variables that are unused, so they could be removed.
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      5f072e1f
  28. 14 9月, 2012 1 次提交
  29. 01 8月, 2012 1 次提交
  30. 04 7月, 2012 1 次提交