Add context / bitmap support to nbdcopy

hi,

it would be nice if one could use nbdcopy to save data from other meta contexts then base:allocation. Such as bitmaps exposed by qemu (qemu:dirty-bitmap:XX), which would allow to copy only dirty blocks (for inc/diff backup).

Im not a native C programmer, but attempted to create a small poc here that adds an --context option to nbdcopy:

abbbi/libnbd@ce4d566b

$ ./nbdcopy  --synchronous 'nbd+unix:///vdf?socket=/var/tmp/vircpt.83239'  full.img
$ qemu-img info full.img 
image: full.img
file format: raw
virtual size: 2 MiB (2097152 bytes)
disk size: 388 KiB
$ ./nbdcopy  --synchronous -c qemu:dirty-bitmap:TEST  'nbd+unix:///vdf?socket=/var/tmp/vircpt.83239'  inc.img
$ qemu-img info inc.img 
image: inc.img
file format: raw
virtual size: 2 MiB (2097152 bytes)
disk size: 192 KiB
Edited by Michael Ablassmeier