Skip to content
Snippets Groups Projects
  1. Jun 18, 2019
  2. 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
  3. Jun 11, 2019
    • Markus Armbruster's avatar
      qemu-common: Move tcg_enabled() etc. to sysemu/tcg.h · 14a48c1d
      Markus Armbruster authored
      
      Other accelerators have their own headers: sysemu/hax.h, sysemu/hvf.h,
      sysemu/kvm.h, sysemu/whpx.h.  Only tcg_enabled() & friends sit in
      qemu-common.h.  This necessitates inclusion of qemu-common.h into
      headers, which is against the rules spelled out in qemu-common.h's
      file comment.
      
      Move tcg_enabled() & friends into their own header sysemu/tcg.h, and
      adjust #include directives.
      
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190523143508.25387-2-armbru@redhat.com>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      [Rebased with conflicts resolved automatically, except for
      accel/tcg/tcg-all.c]
      14a48c1d
  4. Jun 05, 2019
    • Markus Armbruster's avatar
      vl: Document why objects are delayed · edfb4389
      Markus Armbruster authored
      
      Objects should not be "delayed" without a reason, as the previous
      commit demonstrates.  The remaining ones have reasons.  State them.
      and demand future ones come with such a statement.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190604151251.9903-3-armbru@redhat.com>
      Reviewed-by: default avatarMichal Privoznik <mprivozn@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      edfb4389
    • Markus Armbruster's avatar
      vl: Fix -drive / -blockdev persistent reservation management · 9ea18ed2
      Markus Armbruster authored
      
      qemu-system-FOO's main() acts on command line arguments in its own
      idiosyncratic order.  There's not much method to its madness.
      Whenever we find a case where one kind of command line argument needs
      to refer to something created for another kind later, we rejigger the
      order.
      
      Recent commit cda4aa9a "vl: Create block backends before setting
      machine properties" was such a rejigger.  Block backends are now
      created before "delayed" objects.  This broke persistent reservation
      management.  Reproducer:
      
          $ qemu-system-x86_64 -object pr-manager-helper,id=pr-helper0,path=/tmp/pr-helper0.sock-drive -drive file=/dev/mapper/crypt,file.pr-manager=pr-helper0,format=raw,if=none,id=drive-scsi0-0-0-2
          qemu-system-x86_64: -drive file=/dev/mapper/crypt,file.pr-manager=pr-helper0,format=raw,if=none,id=drive-scsi0-0-0-2: No persistent reservation manager with id 'pr-helper0'
      
      The delayed pr-manager-helper object is created too late for use by
      -drive or -blockdev.  Normal objects are still created in time.
      
      pr-manager-helper has always been a delayed object (commit 7c9e5276
      "scsi, file-posix: add support for persistent reservation
      management").  Turns out there's no real reason for that.  Make it a
      normal object.
      
      Fixes: cda4aa9a
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190604151251.9903-2-armbru@redhat.com>
      Reviewed-by: default avatarMichal Privoznik <mprivozn@redhat.com>
      Cc: qemu-stable@nongnu.org
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      9ea18ed2
  5. Jun 03, 2019
  6. May 29, 2019
  7. May 28, 2019
  8. May 22, 2019
  9. May 17, 2019
  10. May 15, 2019
  11. May 07, 2019
  12. Apr 29, 2019
  13. Apr 25, 2019
  14. Apr 18, 2019
  15. Apr 17, 2019
    • Christophe Fergeau's avatar
      log: Make glib logging go through QEMU · f5852efa
      Christophe Fergeau authored
      
      This commit adds a error_init() helper which calls
      g_log_set_default_handler() so that glib logs (g_log, g_warning, ...)
      are handled similarly to other QEMU logs. This means they will get a
      timestamp if timestamps are enabled, and they will go through the
      HMP monitor if one is configured.
      
      This commit also adds a call to error_init() to the binaries
      installed by QEMU. Since error_init() also calls error_set_progname(),
      this means that *-linux-user, *-bsd-user and qemu-pr-helper messages
      output with error_report, info_report, ... will slightly change: they
      will be prefixed by the binary name.
      
      glib debug messages are enabled through G_MESSAGES_DEBUG similarly to
      the glib default log handler.
      
      At the moment, this change will mostly impact SPICE logging if your
      spice version is >= 0.14.1. With older spice versions, this is not going
      to work as expected, but will not have any ill effect, so this call is
      not conditional on the SPICE version.
      
      Signed-off-by: default avatarChristophe Fergeau <cfergeau@redhat.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Message-Id: <20190131164614.19209-3-cfergeau@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      f5852efa
  16. Apr 02, 2019
    • Markus Armbruster's avatar
      vl: Document dependencies hiding in global and compat props · 0427b625
      Markus Armbruster authored
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190401090827.20793-5-armbru@redhat.com>
      Reviewed-by: default avatarIgor Mammedov <imammedo@redhat.com>
      0427b625
    • Markus Armbruster's avatar
      Revert "migration: move only_migratable to MigrationState" · 811f8652
      Markus Armbruster authored
      
      This reverts commit 3df663e5.
      This reverts commit b605c47b.
      
      Command line option --only-migratable is for disallowing any
      configuration that can block migration.
      
      Initially, --only-migratable set global variable @only_migratable.
      
      Commit 3df663e5 "migration: move only_migratable to MigrationState"
      replaced it by MigrationState member @only_migratable.  That was a
      mistake.
      
      First, it doesn't make sense on the design level.  MigrationState
      captures the state of an individual migration, but --only-migratable
      isn't a property of an individual migration, it's a restriction on
      QEMU configuration.  With fault tolerance, we could have several
      migrations at once.  --only-migratable would certainly protect all of
      them.  Storing it in MigrationState feels inappropriate.
      
      Second, it contributes to a dependency cycle that manifests itself as
      a bug now.
      
      Putting @only_migratable into MigrationState means its available only
      after migration_object_init().
      
      We can't set it before migration_object_init(), so we delay setting it
      with a global property (this is fixup commit b605c47b "migration:
      fix handling for --only-migratable").
      
      We can't get it before migration_object_init(), so anything that uses
      it can only run afterwards.
      
      Since migrate_add_blocker() needs to obey --only-migratable, any code
      adding migration blockers can run only afterwards.  This contributes
      to the following dependency cycle:
      
      * configure_blockdev() must run before machine_set_property()
        so machine properties can refer to block backends
      
      * machine_set_property() before configure_accelerator()
        so machine properties like kvm-irqchip get applied
      
      * configure_accelerator() before migration_object_init()
        so that Xen's accelerator compat properties get applied.
      
      * migration_object_init() before configure_blockdev()
        so configure_blockdev() can add migration blockers
      
      The cycle was closed when recent commit cda4aa9a "Create block
      backends before setting machine properties" added the first
      dependency, and satisfied it by violating the last one.  Broke block
      backends that add migration blockers.
      
      Moving @only_migratable into MigrationState was a mistake.  Revert it.
      
      This doesn't quite break the "migration_object_init() before
      configure_blockdev() dependency, since migrate_add_blocker() still has
      another dependency on migration_object_init().  To be addressed the
      next commit.
      
      Note that the reverted commit made -only-migratable sugar for -global
      migration.only-migratable=on below the hood.  Documentation has only
      ever mentioned -only-migratable.  This commit removes the arcane &
      undocumented alternative to -only-migratable again.  Nobody should be
      using it.
      
      Conflicts:
      	include/migration/misc.h
      	migration/migration.c
      	migration/migration.h
      	vl.c
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190401090827.20793-3-armbru@redhat.com>
      Reviewed-by: default avatarIgor Mammedov <imammedo@redhat.com>
      811f8652
    • Markus Armbruster's avatar
      Revert "vl: Fix to create migration object before block backends again" · 2fa23277
      Markus Armbruster authored
      
      This reverts commit e60483f2.
      
      Recent commit cda4aa9a moved block backend creation before machine
      property evaluation.  This broke block backends registering migration
      blockers.  Commit e60483f2 fixed it by moving migration object
      creation before block backend creation.  This broke migration with
      Xen.  Turns out we need to configure the accelerator before we create
      the migration object so that Xen's accelerator compat properties get
      applied.  Revert the flawed commit.  This fixes the Xen regression,
      but brings back the block backend regression.  The next commits will
      fix it again.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190401090827.20793-2-armbru@redhat.com>
      Reviewed-by: default avatarIgor Mammedov <imammedo@redhat.com>
      2fa23277
    • Markus Armbruster's avatar
      vl: Fix error location of positional arguments · 17f30eae
      Markus Armbruster authored
      
      We blame badness in positional arguments on the last option argument:
      
          $ qemu-system-x86_64 -vnc :1 bad.img
          qemu-system-x86_64: -vnc :1: Could not open 'foo': No such file or directory
      
      I believe we've done this ever since we reported locations.  Fix it to
      
          qemu-system-x86_64: bad.img: Could not open 'bad.img': No such file or directory
      
      Reported-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190318183312.4684-1-armbru@redhat.com>
      Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
      17f30eae
  17. Mar 19, 2019
  18. Mar 13, 2019
  19. Mar 11, 2019
    • Markus Armbruster's avatar
      vl: Create block backends before setting machine properties · cda4aa9a
      Markus Armbruster authored
      
      qemu-system-FOO's main() acts on command line arguments in its own
      idiosyncratic order.  There's not much method to its madness.
      Whenever we find a case where one kind of command line argument needs
      to refer to something created for another kind later, we rejigger the
      order.
      
      Block devices get created long after machine properties get processed.
      Therefore, block device machine properties can be created, but not
      set.  No such properties exist.  But the next commit will create some.
      Time to rejigger again: create block devices earlier.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Message-Id: <20190308131445.17502-8-armbru@redhat.com>
      Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      cda4aa9a
    • Markus Armbruster's avatar
      vl: Factor configure_blockdev() out of main() · d11bf9bf
      Markus Armbruster authored
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Message-Id: <20190308131445.17502-7-armbru@redhat.com>
      Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      d11bf9bf
    • Markus Armbruster's avatar
      vl: Improve legibility of BlockdevOptions queue · 651af51c
      Markus Armbruster authored
      
      Give the queue head type a name: BlockdevOptionsQueue.
      
      Rename the queue entry type from BlockdevOptions_queue to
      BlockdevOptionsQueueEntry.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190308131445.17502-6-armbru@redhat.com>
      Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      651af51c
    • Markus Armbruster's avatar
      sysbus: Fix latent bug with onboard devices · e2fb3fbb
      Markus Armbruster authored
      
      The first call of sysbus_get_default() creates the main system bus and
      stores it in QOM as "/machine/unattached/sysbus".  This must not
      happen before main() creates "/machine", or else container_get() would
      "helpfully" create it as "container" object, and the real creation of
      "/machine" would later abort with "attempt to add duplicate property
      'machine' to object (type 'container')".  Has been that way ever since
      we wired up busses in QOM (commit f968fc68, v1.2.0).
      
      I believe the bug is latent.  I got it to bite by trying to
      qdev_create() a sysbus device from a machine's .instance_init()
      method.
      
      The fix is obvious: store the main system bus in QOM right after
      creating "/machine".
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
      Message-Id: <20190308131445.17502-5-armbru@redhat.com>
      Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      e2fb3fbb
    • Markus Armbruster's avatar
      vl: Fix latent bug with -global and onboard devices · fc4a4734
      Markus Armbruster authored
      
      main() registers the user's -global only after we create the machine
      object, i.e. too late for devices created in the machine's
      .instance_init().
      
      Fortunately, we know the bug is only latent: the commit before
      previous fixed a bug that would've crashed any attempt to create a
      device in an .instance_init().
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <20190308131445.17502-4-armbru@redhat.com>
      Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      fc4a4734
    • Markus Armbruster's avatar
      qdev: Fix latent bug with compat_props and onboard devices · 1a3ec8c1
      Markus Armbruster authored
      
      Compatibility properties started life as a qdev property thing: we
      supported them only for qdev properties, and implemented them with the
      machinery backing command line option -global.
      
      Recent commit fa0cb34d put them to use (tacitly) with memory
      backend objects (subtypes of TYPE_MEMORY_BACKEND).  To make that
      possible, we first moved the work of applying them from the -global
      machinery into TYPE_DEVICE's .instance_post_init() method
      device_post_init(), in commits ea9ce893 and b66bbee3, then made
      it available to TYPE_MEMORY_BACKEND's .instance_post_init() method
      host_memory_backend_post_init() as object_apply_compat_props(), in
      commit 1c3994f6.
      
      Note the code smell: we now have function name starting with object_
      in hw/core/qdev.c.  It has to be there rather than in qom/, because it
      calls qdev_get_machine() to find the current accelerator's and
      machine's compat_props.
      
      Turns out calling qdev_get_machine() there is problematic.  If we
      qdev_create() from a machine's .instance_init() method, we call
      device_post_init() and thus qdev_get_machine() before main() can
      create "/machine" in QOM.  qdev_get_machine() tries to get it with
      container_get(), which "helpfully" creates it as "container" object,
      and returns that.  object_apply_compat_props() tries to paper over the
      problem by doing nothing when the value of qdev_get_machine() isn't a
      TYPE_MACHINE.  But the damage is done already: when main() later
      attempts to create the real "/machine", it fails with "attempt to add
      duplicate property 'machine' to object (type 'container')", and
      aborts.
      
      Since no machine .instance_init() calls qdev_create() so far, the bug
      is latent.  But since I want to do that, I get to fix the bug first.
      
      Observe that object_apply_compat_props() doesn't actually need the
      MachineState, only its the compat_props member of its MachineClass and
      AccelClass.  This permits a simple fix: register MachineClass and
      AccelClass compat_props with the object_apply_compat_props() machinery
      right after these classes get selected.
      
      This is actually similar to how things worked before commits
      ea9ce893 and b66bbee3, except we now register much earlier.  The
      old code registered them only after the machine's .instance_init()
      ran, which would've broken compatibility properties for any devices
      created there.
      
      Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <20190308131445.17502-2-armbru@redhat.com>
      Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      1a3ec8c1
    • Philippe Mathieu-Daudé's avatar
      hw/nvram/fw_cfg: Remove the unnecessary boot_splash_filedata_size · 96f209b9
      Philippe Mathieu-Daudé authored
      
      The 'boot_splash_filedata_size' was introduced as a global variable
      in 3d3b8303. This variable is used as a 'size' argument to the
      fw_cfg_add_file(). This function has an interface contract with its
      'data' argument, but there is no such contract for 'size' (this is
      not a referenced pointer).  We can simply remove it.
      
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
      Reviewed-by: default avatarLaszlo Ersek <lersek@redhat.com>
      Message-Id: <20190308013222.12524-7-philmd@redhat.com>
      Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
      96f209b9
    • Kővágó, Zoltán's avatar
      audio: -audiodev command line option basic implementation · 71830221
      Kővágó, Zoltán authored
      
      Audio drivers now get an Audiodev * as config paramters, instead of the
      global audio_option structs.  There is some code in audio/audio_legacy.c
      that converts the old environment variables to audiodev options (this
      way backends do not have to worry about legacy options).  It also
      contains a replacement of -audio-help, which prints out the equivalent
      -audiodev based config of the currently specified environment variables.
      
      Note that backends are not updated and still rely on environment
      variables.
      
      Also note that (due to moving try-poll from global to backend specific
      option) currently ALSA and OSS will always try poll mode, regardless of
      environment variables or -audiodev options.
      
      Signed-off-by: default avatarKővágó, Zoltán <DirtY.iCE.hu@gmail.com>
      Message-id: e99a7cbdac0d13512743880660b2032024703e4c.1552083282.git.DirtY.iCE.hu@gmail.com
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      71830221
Loading