[libvirt] [PATCH v1 01/31] networkLookupByUUID: Improve error message

Peter Krempa pkrempa at redhat.com
Thu Feb 26 14:59:08 UTC 2015


On Thu, Feb 26, 2015 at 15:17:10 +0100, Michal Privoznik wrote:
> We have this function networkObjFromNetwork() which for given
> virNetworkPtr tries to find corresponding virNetworkObjPtr. If no
> object is found, a nice error message is printed out:
> 
>   no network with matching uuid '$uuid' ($name)
> 
> Let's improve the error message produced by networkLookupByUUID to
> follow that logic.
> 
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
>  src/network/bridge_driver.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
> index 1209609..522ccc2 100644
> --- a/src/network/bridge_driver.c
> +++ b/src/network/bridge_driver.c
> @@ -2475,7 +2475,8 @@ static virNetworkPtr networkLookupByUUID(virConnectPtr conn,
>      networkDriverUnlock();
>      if (!network) {
>          virReportError(VIR_ERR_NO_NETWORK,
> -                       "%s", _("no network with matching uuid"));
> +                       _("no network with matching uuid '%s'"),
> +                       uuid);

UUID is the binary representation. You need to convert it to a string
first.

Peter

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150226/4b3f8378/attachment-0001.sig>


More information about the libvir-list mailing list