aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl_utils.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-12-02 08:44:40 +0000
committerKeir Fraser <keir.fraser@citrix.com>2009-12-02 08:44:40 +0000
commitf20744517f7b8186a0b5494a399aa8e6230717c7 (patch)
tree4df4fa2f6d98d107e0d2cb66fc93ec9235b59ad2 /tools/libxl/libxl_utils.c
parente2e6a280af4e450020c6f4e576066890dba9bf4e (diff)
downloadxen-f20744517f7b8186a0b5494a399aa8e6230717c7.tar.gz
xen-f20744517f7b8186a0b5494a399aa8e6230717c7.tar.bz2
xen-f20744517f7b8186a0b5494a399aa8e6230717c7.zip
libxenlight: two small fixes
- set the domid of the guest and not the one of the stubdom in the libxl_device_model_starting returned to the user; - check that the length of the two strings matches in libxl_name_to_domid, otherwise we can get a match for two different domains that have the same initial part of the name. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Diffstat (limited to 'tools/libxl/libxl_utils.c')
-rw-r--r--tools/libxl/libxl_utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index 6c4b04fd0f..4a8f44f814 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -68,7 +68,7 @@ int libxl_name_to_domid(struct libxl_ctx *ctx, char *name, uint32_t *domid)
for (i = 0; i < num; i++) {
snprintf(path, sizeof(path), "/local/domain/%s/name", l[i]);
domname = xs_read(ctx->xsh, XBT_NULL, path, &len);
- if (domname != NULL && !strncmp(domname, name, len)) {
+ if (domname != NULL && len == strlen(name) && !strncmp(domname, name, len)) {
int domid_i = atoi(l[i]);
for (j = 0; j < nb_domains; j++) {
if (dominfo[j].domid == domid_i) {