Skip to content
Snippets Groups Projects
  1. Apr 06, 2022
  2. Jun 28, 2021
  3. Jun 02, 2021
  4. May 02, 2021
  5. Dec 10, 2020
  6. Sep 25, 2020
  7. Sep 18, 2020
  8. Sep 09, 2020
  9. Aug 21, 2020
  10. Jun 15, 2020
    • Markus Armbruster's avatar
      sysbus: Convert to sysbus_realize() etc. with Coccinelle · 3c6ef471
      Markus Armbruster authored
      
      Convert from qdev_realize(), qdev_realize_and_unref() with null @bus
      argument to sysbus_realize(), sysbus_realize_and_unref().
      
      Coccinelle script:
      
          @@
          expression dev, errp;
          @@
          -    qdev_realize(DEVICE(dev), NULL, errp);
          +    sysbus_realize(SYS_BUS_DEVICE(dev), errp);
      
          @@
          expression sysbus_dev, dev, errp;
          @@
          +    sysbus_dev = SYS_BUS_DEVICE(dev);
          -    qdev_realize_and_unref(dev, NULL, errp);
          +    sysbus_realize_and_unref(sysbus_dev, errp);
          -    sysbus_dev = SYS_BUS_DEVICE(dev);
      
          @@
          expression sysbus_dev, dev, errp;
          expression expr;
          @@
               sysbus_dev = SYS_BUS_DEVICE(dev);
               ... when != dev = expr;
          -    qdev_realize_and_unref(dev, NULL, errp);
          +    sysbus_realize_and_unref(sysbus_dev, errp);
      
          @@
          expression dev, errp;
          @@
          -    qdev_realize_and_unref(DEVICE(dev), NULL, errp);
          +    sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), errp);
      
          @@
          expression dev, errp;
          @@
          -    qdev_realize_and_unref(dev, NULL, errp);
          +    sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), errp);
      
      Whitespace changes minimized manually.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Acked-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20200610053247.1583243-46-armbru@redhat.com>
      [Conflicts in hw/misc/empty_slot.c and hw/sparc/leon3.c resolved]
      3c6ef471
    • Markus Armbruster's avatar
      qdev: Convert uses of qdev_create() with Coccinelle · 3e80f690
      Markus Armbruster authored
      
      This is the transformation explained in the commit before previous.
      Takes care of just one pattern that needs conversion.  More to come in
      this series.
      
      Coccinelle script:
      
          @ depends on !(file in "hw/arm/highbank.c")@
          expression bus, type_name, dev, expr;
          @@
          -    dev = qdev_create(bus, type_name);
          +    dev = qdev_new(type_name);
               ... when != dev = expr
          -    qdev_init_nofail(dev);
          +    qdev_realize_and_unref(dev, bus, &error_fatal);
      
          @@
          expression bus, type_name, dev, expr;
          identifier DOWN;
          @@
          -    dev = DOWN(qdev_create(bus, type_name));
          +    dev = DOWN(qdev_new(type_name));
               ... when != dev = expr
          -    qdev_init_nofail(DEVICE(dev));
          +    qdev_realize_and_unref(DEVICE(dev), bus, &error_fatal);
      
          @@
          expression bus, type_name, expr;
          identifier dev;
          @@
          -    DeviceState *dev = qdev_create(bus, type_name);
          +    DeviceState *dev = qdev_new(type_name);
               ... when != dev = expr
          -    qdev_init_nofail(dev);
          +    qdev_realize_and_unref(dev, bus, &error_fatal);
      
          @@
          expression bus, type_name, dev, expr, errp;
          symbol true;
          @@
          -    dev = qdev_create(bus, type_name);
          +    dev = qdev_new(type_name);
               ... when != dev = expr
          -    object_property_set_bool(OBJECT(dev), true, "realized", errp);
          +    qdev_realize_and_unref(dev, bus, errp);
      
          @@
          expression bus, type_name, expr, errp;
          identifier dev;
          symbol true;
          @@
          -    DeviceState *dev = qdev_create(bus, type_name);
          +    DeviceState *dev = qdev_new(type_name);
               ... when != dev = expr
          -    object_property_set_bool(OBJECT(dev), true, "realized", errp);
          +    qdev_realize_and_unref(dev, bus, errp);
      
      The first rule exempts hw/arm/highbank.c, because it matches along two
      control flow paths there, with different @type_name.  Covered by the
      next commit's manual conversions.
      
      Missing #include "qapi/error.h" added manually.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20200610053247.1583243-10-armbru@redhat.com>
      [Conflicts in hw/misc/empty_slot.c and hw/sparc/leon3.c resolved]
      3e80f690
  11. Mar 17, 2020
  12. Mar 10, 2020
  13. Mar 09, 2020
  14. Feb 28, 2020
  15. Feb 19, 2020
  16. Jan 29, 2020
    • Aleksandar Markovic's avatar
      hw/core/loader: Let load_elf() populate a field with CPU-specific flags · 6cdda0ff
      Aleksandar Markovic authored
      
      While loading the executable, some platforms (like AVR) need to
      detect CPU type that executable is built for - and, with this patch,
      this is enabled by reading the field 'e_flags' of the ELF header of
      the executable in question. The change expands functionality of
      the following functions:
      
        - load_elf()
        - load_elf_as()
        - load_elf_ram()
        - load_elf_ram_sym()
      
      The argument added to these functions is called 'pflags' and is of
      type 'uint32_t*' (that matches 'pointer to 'elf_word'', 'elf_word'
      being the type of the field 'e_flags', in both 32-bit and 64-bit
      variants of ELF header). Callers are allowed to pass NULL as that
      argument, and in such case no lookup to the field 'e_flags' will
      happen, and no information will be returned, of course.
      
      CC: Richard Henderson <rth@twiddle.net>
      CC: Peter Maydell <peter.maydell@linaro.org>
      CC: Edgar E. Iglesias <edgar.iglesias@gmail.com>
      CC: Michael Walle <michael@walle.cc>
      CC: Thomas Huth <huth@tuxfamily.org>
      CC: Laurent Vivier <laurent@vivier.eu>
      CC: Philippe Mathieu-Daudé <f4bug@amsat.org>
      CC: Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>
      CC: Aurelien Jarno <aurelien@aurel32.net>
      CC: Jia Liu <proljc@gmail.com>
      CC: David Gibson <david@gibson.dropbear.id.au>
      CC: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      CC: BALATON Zoltan <balaton@eik.bme.hu>
      CC: Christian Borntraeger <borntraeger@de.ibm.com>
      CC: Thomas Huth <thuth@redhat.com>
      CC: Artyom Tarasenko <atar4qemu@gmail.com>
      CC: Fabien Chouteau <chouteau@adacore.com>
      CC: KONRAD Frederic <frederic.konrad@adacore.com>
      CC: Max Filippov <jcmvbkbc@gmail.com>
      
      Reviewed-by: default avatarAleksandar Rikalo <aleksandar.rikalo@rt-rk.com>
      Signed-off-by: default avatarMichael Rolnik <mrolnik@gmail.com>
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Signed-off-by: default avatarAleksandar Markovic <amarkovic@wavecomp.com>
      Message-Id: <1580079311-20447-24-git-send-email-aleksandar.markovic@rt-rk.com>
      6cdda0ff
  17. Dec 17, 2019
  18. Oct 24, 2019
  19. Aug 16, 2019
  20. Jul 05, 2019
  21. 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
    • Markus Armbruster's avatar
      Include qemu/module.h where needed, drop it from qemu-common.h · 0b8fa32f
      Markus Armbruster authored
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190523143508.25387-4-armbru@redhat.com>
      [Rebased with conflicts resolved automatically, except for
      hw/usb/dev-hub.c hw/misc/exynos4210_rng.c hw/misc/bcm2835_rng.c
      hw/misc/aspeed_scu.c hw/display/virtio-vga.c hw/arm/stm32f205_soc.c;
      ui/cocoa.m fixed up]
      0b8fa32f
  22. Mar 22, 2019
  23. Mar 20, 2019
  24. Mar 07, 2019
  25. Feb 05, 2019
Loading