[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 03/13] libxl: add libxl__xs_path_cleanup



Roger Pau Monne writes ("[PATCH 03/13] libxl: add libxl__xs_path_cleanup"):
> Add a function which behaves like "xenstore-rm -t", and which will be
> used to clean xenstore after unplug since we will be no longer
> executing xen-hotplug-cleanup script, that used to do that for us.
...
> +    if (!user_path) {
> +        LOGE(ERROR, "null path provided");
> +        return ERROR_INVAL;
> +    }

What is this for ?  Why not just crash ?

> +    if (!t) {
> +        LOGE(ERROR, "null transaction provided");
> +        return ERROR_INVAL;
> +    }

Likewise why not
       assert(t);
?

> +    path = libxl__strdup(gc, user_path);
> +    if (!xs_rm(CTX->xsh, t, path)) {
> +        rc = ERROR_FAIL;
> +        goto out;
...
> +out:
> +    return rc;

This has the effect of discarding the errno value if anything fails.
Perhaps this function should log on all errors ?

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.