xen_disk: cope with missing xenstore "params" node
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Mon, 27 Jun 2011 15:10:01 +0000 (16:10 +0100)
committerAlexander Graf <agraf@suse.de>
Sat, 16 Jul 2011 23:54:25 +0000 (01:54 +0200)
commitb9c1c797406d397175ecf01c6b786236b54d91b1
tree65639e125f3949cb7e058b99ed0edab306fa3323
parent8cdea9ccc7d931c3c8ba63ad236cec424215d95c
xen_disk: cope with missing xenstore "params" node

When disk is a cdrom and the drive is empty the "params" node in
xenstore might be missing completely: cope with it instead of
segfaulting.

Updated in v2:

- actually removed the strchr(blkdev->params, ':') that caused the
segfault;

- free all the allocated strings from xenstore before returning;

Updated in v3:

- set blkdev fields to NULL after free'ing them.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
hw/xen_disk.c