]> git.proxmox.com Git - mirror_qemu.git/commit
block/nbd: Add nbd_has_filename_options_conflict()
authorMax Reitz <mreitz@redhat.com>
Tue, 25 Oct 2016 13:11:33 +0000 (15:11 +0200)
committerKevin Wolf <kwolf@redhat.com>
Thu, 27 Oct 2016 17:05:23 +0000 (19:05 +0200)
commit48c38e0b8d2d71ec82928bd4b4136a941d39de3c
tree83a1c0cdfe88d9c6020b2678f8e2970899fbe90c
parentfcfcd8ffccd81b6fc13a730e2a75cefc5d1eb752
block/nbd: Add nbd_has_filename_options_conflict()

Right now, we have four possible options that conflict with specifying
an NBD filename, and a future patch will add another one ("address").
This future option is a nested QDict that is flattened at this point,
requiring us to test each option whether its key has an "address."
prefix. Therefore, we will then need to iterate through all options
(including the "export" option which was not covered so far).

Adding this iteration logic now will simplify adding the new option
later. A nice side effect is that the user will not receive a long list
of five options which are not supposed to be specified with a filename,
but we can actually print the problematic option.

Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/nbd.c