1. 18 2月, 2019 2 次提交
  2. 14 2月, 2019 1 次提交
  3. 12 2月, 2019 1 次提交
  4. 01 2月, 2019 2 次提交
  5. 31 1月, 2019 1 次提交
  6. 24 1月, 2019 3 次提交
    • R
      input-linux: customizable grab toggle keys · 2657846f
      Ryan El Kochta 提交于
      This patch adds a new option to the input-linux object:
      
      grab-toggle=[key-combo]
      
      The key combination can be one of the following:
      
      * ctrl-ctrl
      * alt-alt
      * meta-meta
      * scrolllock
      * ctrl-scrolllock
      
      The user can pick any of these key combinations. The VM's grab
      of the evdev device will be toggled when the key combination is
      pressed.
      
      Any invalid setting will result in an error. No setting will
      result in the current default of ctrl-ctrl.
      
      The right and left ctrl key both work for Ctrl-Scrolllock.
      
      If scrolllock is selected as one of the grab-toggle keys, it
      will be entirely disabled and not passed to the guest at all.
      This is to prevent enabling it while attempting to leave or enter
      the VM. On the host, scrolllock can be disabled using xmodmap.
      
      First, find the modifier that Scroll_Lock is bound to:
      
      $ xmodmap -pm
      
      Then, remove Scroll_Lock from it, replacing modX with the modifier:
      
      $ xmodmap -e 'remove modX = Scroll_Lock'
      
      If Scroll_Lock is not bound to any modifier, it is already disabled.
      
      To save the changes, add them to your xinitrc.
      
      Ryan El Kochta (1):
        input-linux: customizable grab toggle keys v5
      Signed-off-by: NRyan El Kochta <relkochta@gmail.com>
      Message-id: 20190123214555.12712-2-relkochta@gmail.com
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      2657846f
    • W
      qmp: Add examples to qom list, get, and set commands · dd49d9d8
      Wainer dos Santos Moschetta 提交于
      Added examples for the qom-list, qom-get, and qom-set
      commands in qapi misc JSON file.
      Signed-off-by: NWainer dos Santos Moschetta <wainersm@redhat.com>
      Message-Id: <20181228194442.3506-1-wainersm@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      dd49d9d8
    • M
      qapi: Eliminate indirection through qmp_event_get_func_emit() · a9529100
      Markus Armbruster 提交于
      The qapi_event_send_FOO() functions emit events like this:
      
          QMPEventFuncEmit emit;
      
          emit = qmp_event_get_func_emit();
          if (!emit) {
              return;
          }
      
          qmp = qmp_event_build_dict("FOO");
          [put event arguments into @qmp...]
      
          emit(QAPI_EVENT_FOO, qmp);
      
      The value of qmp_event_get_func_emit() depends only on the program:
      
      * In qemu-system-FOO, it's always monitor_qapi_event_queue.
      
      * In tests/test-qmp-event, it's always event_test_emit.
      
      * In all other programs, it's always null.
      
      This is exactly the kind of dependence the linker is supposed to
      resolve; we don't actually need an indirection.
      
      Note that things would fall apart if we linked more than one QAPI
      schema into a single program: each set of qapi_event_send_FOO() uses
      its own event enumeration, yet they share a single emit function.
      Which takes the event enumeration as an argument.  Which one if
      there's more than one?
      
      More seriously: how does this work even now?  qemu-system-FOO wants
      QAPIEvent, and passes a function taking that to
      qmp_event_set_func_emit().  test-qmp-event wants test_QAPIEvent, and
      passes a function taking that to qmp_event_set_func_emit().
      
      It works by type trickery, of course:
      
          typedef void (*QMPEventFuncEmit)(unsigned event, QDict *dict);
      
          void qmp_event_set_func_emit(QMPEventFuncEmit emit);
      
          QMPEventFuncEmit qmp_event_get_func_emit(void);
      
      We use unsigned instead of the enumeration type.  Relies on both
      enumerations boiling down to unsigned, which happens to be true for
      the compilers we use.
      
      Clean this up as follows:
      
      * Generate qapi_event_send_FOO() that call PREFIX_qapi_event_emit()
        instead of the value of qmp_event_set_func_emit().
      
      * Generate a prototype for PREFIX_qapi_event_emit() into
        qapi-events.h.
      
      * PREFIX_ is empty for qapi/qapi-schema.json, and test_ for
        tests/qapi-schema/qapi-schema-test.json.  It's qga_ for
        qga/qapi-schema.json, and doc-good- for
        tests/qapi-schema/doc-good.json, but those don't define any events.
      
      * Rename monitor_qapi_event_queue() to qapi_event_emit() instead of
        passing it to qmp_event_set_func_emit().  This takes care of
        qemu-system-FOO.
      
      * Rename event_test_emit() to test_qapi_event_emit() instead of
        passing it to qmp_event_set_func_emit().  This takes care of
        tests/test-qmp-event.
      
      * Add a qapi_event_emit() that does nothing to stubs/monitor.c.  This
        takes care of all other programs that link code emitting QMP events.
      
      * Drop qmp_event_set_func_emit(), qmp_event_get_func_emit().
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20181218182234.28876-3-armbru@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      [Commit message typos fixed]
      a9529100
  7. 23 1月, 2019 1 次提交
  8. 15 1月, 2019 4 次提交
    • E
      nbd: Remove x-nbd-server-add-bitmap · 7dc570b3
      Eric Blake 提交于
      Now that nbd-server-add can do the same functionality (well, other
      than making the exported bitmap name different than the underlying
      bitamp - but we argued that was not essential, since it is just as
      easy to create a new non-persistent bitmap with the desired name),
      we no longer need the experimental separate command.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-Id: <20190111194720.15671-7-eblake@redhat.com>
      7dc570b3
    • E
      nbd: Allow bitmap export during QMP nbd-server-add · 5fcbeb06
      Eric Blake 提交于
      With the experimental x-nbd-server-add-bitmap command, there was
      a window of time where an NBD client could see the export but not
      the associated dirty bitmap, which can cause a client that planned
      on using the dirty bitmap to be forced to treat the entire image
      as dirty as a safety fallback.  Furthermore, if the QMP client
      successfully exports a disk but then fails to add the bitmap, it
      has to take on the burden of removing the export.  Since we don't
      allow changing the exposed dirty bitmap (whether to a different
      bitmap, or removing advertisement of the bitmap), it is nicer to
      make the bitmap tied to the export at the time the export is
      created, with automatic failure to export if the bitmap is not
      available.
      
      The experimental command included an optional 'bitmap-export-name'
      field for remapping the name exposed over NBD to be different from
      the bitmap name stored on disk.  However, my libvirt demo code
      for implementing differential backups on top of persistent bitmaps
      did not need to take advantage of that feature (it is instead
      possible to create a new temporary bitmap with the desired name,
      use block-dirty-bitmap-merge to merge one or more persistent
      bitmaps into the temporary, then associate the temporary with the
      NBD export, if control is needed over the exported bitmap name).
      Hence, I'm not copying that part of the experiment over to the
      stable addition. For more details on the libvirt demo, see
      https://www.redhat.com/archives/libvir-list/2018-October/msg01254.html,
      https://kvmforum2018.sched.com/event/FzuB/facilitating-incremental-backup-eric-blake-red-hat
      
      This patch focuses on the user interface, and reduces (but does
      not completely eliminate) the window where an NBD client can see
      the export but not the dirty bitmap, with less work to clean up
      after errors.  Later patches will add further cleanups now that
      this interface is declared stable via a single QMP command,
      including removing the race window.
      
      Update test 223 to use the new interface.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-Id: <20190111194720.15671-6-eblake@redhat.com>
      5fcbeb06
    • J
      block: remove 'x' prefix from experimental bitmap APIs · 0e2b7f09
      John Snow 提交于
      The 'x' prefix was added because I was uncertain of the direction we'd
      take for the libvirt API. With the general approach solidified, I feel
      comfortable committing to this API for 4.0.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-Id: <20181221093529.23855-5-jsnow@redhat.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      0e2b7f09
    • J
      blockdev: n-ary bitmap merge · 360d4e4e
      John Snow 提交于
      Especially outside of transactions, it is helpful to provide
      all-or-nothing semantics for bitmap merges. This facilitates
      the coalescing of multiple bitmaps into a single target for
      the "checkpoint" interpretation when assembling bitmaps that
      represent arbitrary points in time from component bitmaps.
      
      This is an incompatible change from the preliminary version
      of the API.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-Id: <20181221093529.23855-4-jsnow@redhat.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      360d4e4e
  9. 22 12月, 2018 1 次提交
  10. 20 12月, 2018 1 次提交
  11. 18 12月, 2018 5 次提交
    • D
      qmp hmp: Make system_wakeup check wake-up support and run state · fb064112
      Daniel Henrique Barboza 提交于
      The qmp/hmp command 'system_wakeup' is simply a direct call to
      'qemu_system_wakeup_request' from vl.c. This function verifies if
      runstate is SUSPENDED and if the wake up reason is valid before
      proceeding. However, no error or warning is thrown if any of those
      pre-requirements isn't met. There is no way for the caller to
      differentiate between a successful wakeup or an error state caused
      when trying to wake up a guest that wasn't suspended.
      
      This means that system_wakeup is silently failing, which can be
      considered a bug. Adding error handling isn't an API break in this
      case - applications that didn't check the result will remain broken,
      the ones that check it will have a chance to deal with it.
      
      Adding to that, the commit before previous created a new QMP API called
      query-current-machine, with a new flag called wakeup-suspend-support,
      that indicates if the guest has the capability of waking up from suspended
      state. Although such guest will never reach SUSPENDED state and erroring
      it out in this scenario would suffice, it is more informative for the user
      to differentiate between a failure because the guest isn't suspended versus
      a failure because the guest does not have support for wake up at all.
      
      All this considered, this patch changes qmp_system_wakeup to check if
      the guest is capable of waking up from suspend, and if it is suspended.
      After this patch, this is the output of system_wakeup in a guest that
      does not have wake-up from suspend support (ppc64):
      
      (qemu) system_wakeup
      wake-up from suspend is not supported by this guest
      (qemu)
      
      And this is the output of system_wakeup in a x86 guest that has the
      support but isn't suspended:
      
      (qemu) system_wakeup
      Unable to wake up: guest is not in suspended state
      (qemu)
      Reported-by: NBalamuruhan S <bala24@linux.vnet.ibm.com>
      Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
      Message-Id: <20181205194701.17836-4-danielhb413@gmail.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Acked-by: NEduardo Habkost <ehabkost@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      fb064112
    • D
      qmp: query-current-machine with wakeup-suspend-support · 46ea94ca
      Daniel Henrique Barboza 提交于
      When issuing the qmp/hmp 'system_wakeup' command, what happens in a
      nutshell is:
      
      - qmp_system_wakeup_request set runstate to RUNNING, sets a wakeup_reason
      and notify the event
      - in the main_loop, all vcpus are paused, a system reset is issued, all
      subscribers of wakeup_notifiers receives a notification, vcpus are then
      resumed and the wake up QAPI event is fired
      
      Note that this procedure alone doesn't ensure that the guest will awake
      from SUSPENDED state - the subscribers of the wake up event must take
      action to resume the guest, otherwise the guest will simply reboot. At
      this moment, only the ACPI machines via acpi_pm1_cnt_init and xen_hvm_init
      have wake-up from suspend support.
      
      However, only the presence of 'system_wakeup' is required for QGA to
      support 'guest-suspend-ram' and 'guest-suspend-hybrid' at this moment.
      This means that the user/management will expect to suspend the guest using
      one of those suspend commands and then resume execution using system_wakeup,
      regardless of the support offered in system_wakeup in the first place.
      
      This patch creates a new API called query-current-machine [1], that holds
      a new flag called 'wakeup-suspend-support' that indicates if the guest
      supports wake up from suspend via system_wakeup. The machine is considered
      to implement wake-up support if a call to a new 'qemu_register_wakeup_support'
      is made during its init, as it is now being done inside acpi_pm1_cnt_init
      and xen_hvm_init. This allows for any other machine type to declare wake-up
      support regardless of ACPI state or wakeup_notifiers subscription, making easier
      for newer implementations that might have their own mechanisms in the future.
      
      This is the expected output of query-current-machine when running a x86
      guest:
      
      {"execute" : "query-current-machine"}
      {"return": {"wakeup-suspend-support": true}}
      
      Running the same x86 guest, but with the --no-acpi option:
      
      {"execute" : "query-current-machine"}
      {"return": {"wakeup-suspend-support": false}}
      
      This is the output when running a pseries guest:
      
      {"execute" : "query-current-machine"}
      {"return": {"wakeup-suspend-support": false}}
      
      With this extra tool, management can avoid situations where a guest
      that does not have proper suspend/wake capabilities ends up in
      inconsistent state (e.g.
      https://github.com/open-power-host-os/qemu/issues/31).
      
      [1] the decision of creating the query-current-machine API is based
      on discussions in the QEMU mailing list where it was decided that
      query-target wasn't a proper place to store the wake-up flag, neither
      was query-machines because this isn't a static property of the
      machine object. This new API can then be used to store other
      dynamic machine properties that are scattered around the code
      ATM. More info at:
      https://lists.gnu.org/archive/html/qemu-devel/2018-05/msg04235.htmlReported-by: NBalamuruhan S <bala24@linux.vnet.ibm.com>
      Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
      Message-Id: <20181205194701.17836-2-danielhb413@gmail.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Acked-by: NEduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      46ea94ca
    • D
      qmp: Split ShutdownCause host-qmp into quit and system-reset · 92548938
      Dominik Csapak 提交于
      It is interesting to know whether the shutdown cause was 'quit' or
      'reset', especially when using "--no-reboot". In that case, a management
      layer can now determine if the guest wanted a reboot or shutdown, and
      can act accordingly.
      
      Changes the output of the reason in the iotests from 'host-qmp' to
      'host-qmp-quit'. This does not break compatibility because
      the field was introduced in the same version.
      Signed-off-by: NDominik Csapak <d.csapak@proxmox.com>
      Message-Id: <20181205110131.23049-4-d.csapak@proxmox.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      [Commit message tweaked]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      92548938
    • D
      qmp: Add reason to SHUTDOWN and RESET events · ecd7a0d5
      Dominik Csapak 提交于
      This makes it possible to determine what the exact reason was for
      a RESET or a SHUTDOWN. A management layer might need the specific reason
      of those events to determine which cleanups or other actions it needs to do.
      
      This patch also updates the iotests to the new expected output that includes
      the reason.
      Signed-off-by: NDominik Csapak <d.csapak@proxmox.com>
      Message-Id: <20181205110131.23049-3-d.csapak@proxmox.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      [Commit message tweaked]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      ecd7a0d5
    • D
      qapi: Turn ShutdownCause into QAPI enum · d43013e2
      Dominik Csapak 提交于
      Needed so the patch after next can add ShutdownCause to QMP events
      SHUTDOWN and RESET.
      Signed-off-by: NDominik Csapak <d.csapak@proxmox.com>
      Message-Id: <20181205110131.23049-2-d.csapak@proxmox.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      d43013e2
  12. 14 12月, 2018 6 次提交
  13. 12 12月, 2018 3 次提交
    • A
      crypto: Fix defaults in QCryptoBlockCreateOptionsLUKS · a8b826d4
      Alberto Garcia 提交于
      The values specified in the documentation don't match the actual
      defaults set in qcrypto_block_luks_create().
      Signed-off-by: NAlberto Garcia <berto@igalia.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      a8b826d4
    • P
      monitor: Suspend monitor instead dropping commands · 9ab84470
      Peter Xu 提交于
      When a QMP client sends in-band commands more quickly that we can
      process them, we can either queue them without limit (QUEUE), drop
      commands when the queue is full (DROP), or suspend receiving commands
      when the queue is full (SUSPEND).  None of them is ideal:
      
      * QUEUE lets a misbehaving client make QEMU eat memory without bounds.
      Not such a hot idea.
      
      * With DROP, the client has to cope with dropped in-band commands.  To
      inform the client, we send a COMMAND_DROPPED event then.  The event is
      flawed by design in two ways: it's ambiguous (see commit d621cfe0),
      and it brings back the "eat memory without bounds" problem.
      
      * With SUSPEND, the client has to manage the flow of in-band commands to
      keep the monitor available for out-of-band commands.
      
      We currently DROP.  Switch to SUSPEND.
      
      Managing the flow of in-band commands to keep the monitor available for
      out-of-band commands isn't really hard: just count the number of
      "outstanding" in-band commands (commands sent minus replies received),
      and if it exceeds the limit, hold back additional ones until it drops
      below the limit again.
      
      Note that we need to be careful pairing the suspend with a resume, or
      else the monitor will hang, possibly forever.  And here since we need to
      make sure both:
      
           (1) popping request from the req queue, and
           (2) reading length of the req queue
      
      will be in the same critical section, we let the pop function take the
      corresponding queue lock when there is a request, then we release the
      lock from the caller.
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: NPeter Xu <peterx@redhat.com>
      Message-Id: <20181009062718.1914-2-peterx@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      9ab84470
    • K
      Deprecate QMP `cpu-add` · 3800db78
      Kashyap Chamarthy 提交于
      The intended functionality of QMP `cpu-add` is replaced with
      `device_add` (and `query-hotpluggable-cpus`).  So let's deprecate
      `cpu-add`.
      
      A complete example of vCPU hotplug with the recommended way (using
      `device_add`) is provided as part of a seperate docs patch.
      
      Suggested-by: Eduardo Habkost <ehabkost@redhat.com
      Signed-off-by: NKashyap Chamarthy <kchamart@redhat.com>
      Message-Id: <20181030123526.26415-2-kchamart@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      3800db78
  14. 27 11月, 2018 1 次提交
  15. 16 11月, 2018 1 次提交
  16. 05 11月, 2018 1 次提交
    • K
      block: Add auto-read-only option · e35bdc12
      Kevin Wolf 提交于
      If a management application builds the block graph node by node, the
      protocol layer doesn't inherit its read-only option from the format
      layer any more, so it must be set explicitly.
      
      Backing files should work on read-only storage, but at the same time, a
      block job like commit should be able to reopen them read-write if they
      are on read-write storage. However, without option inheritance, reopen
      only changes the read-only option for the root node (typically the
      format layer), but not the protocol layer, so reopening fails (the
      format layer wants to get write permissions, but the protocol layer is
      still read-only).
      
      A simple workaround for the problem in the management tool would be to
      open the protocol layer always read-write and to make only the format
      layer read-only for backing files. However, sometimes the file is
      actually stored on read-only storage and we don't know whether the image
      can be opened read-write (for example, for NBD it depends on the server
      we're trying to connect to). This adds an option that makes QEMU try to
      open the image read-write, but allows it to degrade to a read-only mode
      without returning an error.
      
      The documentation for this option is consciously phrased in a way that
      allows QEMU to switch to a better model eventually: Instead of trying
      when the image is first opened, making the read-only flag dynamic and
      changing it automatically whenever the first BLK_PERM_WRITE user is
      attached or the last one is detached would be much more useful
      behaviour.
      
      Unfortunately, this more useful behaviour is also a lot harder to
      implement, and libvirt needs a solution now before it can switch to
      -blockdev, so let's start with this easier approach for now.
      
      Instead of adding a new auto-read-only option, turning the existing
      read-only into an enum (with a bool alternate for compatibility) was
      considered, but it complicated the implementation to the point that it
      didn't seem to be worth it.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      e35bdc12
  17. 01 11月, 2018 1 次提交
  18. 31 10月, 2018 1 次提交
  19. 30 10月, 2018 2 次提交
  20. 24 10月, 2018 1 次提交
  21. 22 10月, 2018 1 次提交