On 11/24/2011 12:13 PM, Richard W.M. Jones wrote:
On Wed, Nov 23, 2011 at 02:00:56PM +0000, Matthew Booth wrote:
> This patch fixes inspection when fstab contains devices md devices
s/devices md devices/md devices/
> +/* Hash structure for path(mdadm)->path(appliance) lookup */
There's trailing whitespace on this line, and one more line further
on. git am spotted this.
Grr.
> + if (!map_md_devices (g,&md_map)) return -1;
The convention in almost all other code is to return>= 0 on success
and -1 on error, not booleans. I think this should be changed for
consistency.
Meh, ok.
How does this code act if /etc/mdadm.conf is bogus, but the guest
doesn't have any MD devices (or doesn't have any in /etc/fstab at any
rate)? I think we should be able to deal with this by not giving an
error. It indeed appears to be the case that map_md_devices doesn't
call error(), but wasn't clear if this was intentional so we can deal
silently with a bogus mdadm.conf, or was accidental.
If mdadm.conf is bogus or doesn't contain any arrays, the augeas match
will simply return an empty list. It requires no special error handling.
I might just add a warning if we find md devices in the appliance but
not in the guest, though.
Incidentally, this still requires the mdadm_conf, which is in upstream
augeas but not yet in a release. I'm going to add the lens to libguestfs
until it's released.
Patch to follow.
Matt
--
Matthew Booth, RHCA, RHCSS
Red Hat Engineering, Virtualisation Team
GPG ID: D33C3490
GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490