1. 01 12月, 2018 3 次提交
    • E
      nbd/client: Send NBD_CMD_DISC if open fails after connect · c688e6ca
      Eric Blake 提交于
      If nbd_client_init() fails after we are already connected,
      then the server will spam logs with:
      
      Disconnect client, due to: Unexpected end-of-file before all bytes were read
      
      unless we gracefully disconnect before closing the connection.
      
      Ways to trigger this:
      
      $ opts=driver=nbd,export=foo,server.type=inet,server.host=localhost,server.port=10809
      $  qemu-img map --output=json --image-opts $opts,read-only=off
      $  qemu-img map --output=json --image-opts $opts,x-dirty-bitmap=nosuch:
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <20181130023232.3079982-4-eblake@redhat.com>
      Reviewed-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      c688e6ca
    • E
      nbd/client: Make x-dirty-bitmap more reliable · 47829c40
      Eric Blake 提交于
      The implementation of x-dirty-bitmap in qemu 3.0 (commit 216ee365)
      silently falls back to treating the server as not supporting
      NBD_CMD_BLOCK_STATUS if a requested meta_context name was not
      negotiated, which in turn means treating the _entire_ image as
      data. Since our hack relied on using 'qemu-img map' to view
      which portions of the image were dirty by seeing what the
      redirected bdrv_block_status() treats as holes, this means
      that our fallback treats the entire image as clean.  Better
      would have been to treat the entire image as dirty, or to fail
      to connect because the user's request for a specific context
      could not be honored. This patch goes with the latter.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <20181130023232.3079982-3-eblake@redhat.com>
      Reviewed-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      47829c40
    • E
      nbd/server: Advertise all contexts in response to bare LIST · e31d8024
      Eric Blake 提交于
      The NBD spec, and even our code comment, says that if the client
      asks for NBD_OPT_LIST_META_CONTEXT with 0 queries, then we should
      reply with (a possibly-compressed representation of) ALL contexts
      that we are willing to let them try.  But commit 3d068aff forgot
      to advertise qemu:dirty-bitmap:FOO.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <20181130023232.3079982-2-eblake@redhat.com>
      Reviewed-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      e31d8024
  2. 29 11月, 2018 1 次提交
  3. 28 11月, 2018 7 次提交
  4. 27 11月, 2018 25 次提交
  5. 26 11月, 2018 4 次提交