1. 16 3月, 2019 1 次提交
  2. 07 3月, 2019 1 次提交
    • D
      nbd: allow authorization with nbd-server-start QMP command · 00019455
      Daniel P. Berrange 提交于
      As with the previous patch to qemu-nbd, the nbd-server-start QMP command
      also needs to be able to specify authorization when enabling TLS encryption.
      
      First the client must create a QAuthZ object instance using the
      'object-add' command:
      
         {
           'execute': 'object-add',
           'arguments': {
             'qom-type': 'authz-list',
             'id': 'authz0',
             'parameters': {
               'policy': 'deny',
               'rules': [
                 {
                   'match': '*CN=fred',
                   'policy': 'allow'
                 }
               ]
             }
           }
         }
      
      They can then reference this in the new 'tls-authz' parameter when
      executing the 'nbd-server-start' command:
      
         {
           'execute': 'nbd-server-start',
           'arguments': {
             'addr': {
                 'type': 'inet',
                 'host': '127.0.0.1',
                 'port': '9000'
             },
             'tls-creds': 'tls0',
             'tls-authz': 'authz0'
           }
         }
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJuan Quintela <quintela@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <20190227162035.18543-3-berrange@redhat.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      00019455
  3. 06 3月, 2019 1 次提交
  4. 05 3月, 2019 2 次提交
  5. 14 2月, 2019 1 次提交
  6. 13 2月, 2019 1 次提交
  7. 23 1月, 2019 1 次提交
  8. 15 1月, 2019 1 次提交
    • 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
  9. 18 12月, 2018 1 次提交
    • 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
  10. 12 12月, 2018 1 次提交
  11. 12 10月, 2018 1 次提交
  12. 26 9月, 2018 1 次提交
  13. 25 9月, 2018 3 次提交
    • D
      qmp, hmp: add PCI subsystem id and vendor id to PCI info · 5383a705
      Denis V. Lunev 提交于
      This is a long story. Red Hat has relicensed Windows KVM device drivers
      in 2018 and there was an agreement that to avoid WHQL driver conflict
      software manufacturers should set proper PCI subsystem vendor ID in
      their distributions. Thus PCI subsystem vendor id becomes actively used.
      
      The problem is that this field is applied by us via hardware compats.
      Thus technically it could be lost.
      
      This patch adds PCI susbsystem id and vendor id to exportable parameters
      for validation.
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      CC: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
      CC: Eric Blake <eblake@redhat.com>
      CC: Markus Armbruster <armbru@redhat.com>
      Message-Id: <20180918095852.28422-1-den@openvz.org>
      Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      5383a705
    • M
      hmp: fix migrate status timer leak · d34a10af
      Marc-André Lureau 提交于
      Spotted by ASAN doing some manual testing:
      
      Direct leak of 48 byte(s) in 1 object(s) allocated from:
          #0 0x7f5fcdc75e50 in calloc (/lib64/libasan.so.5+0xeee50)
          #1 0x7f5fcd47241d in g_malloc0 (/lib64/libglib-2.0.so.0+0x5241d)
          #2 0x55f989be92ce in timer_new /home/elmarco/src/qq/include/qemu/timer.h:561
          #3 0x55f989be92ff in timer_new_ms /home/elmarco/src/qq/include/qemu/timer.h:630
          #4 0x55f989c0219d in hmp_migrate /home/elmarco/src/qq/hmp.c:2038
          #5 0x55f98955927b in handle_hmp_command /home/elmarco/src/qq/monitor.c:3498
          #6 0x55f98955fb8c in monitor_command_cb /home/elmarco/src/qq/monitor.c:4371
          #7 0x55f98ad40f11 in readline_handle_byte /home/elmarco/src/qq/util/readline.c:393
          #8 0x55f98955fa4f in monitor_read /home/elmarco/src/qq/monitor.c:4354
          #9 0x55f98aae30d7 in qemu_chr_be_write_impl /home/elmarco/src/qq/chardev/char.c:175
          #10 0x55f98aae317a in qemu_chr_be_write /home/elmarco/src/qq/chardev/char.c:187
          #11 0x55f98aae940c in fd_chr_read /home/elmarco/src/qq/chardev/char-fd.c:66
          #12 0x55f98ab63018 in qio_channel_fd_source_dispatch /home/elmarco/src/qq/io/channel-watch.c:84
          #13 0x7f5fcd46c8ac in g_main_dispatch gmain.c:3177
      Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <20180901134652.25884-1-marcandre.lureau@redhat.com>
      Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      d34a10af
    • J
      qapi/block-stream: expose new job properties · 241ca1ab
      John Snow 提交于
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 20180906130225.5118-15-jsnow@redhat.com
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      241ca1ab
  14. 24 8月, 2018 1 次提交
  15. 22 8月, 2018 2 次提交
  16. 16 7月, 2018 1 次提交
  17. 04 7月, 2018 1 次提交
    • M
      qapi: add conditions to VNC type/commands/events on the schema · 05eb4a25
      Marc-André Lureau 提交于
      Add #if defined(CONFIG_VNC) in generated code, and adjust the
      qmp/hmp code accordingly.
      
      query-qmp-schema no longer reports the command/events etc as
      available when disabled at compile.
      
      Commands made conditional:
      
      * query-vnc, query-vnc-servers, change-vnc-password
      
        Before the patch, the commands for !CONFIG_VNC are stubs that fail
        like this:
      
          {"error": {"class": "GenericError",
                     "desc": "The feature 'vnc' is not enabled"}}
      
        Afterwards, they fail like this:
      
          {"error": {"class": "CommandNotFound",
                     "desc": "The command FOO has not been found"}}
      
        I call that an improvement, because it lets clients distinguish
        between command unavailable (class CommandNotFound) and command failed
        (class GenericError).
      
      Events made conditional:
      
      * VNC_CONNECTED, VNC_INITIALIZED, VNC_DISCONNECTED
      
      HMP change:
      
      * info vnc
      
        Will return "unknown command: 'info vnc'" when VNC is compiled
        out (same as error for spice when --disable-spice)
      
      Occurrences of VNC (case insensitive) in the schema that aren't
      covered by this change:
      
      * add_client
      
        Command has other uses, including "socket bases character devices".
        These are unconditional as far as I can tell.
      
      * set_password, expire_password
      
        In theory, these commands could be used for managing any service's
        password.  In practice, they're used for VNC and SPICE services.
        They're documented for "remote display session" / "remote display
        server".
      
        The service is selected by argument @protocol.  The code special-cases
        protocol-specific argument checking, then calls a protocol-specific
        function to do the work.  If it fails, the command fails with "Could
        not set password".  It does when the service isn't compiled in (it's a
        stub then).
      
        We could make these commands conditional on the conjunction of all
        services [currently: defined(CONFIG_VNC) || defined(CONFIG_SPICE)],
        but I doubt it's worthwhile.
      
      * change
      
        Command has other uses, namely changing media.
        This patch inlines a stub; no functional change.
      Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Reviewed-by: NGerd Hoffmann <kraxel@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20180703155648.11933-14-marcandre.lureau@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      05eb4a25
  18. 29 6月, 2018 2 次提交
  19. 27 6月, 2018 1 次提交
  20. 21 6月, 2018 1 次提交
  21. 15 6月, 2018 1 次提交
  22. 16 5月, 2018 3 次提交
  23. 15 5月, 2018 1 次提交
  24. 26 4月, 2018 1 次提交
  25. 27 3月, 2018 1 次提交
  26. 20 3月, 2018 2 次提交
  27. 12 3月, 2018 1 次提交
  28. 03 3月, 2018 3 次提交
    • M
      qapi: Move qapi-schema.json to qapi/, rename generated files · eb815e24
      Markus Armbruster 提交于
      Move qapi-schema.json to qapi/, so it's next to its modules, and all
      files get generated to qapi/, not just the ones generated for modules.
      
      Consistently name the generated files qapi-MODULE.EXT:
      qmp-commands.[ch] become qapi-commands.[ch], qapi-event.[ch] become
      qapi-events.[ch], and qmp-introspect.[ch] become qapi-introspect.[ch].
      This gets rid of the temporary hacks in scripts/qapi/commands.py,
      scripts/qapi/events.py, and scripts/qapi/common.py.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20180211093607.27351-28-armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Reviewed-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      [eblake: Fix trailing dot in tpm.c, undo temporary hack for OSX toolchain]
      Signed-off-by: NEric Blake <eblake@redhat.com>
      eb815e24
    • M
      qapi: Empty out qapi-schema.json · 112ed241
      Markus Armbruster 提交于
      The previous commit improved compile time by including less of the
      generated QAPI headers.  This is impossible for stuff defined directly
      in qapi-schema.json, because that ends up in headers that that pull in
      everything.
      
      Move everything but include directives from qapi-schema.json to new
      sub-module qapi/misc.json, then include just the "misc" shard where
      possible.
      
      It's possible everywhere, except:
      
      * monitor.c needs qmp-command.h to get qmp_init_marshal()
      
      * monitor.c, ui/vnc.c and the generated qapi-event-FOO.c need
        qapi-event.h to get enum QAPIEvent
      
      Perhaps we'll get rid of those some other day.
      
      Adding a type to qapi/migration.json now recompiles some 120 instead
      of 2300 out of 5100 objects.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20180211093607.27351-25-armbru@redhat.com>
      [eblake: rebase to master]
      Signed-off-by: NEric Blake <eblake@redhat.com>
      112ed241
    • M
      Include less of the generated modular QAPI headers · 9af23989
      Markus Armbruster 提交于
      In my "build everything" tree, a change to the types in
      qapi-schema.json triggers a recompile of about 4800 out of 5100
      objects.
      
      The previous commit split up qmp-commands.h, qmp-event.h, qmp-visit.h,
      qapi-types.h.  Each of these headers still includes all its shards.
      Reduce compile time by including just the shards we actually need.
      
      To illustrate the benefits: adding a type to qapi/migration.json now
      recompiles some 2300 instead of 4800 objects.  The next commit will
      improve it further.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20180211093607.27351-24-armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      [eblake: rebase to master]
      Signed-off-by: NEric Blake <eblake@redhat.com>
      9af23989
  29. 26 2月, 2018 1 次提交
  30. 09 2月, 2018 1 次提交