Give each device its own thread

Use pthread.

Since main thread now only needs to respond to netlink events, remove
support for poll().

Signed-off-by: Andy Grover <agrover@redhat.com>
Catch ctrl-c and cleanup before exiting

Add a function for cancelling a thread.

Signed-off-by: Andy Grover <agrover@redhat.com>
Misc cleanups

Signed-off-by: Andy Grover <agrover@redhat.com>
dummy: Implement file-backed read support

Open test.img, and save fd to hm_private.

Get the length and the lba from the cdb.

Signed-off-by: Andy Grover <agrover@redhat.com>
Add parsing of new cfgstring format

cfgstring now includes hba # and device name. This is to enable us to
easily get info from the corresponding configfs tree.

Add handler API functions in api.c so that handlers can get attributes
and the device size. Add linker flag to properly export these from the
main binary.

Signed-off-by: Andy Grover <agrover@redhat.com>
dummy: Allow variable block size

Don't hardcode it to 4096 any more, use the value we got from reading the
attrib.

Signed-off-by: Andy Grover <agrover@redhat.com>