qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] e98c69: rbd: Fix regression in legacy key/val


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] e98c69: rbd: Fix regression in legacy key/values containin...
Date: Mon, 03 Apr 2017 03:30:09 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: e98c6961c82e25ff9051a31f17846404a64de6dd
      
https://github.com/qemu/qemu/commit/e98c6961c82e25ff9051a31f17846404a64de6dd
  Author: Eric Blake <address@hidden>
  Date:   2017-03-31 (Fri, 31 Mar 2017)

  Changed paths:
    M block/rbd.c

  Log Message:
  -----------
  rbd: Fix regression in legacy key/values containing escaped :

Commit c7cacb3 accidentally broke legacy key-value parsing through
pseudo-filename parsing of -drive file=rbd://..., for any key that
contains an escaped ':'.  Such a key is surprisingly common, thanks
to mon_host specifying a 'host:port' string.  The break happens
because passing things from QDict through QemuOpts back to another
QDict requires that we pack our parsed key/value pairs into a string,
and then reparse that string, but the intermediate string that we
created ("key1=value1:key2=value2") lost the \: escaping that was
present in the original, so that we could no longer see which : were
used as separators vs. those used as part of the original input.

Fix it by collecting the key/value pairs through a QList, and
sending that list on a round trip through a JSON QString (as in
'["key1","value1","key2","value2"]') on its way through QemuOpts,
rather than hand-rolling our own string.  Since the string is only
handled internally, this was faster than creating a full-blown
struct of '[{"key1":"value1"},{"key2":"value2"}]', and safer at
guaranteeing order compared to '{"key1":"value1","key2":"value2"}'.

It would be nicer if we didn't have to round-trip through QemuOpts
in the first place, but that's a much bigger task for later.

Reproducer:
./x86_64-softmmu/qemu-system-x86_64 -nodefaults -nographic -qmp stdio \
-drive 'file=rbd:volumes/volume-ea141b5c-cdb3-4765-910d-e7008b209a70'\
':id=compute:key=AQAVkvxXAAAAABAA9ZxWFYdRmV+DSwKr7BKKXg=='\
':auth_supported=cephx\;none:mon_host=192.168.1.2\:6789'\
',format=raw,if=none,id=drive-virtio-disk0,'\
'serial=ea141b5c-cdb3-4765-910d-e7008b209a70,cache=writeback'

Even without an RBD setup, this serves a test of whether we get
the incorrect parser error of:
qemu-system-x86_64: -drive file=rbd:...cache=writeback: conf option 6789 has no 
value
or the correct behavior of hanging while trying to connect to
the requested mon_host of 192.168.1.2:6789.

Reported-by: Alexandru Avadanii <address@hidden>
Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: Jeff Cody <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Jeff Cody <address@hidden>


  Commit: 6b9d62db89a31882d53d8fbfb67d4d82f22877b6
      
https://github.com/qemu/qemu/commit/6b9d62db89a31882d53d8fbfb67d4d82f22877b6
  Author: Max Reitz <address@hidden>
  Date:   2017-03-31 (Fri, 31 Mar 2017)

  Changed paths:
    M qapi/block-core.json

  Log Message:
  -----------
  qapi/curl: Extend and fix blockdev-add schema

The curl block driver accepts more options than just "filename"; also,
the URL is actually expected to be passed through the "url" option
instead of "filename".

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Jeff Cody <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Jeff Cody <address@hidden>


  Commit: 34634ca28688652198f77d7001c0f1e204434663
      
https://github.com/qemu/qemu/commit/34634ca28688652198f77d7001c0f1e204434663
  Author: Max Reitz <address@hidden>
  Date:   2017-03-31 (Fri, 31 Mar 2017)

  Changed paths:
    M block/curl.c

  Log Message:
  -----------
  block/curl: Check protocol prefix

If the user has explicitly specified a block driver and thus a protocol,
we have to make sure the URL's protocol prefix matches. Otherwise the
latter will silently override the former which might catch some users by
surprise.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Jeff Cody <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Jeff Cody <address@hidden>


  Commit: 6954cdc070b4209cc468263455670d8b02765a95
      
https://github.com/qemu/qemu/commit/6954cdc070b4209cc468263455670d8b02765a95
  Author: Peter Maydell <address@hidden>
  Date:   2017-04-03 (Mon, 03 Apr 2017)

  Changed paths:
    M block/curl.c
    M block/rbd.c
    M qapi/block-core.json

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/cody/tags/block-pull-request' into 
staging

# gpg: Signature made Sat 01 Apr 2017 02:23:29 BST
# gpg:                using RSA key 0xBDBE7B27C0DE3057
# gpg: Good signature from "Jeffrey Cody <address@hidden>"
# gpg:                 aka "Jeffrey Cody <address@hidden>"
# gpg:                 aka "Jeffrey Cody <address@hidden>"
# Primary key fingerprint: 9957 4B4D 3474 90E7 9D98  D624 BDBE 7B27 C0DE 3057

* remotes/cody/tags/block-pull-request:
  block/curl: Check protocol prefix
  qapi/curl: Extend and fix blockdev-add schema
  rbd: Fix regression in legacy key/values containing escaped :

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/95b31d709ba3...6954cdc070b4

reply via email to

[Prev in Thread] Current Thread [Next in Thread]