Skip to content
Snippets Groups Projects
  1. May 31, 2017
    • Markus Armbruster's avatar
      qobject-input-visitor: Reject non-finite numbers with keyval · 5891c388
      Markus Armbruster authored
      
      The QObject input visitor can produce only finite numbers when its
      input comes out of the JSON parser, because the the JSON parser
      implements RFC 7159, which provides no syntax for infinity and NaN.
      
      However, it can produce infinity and NaN when its input comes out of
      keyval_parse(), because we parse with strtod() then.
      
      The keyval variant should not be able to express things the JSON
      variant can't.  Rejecting non-finite numbers there is the conservative
      fix.  It's also minimally invasive.
      
      We could instead extend our JSON dialect to provide for infinity and
      NaN.  Not today.
      
      Note that the JSON formatter can emit non-finite numbers (marked FIXME
      in commit 6e8e5cb9).
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1495471335-23707-2-git-send-email-armbru@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      5891c388
  2. May 23, 2017
    • Eric Blake's avatar
      shutdown: Expose bool cause in SHUTDOWN and RESET events · 08fba7ac
      Eric Blake authored
      Libvirt would like to be able to distinguish between a SHUTDOWN
      event triggered solely by guest request and one triggered by a
      SIGTERM or other action on the host.  While qemu_kill_report() was
      already able to give different output to stderr based on whether a
      shutdown was triggered by a host signal (but NOT by a host UI event,
      such as clicking the X on the window), that information was then
      lost to management.  The previous patches improved things to use an
      enum throughout all callsites, so now we have something ready to
      expose through QMP.
      
      Note that for now, the decision was to expose ONLY a boolean,
      rather than promoting ShutdownCause to a QAPI enum; this is because
      libvirt has not expressed an interest in anything finer-grained.
      We can still add additional details, in a backwards-compatible
      manner, if a need later arises (if the addition happens before 2.10,
      we can replace the bool with an enum; otherwise, the enum will have
      to be in addition to the bool); this patch merely adds a helper
      shutdown_caused_by_guest() to map the internal enum into the
      external boolean.
      
      Update expected iotest outputs to match the new data (complete
      coverage of the affected tests is obtained by -raw, -qcow2, and -nbd).
      
      Here is output from 'virsh qemu-monitor-event --loop' with the
      patch installed:
      
      event SHUTDOWN at 1492639680.731251 for domain fedora_13: {"guest":true}
      event STOP at 1492639680.732116 for domain fedora_13: <null>
      event SHUTDOWN at 1492639680.732830 for domain fedora_13: {"guest":false}
      
      Note that libvirt runs qemu with -no-shutdown: the first SHUTDOWN event
      was triggered by an action I took directly in the guest (shutdown -h),
      at which point qemu stops the vcpus and waits for libvirt to do any
      final cleanups; the second SHUTDOWN event is the result of libvirt
      sending SIGTERM now that it has completed cleanup.  Libvirt is already
      smart enough to only feed the first qemu SHUTDOWN event to the end user
      (remember, virsh qemu-monitor-event is a low-level debugging interface
      that is explicitly unsupported by libvirt, so it sees things that normal
      end users do not); changing qemu to emit SHUTDOWN only once is outside
      the scope of this series.
      
      See also https://bugzilla.redhat.com/1384007
      
      
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Message-Id: <20170515214114.15442-6-eblake@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      08fba7ac
  3. May 17, 2017
  4. May 16, 2017
  5. May 11, 2017
  6. May 09, 2017
  7. Apr 24, 2017
  8. Apr 03, 2017
    • Markus Armbruster's avatar
      sheepdog: Fix blockdev-add · d1c13688
      Markus Armbruster authored
      
      Commit 831acdc9 "sheepdog: Implement bdrv_parse_filename()" and commit
      d282f34e "sheepdog: Support blockdev-add" have different ideas on how
      the QemuOpts parameters for the server address are named.  Fix that.
      While there, rename BlockdevOptionsSheepdog member addr to server, for
      consistency with BlockdevOptionsSsh, BlockdevOptionsGluster,
      BlockdevOptionsNbd.
      
      Commit 831acdc9's example becomes
      
          --drive driver=sheepdog,server.type=inet,server.host=fido,server.port=7000,vdi=dolly
      
      instead of
      
          --drive driver=sheepdog,host=fido,vdi=dolly
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Tested-by: default avatarKashyap Chamarthy <kchamart@redhat.com>
      Message-id: 1490895797-29094-10-git-send-email-armbru@redhat.com
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      d1c13688
    • Markus Armbruster's avatar
      nbd: Tidy up blockdev-add interface · 9445673e
      Markus Armbruster authored
      
      SocketAddress is a simple union, and simple unions are awkward: they
      have their variant members wrapped in a "data" object on the wire, and
      require additional indirections in C.  I intend to limit its use to
      existing external interfaces, and convert all internal interfaces to
      SocketAddressFlat.
      
      BlockdevOptionsNbd is an external interface using SocketAddress.  We
      already use SocketAddressFlat elsewhere in blockdev-add.  Replace it
      by SocketAddressFlat while we can (it's new in 2.9) for simplicity and
      consistency.  For example,
      
          { "execute": "blockdev-add",
            "arguments": { "node-name": "foo", "driver": "nbd",
                           "server": { "type": "inet",
      		                 "data": { "host": "localhost",
      				           "port": "12345" } } } }
      
      becomes
      
          { "execute": "blockdev-add",
            "arguments": { "node-name": "foo", "driver": "nbd",
                           "server": { "type": "inet",
      		                 "host": "localhost", "port": "12345" } } }
      
      Since the internal interfaces still take SocketAddress, this requires
      conversion function socket_address_crumple().  It'll go away when I
      update the interfaces.
      
      Unfortunately, SocketAddress is also visible in -drive since 2.8:
      
          -drive if=none,driver=nbd,server.type=inet,server.data.host=127.0.0.1,server.data.port=12345
      
      Nobody should be using it, as it's fairly new and has never been
      documented, so adding still more compatibility gunk to keep it working
      isn't worth the trouble.  You now have to use
      
          -drive if=none,driver=nbd,server.type=inet,server.host=127.0.0.1,server.port=12345
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-id: 1490895797-29094-9-git-send-email-armbru@redhat.com
      
      [mreitz: Change iotest 147 accordingly]
      
      Because of this interface change, iotest 147 has to be adapted.
      Unfortunately, we cannot just flatten all of the addresses because
      nbd-server-start still takes a plain SocketAddress. Therefore, we need
      both and this is most easily achieved by writing the SocketAddress into
      the code and flattening it where necessary.
      
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      Message-id: 20170330221243.17333-1-mreitz@redhat.com
      
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      9445673e
  9. Mar 31, 2017
  10. Mar 28, 2017
    • Markus Armbruster's avatar
      rbd: Revert -blockdev parameter password-secret · 577d8c9a
      Markus Armbruster authored
      
      This reverts a part of commit 8a47e8eb.  We're having second thoughts
      on the QAPI schema (and thus the external interface), and haven't
      reached consensus, yet.  Issues include:
      
      * BlockdevOptionsRbd member @password-secret isn't actually a
        password, it's a key generated by Ceph.
      
      * We're not sure where member @password-secret belongs (see the
        previous commit).
      
      * How @password-secret interacts with settings from a configuration
        file specified with @conf is undocumented.
      
      Let's avoid painting ourselves into a corner now, and revert the
      feature for 2.9.
      
      Note that users can still configure an authentication key with a
      configuration file.  They probably do that anyway if they use Ceph
      outside QEMU as well.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarJeff Cody <jcody@redhat.com>
      Message-id: 1490691368-32099-10-git-send-email-armbru@redhat.com
      Signed-off-by: default avatarJeff Cody <jcody@redhat.com>
      577d8c9a
    • Markus Armbruster's avatar
      rbd: Revert -blockdev and -drive parameter auth-supported · 464444fc
      Markus Armbruster authored
      
      This reverts half of commit 0a55679b.  We're having second thoughts on
      the QAPI schema (and thus the external interface), and haven't reached
      consensus, yet.  Issues include:
      
      * The implementation uses deprecated rados_conf_set() key
        "auth_supported".  No biggie.
      
      * The implementation makes -drive silently ignore invalid parameters
        "auth" and "auth-supported.*.X" where X isn't "auth".  Fixable (in
        fact I'm going to fix similar bugs around parameter server), so
        again no biggie.
      
      * BlockdevOptionsRbd member @password-secret applies only to
        authentication method cephx.  Should it be a variant member of
        RbdAuthMethod?
      
      * BlockdevOptionsRbd member @user could apply to both methods cephx
        and none, but I'm not sure it's actually used with none.  If it
        isn't, should it be a variant member of RbdAuthMethod?
      
      * The client offers a *set* of authentication methods, not a list.
        Should the methods be optional members of BlockdevOptionsRbd instead
        of members of list @auth-supported?  The latter begs the question
        what multiple entries for the same method mean.  Trivial question
        now that RbdAuthMethod contains nothing but @type, but less so when
        RbdAuthMethod acquires other members, such the ones discussed above.
      
      * How BlockdevOptionsRbd member @auth-supported interacts with
        settings from a configuration file specified with @conf is
        undocumented.  I suspect it's untested, too.
      
      Let's avoid painting ourselves into a corner now, and revert the
      feature for 2.9.
      
      Note that users can still configure authentication methods with a
      configuration file.  They probably do that anyway if they use Ceph
      outside QEMU as well.
      
      Further note that this doesn't affect use of key "auth-supported" in
      -drive file=rbd:...:key=value.
      
      qemu_rbd_array_opts()'s parameter @type now must be RBD_MON_HOST,
      which is silly.  This will be cleaned up shortly.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarJeff Cody <jcody@redhat.com>
      Message-id: 1490691368-32099-9-git-send-email-armbru@redhat.com
      Signed-off-by: default avatarJeff Cody <jcody@redhat.com>
      464444fc
    • Markus Armbruster's avatar
      rbd: Reject -blockdev server.*.{numeric, to, ipv4, ipv6} · eb87203b
      Markus Armbruster authored
      
      We use InetSocketAddress in the QAPI schema.  However, the code
      doesn't use inet_connect_saddr(), but formats "host" and "port" into a
      configuration string for rados_conf_set().  Thus, members "numeric",
      "to", "ipv4" and "ipv6" are silently ignored.  Not nice.  Example:
      
          -blockdev rbd,node-name=nn,pool=p,image=i,server.0.host=h0,server.0.port=12345,server.0.ipv4=off
      
      Factor a suitable InetSocketAddressBase out of InetSocketAddress, and
      use that.  "numeric", "to", "ipv4" and "ipv6" are now rejected.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      Reviewed-by: default avatarJeff Cody <jcody@redhat.com>
      Message-id: 1490691368-32099-2-git-send-email-armbru@redhat.com
      Signed-off-by: default avatarJeff Cody <jcody@redhat.com>
      eb87203b
    • Markus Armbruster's avatar
      block: Declare blockdev-add and blockdev-del supported · 79b7a77e
      Markus Armbruster authored
      
      It's been a long journey, but here we are.
      
      The supported blockdev-add is not compatible to its experimental
      predecessors; bump all Since: tags to 2.9.
      
      x-blockdev-remove-medium, x-blockdev-insert-medium and
      x-blockdev-change need a bit more work, so leave them alone for now.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      79b7a77e
  11. Mar 22, 2017
  12. Mar 21, 2017
  13. Mar 16, 2017
  14. Mar 13, 2017
  15. Mar 07, 2017
  16. Mar 05, 2017
Loading