aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xenstore/xs.c
diff options
context:
space:
mode:
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>2005-10-23 22:45:15 +0100
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>2005-10-23 22:45:15 +0100
commitfea77823212ce8b48b1897cb73dd0590896809eb (patch)
tree4440fe26eddd8ca15bc3a57646a2a83f08ef5911 /tools/xenstore/xs.c
parent4384b3fc7028be8e027d984e4f7e38a0d488211d (diff)
downloadxen-fea77823212ce8b48b1897cb73dd0590896809eb.tar.gz
xen-fea77823212ce8b48b1897cb73dd0590896809eb.tar.bz2
xen-fea77823212ce8b48b1897cb73dd0590896809eb.zip
Change the semantics of GetDomainPath so that it always succeeds, regardless of
whether a domain has been introduced to the store. Added a separate message XS_IS_DOMAIN_INTRODUCED and API for that (xs_is_domain_introduced) to determine whether the domain has really been introduced. This change means that the tools can determine the correct domain path earlier in the domain creation process, which is particularly a factor with live migration, as it allows us to create the devices earlier in the process, and unpause the new domain before performing the introduce. Until recently we already had these features, but the simplification of the interface between xend and xenstored caused breakage. No longer clear out the domain path when a domain is introduced -- this was a hack to work around the recent problematic semantics of GetDomainPath. Do not write the contents of the info block to the store. All the configuration info is written to the /vm path, and anything else in the info block is either dealt with explicitly or is ephemeral and has no place in the store. Signed-off-by: Ewan Mellor <ewan@xensource.com>
Diffstat (limited to 'tools/xenstore/xs.c')
-rw-r--r--tools/xenstore/xs.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/tools/xenstore/xs.c b/tools/xenstore/xs.c
index 22710d5d01..a817a88077 100644
--- a/tools/xenstore/xs.c
+++ b/tools/xenstore/xs.c
@@ -696,13 +696,20 @@ bool xs_introduce_domain(struct xs_handle *h,
ARRAY_SIZE(iov), NULL));
}
-bool xs_release_domain(struct xs_handle *h, unsigned int domid)
+static void * single_with_domid(struct xs_handle *h,
+ enum xsd_sockmsg_type type,
+ unsigned int domid)
{
char domid_str[MAX_STRLEN(domid)];
sprintf(domid_str, "%u", domid);
- return xs_bool(xs_single(h, NULL, XS_RELEASE, domid_str, NULL));
+ return xs_single(h, NULL, type, domid_str, NULL);
+}
+
+bool xs_release_domain(struct xs_handle *h, unsigned int domid)
+{
+ return xs_bool(single_with_domid(h, XS_RELEASE, domid));
}
char *xs_get_domain_path(struct xs_handle *h, unsigned int domid)
@@ -714,6 +721,12 @@ char *xs_get_domain_path(struct xs_handle *h, unsigned int domid)
return xs_single(h, NULL, XS_GET_DOMAIN_PATH, domid_str, NULL);
}
+bool xs_is_domain_introduced(struct xs_handle *h, unsigned int domid)
+{
+ return strcmp("F",
+ single_with_domid(h, XS_IS_DOMAIN_INTRODUCED, domid));
+}
+
/* Only useful for DEBUG versions */
char *xs_debug_command(struct xs_handle *h, const char *cmd,
void *data, unsigned int len)