1. 23 1月, 2018 1 次提交
  2. 22 12月, 2017 1 次提交
  3. 19 12月, 2017 2 次提交
  4. 27 11月, 2017 1 次提交
    • K
      QAPI & interop: Clarify events emitted by 'block-job-cancel' · c117bb14
      Kashyap Chamarthy 提交于
      When you cancel an in-progress 'mirror' job (or "active `block-commit`")
      with QMP `block-job-cancel`, it emits the event: BLOCK_JOB_CANCELLED.
      However, when `block-job-cancel` is issued *after* `drive-mirror` has
      indicated (via the event BLOCK_JOB_READY) that the source and
      destination have reached synchronization:
      
          [...] # Snip `drive-mirror` invocation & outputs
          {
            "execute":"block-job-cancel",
            "arguments":{
              "device":"virtio0"
            }
          }
      
          {"return": {}}
      
      It (`block-job-cancel`) will counterintuitively emit the event
      'BLOCK_JOB_COMPLETED':
      
          {
            "timestamp":{
              "seconds":1510678024,
              "microseconds":526240
            },
            "event":"BLOCK_JOB_COMPLETED",
            "data":{
              "device":"virtio0",
              "len":41126400,
              "offset":41126400,
              "speed":0,
              "type":"mirror"
            }
          }
      
      But this is expected behaviour, where the _COMPLETED event indicates
      that synchronization has successfully ended (and the destination now has
      a point-in-time copy, which is at the time of cancel).
      
      So add a small note to this effect in 'block-core.json'.  While at it,
      also update the "Live disk synchronization -- drive-mirror and
      blockdev-mirror" section in 'live-block-operations.rst'.
      
      (Thanks: Max Reitz for reminding me of this caveat on IRC.)
      Signed-off-by: NKashyap Chamarthy <kchamart@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      c117bb14
  5. 17 11月, 2017 1 次提交
    • K
      block: Deprecate bdrv_set_read_only() and users · 398e6ad0
      Kevin Wolf 提交于
      bdrv_set_read_only() is used by some block drivers to override the
      read-only option given by the user. This is not how read-only images
      generally work in QEMU: Instead of second guessing what the user really
      meant (which currently includes making an image read-only even if the
      user didn't only use the default, but explicitly said read-only=off), we
      should error out if we can't provide what the user requested.
      
      This adds deprecation warnings to all callers of bdrv_set_read_only() so
      that the behaviour can be corrected after the usual deprecation period.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      398e6ad0
  6. 06 10月, 2017 1 次提交
  7. 26 9月, 2017 1 次提交
  8. 22 9月, 2017 1 次提交
    • P
      scsi, file-posix: add support for persistent reservation management · 7c9e5276
      Paolo Bonzini 提交于
      It is a common requirement for virtual machine to send persistent
      reservations, but this currently requires either running QEMU with
      CAP_SYS_RAWIO, or using out-of-tree patches that let an unprivileged
      QEMU bypass Linux's filter on SG_IO commands.
      
      As an alternative mechanism, the next patches will introduce a
      privileged helper to run persistent reservation commands without
      expanding QEMU's attack surface unnecessarily.
      
      The helper is invoked through a "pr-manager" QOM object, to which
      file-posix.c passes SG_IO requests for PERSISTENT RESERVE OUT and
      PERSISTENT RESERVE IN commands.  For example:
      
        $ qemu-system-x86_64
            -device virtio-scsi \
            -object pr-manager-helper,id=helper0,path=/var/run/qemu-pr-helper.sock
            -drive if=none,id=hd,driver=raw,file.filename=/dev/sdb,file.pr-manager=helper0
            -device scsi-block,drive=hd
      
      or:
      
        $ qemu-system-x86_64
            -device virtio-scsi \
            -object pr-manager-helper,id=helper0,path=/var/run/qemu-pr-helper.sock
            -blockdev node-name=hd,driver=raw,file.driver=host_device,file.filename=/dev/sdb,file.pr-manager=helper0
            -device scsi-block,drive=hd
      
      Multiple pr-manager implementations are conceivable and possible, though
      only one is implemented right now.  For example, a pr-manager could:
      
      - talk directly to the multipath daemon from a privileged QEMU
        (i.e. QEMU links to libmpathpersist); this makes reservation work
        properly with multipath, but still requires CAP_SYS_RAWIO
      
      - use the Linux IOC_PR_* ioctls (they require CAP_SYS_ADMIN though)
      
      - more interestingly, implement reservations directly in QEMU
        through file system locks or a shared database (e.g. sqlite)
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      7c9e5276
  9. 06 9月, 2017 2 次提交
    • M
      block: add throttle block filter driver · d8e7d87e
      Manos Pitsidianakis 提交于
      block/throttle.c uses existing I/O throttle infrastructure inside a
      block filter driver. I/O operations are intercepted in the filter's
      read/write coroutines, and referred to block/throttle-groups.c
      
      The driver can be used with the syntax
      -drive driver=throttle,file.filename=foo.qcow2,throttle-group=bar
      
      which registers the throttle filter node with the ThrottleGroup 'bar'. The
      given group must be created beforehand with object-add or -object.
      Reviewed-by: NAlberto Garcia <berto@igalia.com>
      Signed-off-by: NManos Pitsidianakis <el13635@mail.ntua.gr>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      d8e7d87e
    • M
      block: convert ThrottleGroup to object with QOM · 432d889e
      Manos Pitsidianakis 提交于
      ThrottleGroup is converted to an object. This will allow the future
      throttle block filter drive easy creation and configuration of throttle
      groups in QMP and cli.
      
      A new QAPI struct, ThrottleLimits, is introduced to provide a shared
      struct for all throttle configuration needs in QMP.
      
      ThrottleGroups can be created via CLI as
          -object throttle-group,id=foo,x-iops-total=100,x-..
      where x-* are individual limit properties. Since we can't add non-scalar
      properties in -object this interface must be used instead. However,
      setting these properties must be disabled after initialization because
      certain combinations of limits are forbidden and thus configuration
      changes should be done in one transaction. The individual properties
      will go away when support for non-scalar values in CLI is implemented
      and thus are marked as experimental.
      
      ThrottleGroup also has a `limits` property that uses the ThrottleLimits
      struct.  It can be used to create ThrottleGroups or set the
      configuration in existing groups as follows:
      
      { "execute": "object-add",
        "arguments": {
          "qom-type": "throttle-group",
          "id": "foo",
          "props" : {
            "limits": {
                "iops-total": 100
            }
          }
        }
      }
      { "execute" : "qom-set",
          "arguments" : {
              "path" : "foo",
              "property" : "limits",
              "value" : {
                  "iops-total" : 99
              }
          }
      }
      
      This also means a group's configuration can be fetched with qom-get.
      Signed-off-by: NManos Pitsidianakis <el13635@mail.ntua.gr>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NAlberto Garcia <berto@igalia.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      432d889e
  10. 04 9月, 2017 3 次提交
  11. 24 7月, 2017 2 次提交
    • K
      block: Skip implicit nodes in query-block/blockstats · d3c8c674
      Kevin Wolf 提交于
      Commits 0db832f4 and 6cdbceb1 introduced the automatic insertion of filter
      nodes above the top layer of mirror and commit block jobs. The
      assumption made there was that since libvirt doesn't do node-level
      management of the block layer yet, it shouldn't be affected by added
      nodes.
      
      This is true as far as commands issued by libvirt are concerned. It only
      uses BlockBackend names to address nodes, so any operations it performs
      still operate on the root of the tree as intended.
      
      However, the assumption breaks down when you consider query commands,
      which return data for the wrong node now. These commands also return
      information on some child nodes (bs->file and/or bs->backing), which
      libvirt does make use of, and which refer to the wrong nodes, too.
      
      One of the consequences is that oVirt gets wrong information about the
      image size and stops the VM in response as long as a mirror or commit
      job is running:
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1470634
      
      This patch fixes the problem by hiding the implicit nodes created
      automatically by the mirror and commit block jobs in the output of
      query-block and BlockBackend-based query-blockstats as long as the user
      doesn't indicate that they are aware of those nodes by providing a node
      name for them in the QMP command to start the block job.
      
      The node-based commands query-named-block-nodes and query-blockstats
      with query-nodes=true still show all nodes, including implicit ones.
      This ensures that users that are capable of node-level management can
      still access the full information; users that only know BlockBackends
      won't use these commands.
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NPeter Krempa <pkrempa@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Tested-by: NEric Blake <eblake@redhat.com>
      d3c8c674
    • M
      block: Use JSON null instead of "" to disable backing file · c42e8742
      Markus Armbruster 提交于
      BlockdevRef is an alternate of BlockdevOptions (inline definition) and
      str (reference to an existing block device by name).  BlockdevRef
      value "" is special: "no block device should be referenced."  It's
      actually interpreted that way in just one place: optional member
      @backing of COW formats.  Semantics:
      
      * Present means "use this block device" as backing storage
      
      * Absent means "default to the one stored in the image"
      
      * Except "" means "don't use backing storage at all"
      
      The first two are perfectly normal: when the parameter is absent, it
      defaults to an implied value, but the value's meaning is the same.
      
      The third one overloads the parameter with a second meaning.  The
      overloading is *implicit*, i.e. it's not visible in the types.  Works
      here, because "" is not a value block device ID.
      
      Pressing argument values the schema accepts, but are semantically
      invalid, into service to mean "do something else entirely" is not
      general, as suitable invalid values need not exist.  I also find it
      ugly.
      
      To clean this up, we could add a separate flag argument to suppress
      @backing, or add a distinct value to @backing.  This commit implements
      the latter: add JSON null to the values of @backing, deprecate "".
      
      Because we're so close to the 2.10 freeze, implement it in the
      stupidest way possible: have qmp_blockdev_add() rewrite null to ""
      before anything else can see the null.  Works, because BlockdevRef
      occurs only within arguments of blockdev-add.  The proper way to do it
      would be rewriting "" to null, preferably in a cleaner way, but that
      requires fixing up code to work with null.  Add a TODO comment for
      that.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
      Acked-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      c42e8742
  12. 18 7月, 2017 1 次提交
  13. 11 7月, 2017 10 次提交
    • S
      block: add bdrv_measure() API · 90880ff1
      Stefan Hajnoczi 提交于
      bdrv_measure() provides a conservative maximum for the size of a new
      image.  This information is handy if storage needs to be allocated (e.g.
      a SAN or an LVM volume) ahead of time.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NAlberto Garcia <berto@igalia.com>
      Message-id: 20170705125738.8777-2-stefanha@redhat.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      90880ff1
    • V
      qmp: block-dirty-bitmap-remove: remove persistent · 5c36c1af
      Vladimir Sementsov-Ogievskiy 提交于
      Remove persistent bitmap from the storage on block-dirty-bitmap-remove.
      Signed-off-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 20170628120530.31251-30-vsementsov@virtuozzo.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      5c36c1af
    • V
      qmp: add x-debug-block-dirty-bitmap-sha256 · a3b52535
      Vladimir Sementsov-Ogievskiy 提交于
      Signed-off-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-id: 20170628120530.31251-26-vsementsov@virtuozzo.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      a3b52535
    • V
      qmp: add autoload parameter to block-dirty-bitmap-add · eb738bb5
      Vladimir Sementsov-Ogievskiy 提交于
      Optional. Default is false.
      Signed-off-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 20170628120530.31251-25-vsementsov@virtuozzo.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      eb738bb5
    • V
      qmp: add persistent flag to block-dirty-bitmap-add · fd5ae4cc
      Vladimir Sementsov-Ogievskiy 提交于
      Add optional 'persistent' flag to qmp command block-dirty-bitmap-add.
      Default is false.
      Signed-off-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 20170628120530.31251-24-vsementsov@virtuozzo.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      fd5ae4cc
    • D
      qcow2: report encryption specific image information · 0a12f6f8
      Daniel P. Berrange 提交于
      Currently 'qemu-img info' reports a simple "encrypted: yes"
      field. This is not very useful now that qcow2 can support
      multiple encryption formats. Users want to know which format
      is in use and some data related to it.
      
      Wire up usage of the qcrypto_block_get_info() method so that
      'qemu-img info' can report about the encryption format
      and parameters in use
      
        $ qemu-img create \
            --object secret,id=sec0,data=123456 \
            -o encrypt.format=luks,encrypt.key-secret=sec0 \
            -f qcow2 demo.qcow2 1G
        Formatting 'demo.qcow2', fmt=qcow2 size=1073741824 \
        encryption=off encrypt.format=luks encrypt.key-secret=sec0 \
        cluster_size=65536 lazy_refcounts=off refcount_bits=16
      
        $ qemu-img info demo.qcow2
        image: demo.qcow2
        file format: qcow2
        virtual size: 1.0G (1073741824 bytes)
        disk size: 480K
        encrypted: yes
        cluster_size: 65536
        Format specific information:
            compat: 1.1
            lazy refcounts: false
            refcount bits: 16
            encrypt:
                ivgen alg: plain64
                hash alg: sha256
                cipher alg: aes-256
                uuid: 3fa930c4-58c8-4ef7-b3c5-314bb5af21f3
                format: luks
                cipher mode: xts
                slots:
                    [0]:
                        active: true
                        iters: 1839058
                        key offset: 4096
                        stripes: 4000
                    [1]:
                        active: false
                        key offset: 262144
                    [2]:
                        active: false
                        key offset: 520192
                    [3]:
                        active: false
                        key offset: 778240
                    [4]:
                        active: false
                        key offset: 1036288
                    [5]:
                        active: false
                        key offset: 1294336
                    [6]:
                        active: false
                        key offset: 1552384
                    [7]:
                        active: false
                        key offset: 1810432
                payload offset: 2068480
                master key iters: 438487
            corrupt: false
      
      With the legacy "AES" encryption we just report the format
      name
      
        $ qemu-img create \
            --object secret,id=sec0,data=123456 \
            -o encrypt.format=aes,encrypt.key-secret=sec0 \
            -f qcow2 demo.qcow2 1G
        Formatting 'demo.qcow2', fmt=qcow2 size=1073741824 \
        encryption=off encrypt.format=aes encrypt.key-secret=sec0 \
        cluster_size=65536 lazy_refcounts=off refcount_bits=16
      
        $ ./qemu-img info demo.qcow2
        image: demo.qcow2
        file format: qcow2
        virtual size: 1.0G (1073741824 bytes)
        disk size: 196K
        encrypted: yes
        cluster_size: 65536
        Format specific information:
            compat: 1.1
            lazy refcounts: false
            refcount bits: 16
            encrypt:
                format: aes
            corrupt: false
      Reviewed-by: NAlberto Garcia <berto@igalia.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-id: 20170623162419.26068-20-berrange@redhat.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      0a12f6f8
    • D
      block: remove all encryption handling APIs · c01c214b
      Daniel P. Berrange 提交于
      Now that all encryption keys must be provided upfront via
      the QCryptoSecret API and associated block driver properties
      there is no need for any explicit encryption handling APIs
      in the block layer. Encryption can be handled transparently
      within the block driver. We only retain an API for querying
      whether an image is encrypted or not, since that is a
      potentially useful piece of metadata to report to the user.
      Reviewed-by: NAlberto Garcia <berto@igalia.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-id: 20170623162419.26068-18-berrange@redhat.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      c01c214b
    • D
      qcow2: add support for LUKS encryption format · 4652b8f3
      Daniel P. Berrange 提交于
      This adds support for using LUKS as an encryption format
      with the qcow2 file, using the new encrypt.format parameter
      to request "luks" format. e.g.
      
        # qemu-img create --object secret,data=123456,id=sec0 \
             -f qcow2 -o encrypt.format=luks,encrypt.key-secret=sec0 \
             test.qcow2 10G
      
      The legacy "encryption=on" parameter still results in
      creation of the old qcow2 AES format (and is equivalent
      to the new 'encryption-format=aes'). e.g. the following are
      equivalent:
      
        # qemu-img create --object secret,data=123456,id=sec0 \
             -f qcow2 -o encryption=on,encrypt.key-secret=sec0 \
             test.qcow2 10G
      
       # qemu-img create --object secret,data=123456,id=sec0 \
             -f qcow2 -o encryption-format=aes,encrypt.key-secret=sec0 \
             test.qcow2 10G
      
      With the LUKS format it is necessary to store the LUKS
      partition header and key material in the QCow2 file. This
      data can be many MB in size, so cannot go into the QCow2
      header region directly. Thus the spec defines a FDE
      (Full Disk Encryption) header extension that specifies
      the offset of a set of clusters to hold the FDE headers,
      as well as the length of that region. The LUKS header is
      thus stored in these extra allocated clusters before the
      main image payload.
      
      Aside from all the cryptographic differences implied by
      use of the LUKS format, there is one further key difference
      between the use of legacy AES and LUKS encryption in qcow2.
      For LUKS, the initialiazation vectors are generated using
      the host physical sector as the input, rather than the
      guest virtual sector. This guarantees unique initialization
      vectors for all sectors when qcow2 internal snapshots are
      used, thus giving stronger protection against watermarking
      attacks.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-id: 20170623162419.26068-14-berrange@redhat.com
      Reviewed-by: NAlberto Garcia <berto@igalia.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      4652b8f3
    • D
      qcow2: convert QCow2 to use QCryptoBlock for encryption · b25b387f
      Daniel P. Berrange 提交于
      This converts the qcow2 driver to make use of the QCryptoBlock
      APIs for encrypting image content, using the legacy QCow2 AES
      scheme.
      
      With this change it is now required to use the QCryptoSecret
      object for providing passwords, instead of the current block
      password APIs / interactive prompting.
      
        $QEMU \
          -object secret,id=sec0,file=/home/berrange/encrypted.pw \
          -drive file=/home/berrange/encrypted.qcow2,encrypt.key-secret=sec0
      
      The test 087 could be simplified since there is no longer a
      difference in behaviour when using blockdev_add with encrypted
      images for the running vs stopped CPU state.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-id: 20170623162419.26068-12-berrange@redhat.com
      Reviewed-by: NAlberto Garcia <berto@igalia.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      b25b387f
    • D
      qcow: convert QCow to use QCryptoBlock for encryption · d85f4222
      Daniel P. Berrange 提交于
      This converts the qcow driver to make use of the QCryptoBlock
      APIs for encrypting image content. This is only wired up to
      permit use of the legacy QCow encryption format. Users who wish
      to have the strong LUKS format should switch to qcow2 instead.
      
      With this change it is now required to use the QCryptoSecret
      object for providing passwords, instead of the current block
      password APIs / interactive prompting.
      
        $QEMU \
          -object secret,id=sec0,file=/home/berrange/encrypted.pw \
          -drive file=/home/berrange/encrypted.qcow,encrypt.format=aes,\
                 encrypt.key-secret=sec0
      
      Though note that running QEMU system emulators with the AES
      encryption is no longer supported, so while the above syntax
      is valid, QEMU will refuse to actually run the VM in this
      particular example.
      
      Likewise when creating images with the legacy AES-CBC format
      
        qemu-img create -f qcow \
          --object secret,id=sec0,file=/home/berrange/encrypted.pw \
          -o encrypt.format=aes,encrypt.key-secret=sec0 \
          /home/berrange/encrypted.qcow 64M
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NAlberto Garcia <berto@igalia.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-id: 20170623162419.26068-10-berrange@redhat.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      d85f4222
  14. 06 6月, 2017 1 次提交
  15. 04 6月, 2017 2 次提交
  16. 16 5月, 2017 1 次提交
  17. 11 5月, 2017 3 次提交
  18. 09 5月, 2017 1 次提交
  19. 25 4月, 2017 1 次提交
  20. 03 4月, 2017 2 次提交
    • M
      sheepdog: Fix blockdev-add · d1c13688
      Markus Armbruster 提交于
      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: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Tested-by: NKashyap Chamarthy <kchamart@redhat.com>
      Message-id: 1490895797-29094-10-git-send-email-armbru@redhat.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      d1c13688
    • M
      nbd: Tidy up blockdev-add interface · 9445673e
      Markus Armbruster 提交于
      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: NMarkus 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: NMax Reitz <mreitz@redhat.com>
      Message-id: 20170330221243.17333-1-mreitz@redhat.com
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      9445673e
  21. 01 4月, 2017 1 次提交
  22. 28 3月, 2017 1 次提交
    • M
      rbd: Revert -blockdev parameter password-secret · 577d8c9a
      Markus Armbruster 提交于
      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: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Message-id: 1490691368-32099-10-git-send-email-armbru@redhat.com
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      577d8c9a