ia64/xen-unstable

changeset 14541:94943f2e1de9

Don't use the client-side shortcut for get_uuid calls -- we need to keep
handles and UUIDs conceptually separate.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Fri Mar 23 17:50:18 2007 +0000 (2007-03-23)
parents 238ed1c75194
children 0810daf7206e
files tools/libxen/include/xen_user.h tools/libxen/src/xen_console.c tools/libxen/src/xen_crashdump.c tools/libxen/src/xen_host.c tools/libxen/src/xen_host_cpu.c tools/libxen/src/xen_host_metrics.c tools/libxen/src/xen_network.c tools/libxen/src/xen_pbd.c tools/libxen/src/xen_pif.c tools/libxen/src/xen_pif_metrics.c tools/libxen/src/xen_sr.c tools/libxen/src/xen_user.c tools/libxen/src/xen_vbd.c tools/libxen/src/xen_vbd_metrics.c tools/libxen/src/xen_vdi.c tools/libxen/src/xen_vif.c tools/libxen/src/xen_vif_metrics.c tools/libxen/src/xen_vm.c tools/libxen/src/xen_vm_guest_metrics.c tools/libxen/src/xen_vm_metrics.c tools/libxen/src/xen_vtpm.c
line diff
     1.1 --- a/tools/libxen/include/xen_user.h	Fri Mar 23 17:42:08 2007 +0000
     1.2 +++ b/tools/libxen/include/xen_user.h	Fri Mar 23 17:50:18 2007 +0000
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 2006, XenSource Inc.
     1.6 + * Copyright (c) 2006-2007, XenSource Inc.
     1.7   *
     1.8   * This library is free software; you can redistribute it and/or
     1.9   * modify it under the terms of the GNU Lesser General Public
    1.10 @@ -24,8 +24,8 @@
    1.11  
    1.12  
    1.13  /*
    1.14 - * The user class. 
    1.15 - *  
    1.16 + * The user class.
    1.17 + * 
    1.18   * A user of the system.
    1.19   */
    1.20  
     2.1 --- a/tools/libxen/src/xen_console.c	Fri Mar 23 17:42:08 2007 +0000
     2.2 +++ b/tools/libxen/src/xen_console.c	Fri Mar 23 17:50:18 2007 +0000
     2.3 @@ -284,6 +284,15 @@ xen_console_get_all(xen_session *session
     2.4  bool
     2.5  xen_console_get_uuid(xen_session *session, char **result, xen_console console)
     2.6  {
     2.7 -    *result = session->ok ? xen_strdup_((char *)console) : NULL;
     2.8 +    abstract_value param_values[] =
     2.9 +        {
    2.10 +            { .type = &abstract_type_string,
    2.11 +              .u.string_val = console }
    2.12 +        };
    2.13 +
    2.14 +    abstract_type result_type = abstract_type_string;
    2.15 +
    2.16 +    *result = NULL;
    2.17 +    XEN_CALL_("console.get_uuid");
    2.18      return session->ok;
    2.19  }
     3.1 --- a/tools/libxen/src/xen_crashdump.c	Fri Mar 23 17:42:08 2007 +0000
     3.2 +++ b/tools/libxen/src/xen_crashdump.c	Fri Mar 23 17:50:18 2007 +0000
     3.3 @@ -177,6 +177,15 @@ xen_crashdump_get_all(xen_session *sessi
     3.4  bool
     3.5  xen_crashdump_get_uuid(xen_session *session, char **result, xen_crashdump crashdump)
     3.6  {
     3.7 -    *result = session->ok ? xen_strdup_((char *)crashdump) : NULL;
     3.8 +    abstract_value param_values[] =
     3.9 +        {
    3.10 +            { .type = &abstract_type_string,
    3.11 +              .u.string_val = crashdump }
    3.12 +        };
    3.13 +
    3.14 +    abstract_type result_type = abstract_type_string;
    3.15 +
    3.16 +    *result = NULL;
    3.17 +    XEN_CALL_("crashdump.get_uuid");
    3.18      return session->ok;
    3.19  }
     4.1 --- a/tools/libxen/src/xen_host.c	Fri Mar 23 17:42:08 2007 +0000
     4.2 +++ b/tools/libxen/src/xen_host.c	Fri Mar 23 17:50:18 2007 +0000
     4.3 @@ -754,6 +754,15 @@ xen_host_get_all(xen_session *session, s
     4.4  bool
     4.5  xen_host_get_uuid(xen_session *session, char **result, xen_host host)
     4.6  {
     4.7 -    *result = session->ok ? xen_strdup_((char *)host) : NULL;
     4.8 +    abstract_value param_values[] =
     4.9 +        {
    4.10 +            { .type = &abstract_type_string,
    4.11 +              .u.string_val = host }
    4.12 +        };
    4.13 +
    4.14 +    abstract_type result_type = abstract_type_string;
    4.15 +
    4.16 +    *result = NULL;
    4.17 +    XEN_CALL_("host.get_uuid");
    4.18      return session->ok;
    4.19  }
     5.1 --- a/tools/libxen/src/xen_host_cpu.c	Fri Mar 23 17:42:08 2007 +0000
     5.2 +++ b/tools/libxen/src/xen_host_cpu.c	Fri Mar 23 17:50:18 2007 +0000
     5.3 @@ -282,6 +282,15 @@ xen_host_cpu_get_all(xen_session *sessio
     5.4  bool
     5.5  xen_host_cpu_get_uuid(xen_session *session, char **result, xen_host_cpu host_cpu)
     5.6  {
     5.7 -    *result = session->ok ? xen_strdup_((char *)host_cpu) : NULL;
     5.8 +    abstract_value param_values[] =
     5.9 +        {
    5.10 +            { .type = &abstract_type_string,
    5.11 +              .u.string_val = host_cpu }
    5.12 +        };
    5.13 +
    5.14 +    abstract_type result_type = abstract_type_string;
    5.15 +
    5.16 +    *result = NULL;
    5.17 +    XEN_CALL_("host_cpu.get_uuid");
    5.18      return session->ok;
    5.19  }
     6.1 --- a/tools/libxen/src/xen_host_metrics.c	Fri Mar 23 17:42:08 2007 +0000
     6.2 +++ b/tools/libxen/src/xen_host_metrics.c	Fri Mar 23 17:50:18 2007 +0000
     6.3 @@ -176,6 +176,15 @@ xen_host_metrics_get_all(xen_session *se
     6.4  bool
     6.5  xen_host_metrics_get_uuid(xen_session *session, char **result, xen_host_metrics host_metrics)
     6.6  {
     6.7 -    *result = session->ok ? xen_strdup_((char *)host_metrics) : NULL;
     6.8 +    abstract_value param_values[] =
     6.9 +        {
    6.10 +            { .type = &abstract_type_string,
    6.11 +              .u.string_val = host_metrics }
    6.12 +        };
    6.13 +
    6.14 +    abstract_type result_type = abstract_type_string;
    6.15 +
    6.16 +    *result = NULL;
    6.17 +    XEN_CALL_("host_metrics.get_uuid");
    6.18      return session->ok;
    6.19  }
     7.1 --- a/tools/libxen/src/xen_network.c	Fri Mar 23 17:42:08 2007 +0000
     7.2 +++ b/tools/libxen/src/xen_network.c	Fri Mar 23 17:50:18 2007 +0000
     7.3 @@ -285,6 +285,15 @@ xen_network_get_all(xen_session *session
     7.4  bool
     7.5  xen_network_get_uuid(xen_session *session, char **result, xen_network network)
     7.6  {
     7.7 -    *result = session->ok ? xen_strdup_((char *)network) : NULL;
     7.8 +    abstract_value param_values[] =
     7.9 +        {
    7.10 +            { .type = &abstract_type_string,
    7.11 +              .u.string_val = network }
    7.12 +        };
    7.13 +
    7.14 +    abstract_type result_type = abstract_type_string;
    7.15 +
    7.16 +    *result = NULL;
    7.17 +    XEN_CALL_("network.get_uuid");
    7.18      return session->ok;
    7.19  }
     8.1 --- a/tools/libxen/src/xen_pbd.c	Fri Mar 23 17:42:08 2007 +0000
     8.2 +++ b/tools/libxen/src/xen_pbd.c	Fri Mar 23 17:50:18 2007 +0000
     8.3 @@ -235,6 +235,15 @@ xen_pbd_get_all(xen_session *session, st
     8.4  bool
     8.5  xen_pbd_get_uuid(xen_session *session, char **result, xen_pbd pbd)
     8.6  {
     8.7 -    *result = session->ok ? xen_strdup_((char *)pbd) : NULL;
     8.8 +    abstract_value param_values[] =
     8.9 +        {
    8.10 +            { .type = &abstract_type_string,
    8.11 +              .u.string_val = pbd }
    8.12 +        };
    8.13 +
    8.14 +    abstract_type result_type = abstract_type_string;
    8.15 +
    8.16 +    *result = NULL;
    8.17 +    XEN_CALL_("PBD.get_uuid");
    8.18      return session->ok;
    8.19  }
     9.1 --- a/tools/libxen/src/xen_pif.c	Fri Mar 23 17:42:08 2007 +0000
     9.2 +++ b/tools/libxen/src/xen_pif.c	Fri Mar 23 17:50:18 2007 +0000
     9.3 @@ -366,6 +366,15 @@ xen_pif_get_all(xen_session *session, st
     9.4  bool
     9.5  xen_pif_get_uuid(xen_session *session, char **result, xen_pif pif)
     9.6  {
     9.7 -    *result = session->ok ? xen_strdup_((char *)pif) : NULL;
     9.8 +    abstract_value param_values[] =
     9.9 +        {
    9.10 +            { .type = &abstract_type_string,
    9.11 +              .u.string_val = pif }
    9.12 +        };
    9.13 +
    9.14 +    abstract_type result_type = abstract_type_string;
    9.15 +
    9.16 +    *result = NULL;
    9.17 +    XEN_CALL_("PIF.get_uuid");
    9.18      return session->ok;
    9.19  }
    10.1 --- a/tools/libxen/src/xen_pif_metrics.c	Fri Mar 23 17:42:08 2007 +0000
    10.2 +++ b/tools/libxen/src/xen_pif_metrics.c	Fri Mar 23 17:50:18 2007 +0000
    10.3 @@ -176,6 +176,15 @@ xen_pif_metrics_get_all(xen_session *ses
    10.4  bool
    10.5  xen_pif_metrics_get_uuid(xen_session *session, char **result, xen_pif_metrics pif_metrics)
    10.6  {
    10.7 -    *result = session->ok ? xen_strdup_((char *)pif_metrics) : NULL;
    10.8 +    abstract_value param_values[] =
    10.9 +        {
   10.10 +            { .type = &abstract_type_string,
   10.11 +              .u.string_val = pif_metrics }
   10.12 +        };
   10.13 +
   10.14 +    abstract_type result_type = abstract_type_string;
   10.15 +
   10.16 +    *result = NULL;
   10.17 +    XEN_CALL_("PIF_metrics.get_uuid");
   10.18      return session->ok;
   10.19  }
    11.1 --- a/tools/libxen/src/xen_sr.c	Fri Mar 23 17:42:08 2007 +0000
    11.2 +++ b/tools/libxen/src/xen_sr.c	Fri Mar 23 17:50:18 2007 +0000
    11.3 @@ -388,6 +388,15 @@ xen_sr_get_all(xen_session *session, str
    11.4  bool
    11.5  xen_sr_get_uuid(xen_session *session, char **result, xen_sr sr)
    11.6  {
    11.7 -    *result = session->ok ? xen_strdup_((char *)sr) : NULL;
    11.8 +    abstract_value param_values[] =
    11.9 +        {
   11.10 +            { .type = &abstract_type_string,
   11.11 +              .u.string_val = sr }
   11.12 +        };
   11.13 +
   11.14 +    abstract_type result_type = abstract_type_string;
   11.15 +
   11.16 +    *result = NULL;
   11.17 +    XEN_CALL_("SR.get_uuid");
   11.18      return session->ok;
   11.19  }
    12.1 --- a/tools/libxen/src/xen_user.c	Fri Mar 23 17:42:08 2007 +0000
    12.2 +++ b/tools/libxen/src/xen_user.c	Fri Mar 23 17:50:18 2007 +0000
    12.3 @@ -1,5 +1,5 @@
    12.4  /*
    12.5 - * Copyright (c) 2006, XenSource Inc.
    12.6 + * Copyright (c) 2006-2007, XenSource Inc.
    12.7   *
    12.8   * This library is free software; you can redistribute it and/or
    12.9   * modify it under the terms of the GNU Lesser General Public
   12.10 @@ -196,6 +196,15 @@ xen_user_set_fullname(xen_session *sessi
   12.11  bool
   12.12  xen_user_get_uuid(xen_session *session, char **result, xen_user user)
   12.13  {
   12.14 -    *result = session->ok ? xen_strdup_((char *)user) : NULL;
   12.15 +    abstract_value param_values[] =
   12.16 +        {
   12.17 +            { .type = &abstract_type_string,
   12.18 +              .u.string_val = user }
   12.19 +        };
   12.20 +
   12.21 +    abstract_type result_type = abstract_type_string;
   12.22 +
   12.23 +    *result = NULL;
   12.24 +    XEN_CALL_("user.get_uuid");
   12.25      return session->ok;
   12.26  }
    13.1 --- a/tools/libxen/src/xen_vbd.c	Fri Mar 23 17:42:08 2007 +0000
    13.2 +++ b/tools/libxen/src/xen_vbd.c	Fri Mar 23 17:50:18 2007 +0000
    13.3 @@ -591,6 +591,15 @@ xen_vbd_get_all(xen_session *session, st
    13.4  bool
    13.5  xen_vbd_get_uuid(xen_session *session, char **result, xen_vbd vbd)
    13.6  {
    13.7 -    *result = session->ok ? xen_strdup_((char *)vbd) : NULL;
    13.8 +    abstract_value param_values[] =
    13.9 +        {
   13.10 +            { .type = &abstract_type_string,
   13.11 +              .u.string_val = vbd }
   13.12 +        };
   13.13 +
   13.14 +    abstract_type result_type = abstract_type_string;
   13.15 +
   13.16 +    *result = NULL;
   13.17 +    XEN_CALL_("VBD.get_uuid");
   13.18      return session->ok;
   13.19  }
    14.1 --- a/tools/libxen/src/xen_vbd_metrics.c	Fri Mar 23 17:42:08 2007 +0000
    14.2 +++ b/tools/libxen/src/xen_vbd_metrics.c	Fri Mar 23 17:50:18 2007 +0000
    14.3 @@ -176,6 +176,15 @@ xen_vbd_metrics_get_all(xen_session *ses
    14.4  bool
    14.5  xen_vbd_metrics_get_uuid(xen_session *session, char **result, xen_vbd_metrics vbd_metrics)
    14.6  {
    14.7 -    *result = session->ok ? xen_strdup_((char *)vbd_metrics) : NULL;
    14.8 +    abstract_value param_values[] =
    14.9 +        {
   14.10 +            { .type = &abstract_type_string,
   14.11 +              .u.string_val = vbd_metrics }
   14.12 +        };
   14.13 +
   14.14 +    abstract_type result_type = abstract_type_string;
   14.15 +
   14.16 +    *result = NULL;
   14.17 +    XEN_CALL_("VBD_metrics.get_uuid");
   14.18      return session->ok;
   14.19  }
    15.1 --- a/tools/libxen/src/xen_vdi.c	Fri Mar 23 17:42:08 2007 +0000
    15.2 +++ b/tools/libxen/src/xen_vdi.c	Fri Mar 23 17:50:18 2007 +0000
    15.3 @@ -555,6 +555,15 @@ xen_vdi_get_all(xen_session *session, st
    15.4  bool
    15.5  xen_vdi_get_uuid(xen_session *session, char **result, xen_vdi vdi)
    15.6  {
    15.7 -    *result = session->ok ? xen_strdup_((char *)vdi) : NULL;
    15.8 +    abstract_value param_values[] =
    15.9 +        {
   15.10 +            { .type = &abstract_type_string,
   15.11 +              .u.string_val = vdi }
   15.12 +        };
   15.13 +
   15.14 +    abstract_type result_type = abstract_type_string;
   15.15 +
   15.16 +    *result = NULL;
   15.17 +    XEN_CALL_("VDI.get_uuid");
   15.18      return session->ok;
   15.19  }
    16.1 --- a/tools/libxen/src/xen_vif.c	Fri Mar 23 17:42:08 2007 +0000
    16.2 +++ b/tools/libxen/src/xen_vif.c	Fri Mar 23 17:50:18 2007 +0000
    16.3 @@ -542,6 +542,15 @@ xen_vif_get_all(xen_session *session, st
    16.4  bool
    16.5  xen_vif_get_uuid(xen_session *session, char **result, xen_vif vif)
    16.6  {
    16.7 -    *result = session->ok ? xen_strdup_((char *)vif) : NULL;
    16.8 +    abstract_value param_values[] =
    16.9 +        {
   16.10 +            { .type = &abstract_type_string,
   16.11 +              .u.string_val = vif }
   16.12 +        };
   16.13 +
   16.14 +    abstract_type result_type = abstract_type_string;
   16.15 +
   16.16 +    *result = NULL;
   16.17 +    XEN_CALL_("VIF.get_uuid");
   16.18      return session->ok;
   16.19  }
    17.1 --- a/tools/libxen/src/xen_vif_metrics.c	Fri Mar 23 17:42:08 2007 +0000
    17.2 +++ b/tools/libxen/src/xen_vif_metrics.c	Fri Mar 23 17:50:18 2007 +0000
    17.3 @@ -176,6 +176,15 @@ xen_vif_metrics_get_all(xen_session *ses
    17.4  bool
    17.5  xen_vif_metrics_get_uuid(xen_session *session, char **result, xen_vif_metrics vif_metrics)
    17.6  {
    17.7 -    *result = session->ok ? xen_strdup_((char *)vif_metrics) : NULL;
    17.8 +    abstract_value param_values[] =
    17.9 +        {
   17.10 +            { .type = &abstract_type_string,
   17.11 +              .u.string_val = vif_metrics }
   17.12 +        };
   17.13 +
   17.14 +    abstract_type result_type = abstract_type_string;
   17.15 +
   17.16 +    *result = NULL;
   17.17 +    XEN_CALL_("VIF_metrics.get_uuid");
   17.18      return session->ok;
   17.19  }
    18.1 --- a/tools/libxen/src/xen_vm.c	Fri Mar 23 17:42:08 2007 +0000
    18.2 +++ b/tools/libxen/src/xen_vm.c	Fri Mar 23 17:50:18 2007 +0000
    18.3 @@ -1608,6 +1608,15 @@ xen_vm_get_all(xen_session *session, str
    18.4  bool
    18.5  xen_vm_get_uuid(xen_session *session, char **result, xen_vm vm)
    18.6  {
    18.7 -    *result = session->ok ? xen_strdup_((char *)vm) : NULL;
    18.8 +    abstract_value param_values[] =
    18.9 +        {
   18.10 +            { .type = &abstract_type_string,
   18.11 +              .u.string_val = vm }
   18.12 +        };
   18.13 +
   18.14 +    abstract_type result_type = abstract_type_string;
   18.15 +
   18.16 +    *result = NULL;
   18.17 +    XEN_CALL_("VM.get_uuid");
   18.18      return session->ok;
   18.19  }
    19.1 --- a/tools/libxen/src/xen_vm_guest_metrics.c	Fri Mar 23 17:42:08 2007 +0000
    19.2 +++ b/tools/libxen/src/xen_vm_guest_metrics.c	Fri Mar 23 17:50:18 2007 +0000
    19.3 @@ -265,6 +265,15 @@ xen_vm_guest_metrics_get_all(xen_session
    19.4  bool
    19.5  xen_vm_guest_metrics_get_uuid(xen_session *session, char **result, xen_vm_guest_metrics vm_guest_metrics)
    19.6  {
    19.7 -    *result = session->ok ? xen_strdup_((char *)vm_guest_metrics) : NULL;
    19.8 +    abstract_value param_values[] =
    19.9 +        {
   19.10 +            { .type = &abstract_type_string,
   19.11 +              .u.string_val = vm_guest_metrics }
   19.12 +        };
   19.13 +
   19.14 +    abstract_type result_type = abstract_type_string;
   19.15 +
   19.16 +    *result = NULL;
   19.17 +    XEN_CALL_("VM_guest_metrics.get_uuid");
   19.18      return session->ok;
   19.19  }
    20.1 --- a/tools/libxen/src/xen_vm_metrics.c	Fri Mar 23 17:42:08 2007 +0000
    20.2 +++ b/tools/libxen/src/xen_vm_metrics.c	Fri Mar 23 17:50:18 2007 +0000
    20.3 @@ -198,6 +198,15 @@ xen_vm_metrics_get_all(xen_session *sess
    20.4  bool
    20.5  xen_vm_metrics_get_uuid(xen_session *session, char **result, xen_vm_metrics vm_metrics)
    20.6  {
    20.7 -    *result = session->ok ? xen_strdup_((char *)vm_metrics) : NULL;
    20.8 +    abstract_value param_values[] =
    20.9 +        {
   20.10 +            { .type = &abstract_type_string,
   20.11 +              .u.string_val = vm_metrics }
   20.12 +        };
   20.13 +
   20.14 +    abstract_type result_type = abstract_type_string;
   20.15 +
   20.16 +    *result = NULL;
   20.17 +    XEN_CALL_("VM_metrics.get_uuid");
   20.18      return session->ok;
   20.19  }
    21.1 --- a/tools/libxen/src/xen_vtpm.c	Fri Mar 23 17:42:08 2007 +0000
    21.2 +++ b/tools/libxen/src/xen_vtpm.c	Fri Mar 23 17:50:18 2007 +0000
    21.3 @@ -182,6 +182,15 @@ xen_vtpm_get_backend(xen_session *sessio
    21.4  bool
    21.5  xen_vtpm_get_uuid(xen_session *session, char **result, xen_vtpm vtpm)
    21.6  {
    21.7 -    *result = session->ok ? xen_strdup_((char *)vtpm) : NULL;
    21.8 +    abstract_value param_values[] =
    21.9 +        {
   21.10 +            { .type = &abstract_type_string,
   21.11 +              .u.string_val = vtpm }
   21.12 +        };
   21.13 +
   21.14 +    abstract_type result_type = abstract_type_string;
   21.15 +
   21.16 +    *result = NULL;
   21.17 +    XEN_CALL_("VTPM.get_uuid");
   21.18      return session->ok;
   21.19  }