* [PATCH 7/7] libxenlight resend: get state for one domain
@ 2009-12-02 18:03 Andres Lagar-Cavilla
2009-12-03 12:42 ` Stefano Stabellini
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Andres Lagar-Cavilla @ 2009-12-02 18:03 UTC (permalink / raw)
To: Stefano Stabellini, Vincent Hanquez, xen-devel
[-- Attachment #1: Type: text/plain, Size: 125 bytes --]
Simple function to get the dominfo state of a single domain.
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
[-- Attachment #2: 07_get_state_one_domain.patch --]
[-- Type: text/plain, Size: 1600 bytes --]
# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.com>
# Date 1259285614 18000
# Node ID 39484f864ecb79a6541aee97748c8887f4e6f0cd
# Parent a5f6b5cd5472fe914b57ef8aa7a97887c2aa9aab
Simple function to get the dominfo state of a single domain.
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
diff -r a5f6b5cd5472 -r 39484f864ecb libxl.c
--- a/libxl.c
+++ b/libxl.c
@@ -362,6 +362,26 @@ static int libxl_save_device_model(struc
return 0;
}
+xc_dominfo_t *libxl_domain_info(struct libxl_ctx *ctx, uint32_t domid)
+{
+ xc_dominfo_t *info;
+ int rc;
+
+ info = (xc_dominfo_t *) calloc(1, sizeof(xc_dominfo_t));
+ if (!info) {
+ return NULL;
+ }
+
+ rc = xc_domain_getinfo(ctx->xch, domid, 1, info);
+ if (rc != 1) {
+ free(info);
+ XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "Failed to get info for domain %u",
+ domid);
+ return NULL;
+ }
+
+ return info;
+}
int libxl_domain_suspend(struct libxl_ctx *ctx, libxl_domain_suspend_info *info,
uint32_t domid, int fd)
{
diff -r a5f6b5cd5472 -r 39484f864ecb libxl.h
--- a/libxl.h
+++ b/libxl.h
@@ -283,6 +283,7 @@ int libxl_console_attach(struct libxl_ct
struct libxl_dominfo * libxl_domain_list(struct libxl_ctx *ctx, int *nb_domain);
xc_dominfo_t * libxl_domain_infolist(struct libxl_ctx *ctx, int *nb_domain);
+xc_dominfo_t * libxl_domain_info(struct libxl_ctx *ctx, uint32_t domid);
typedef struct libxl_device_model_starting libxl_device_model_starting;
int libxl_create_device_model(struct libxl_ctx *ctx,
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 7/7] libxenlight resend: get state for one domain
2009-12-02 18:03 [PATCH 7/7] libxenlight resend: get state for one domain Andres Lagar-Cavilla
@ 2009-12-03 12:42 ` Stefano Stabellini
2009-12-03 16:02 ` Vincent Hanquez
2009-12-03 17:08 ` [PATCH 7/7] libxenlight meta-resend: " Andres Lagar-Cavilla
2 siblings, 0 replies; 4+ messages in thread
From: Stefano Stabellini @ 2009-12-03 12:42 UTC (permalink / raw)
To: Andres Lagar-Cavilla
Cc: xen-devel@lists.xensource.com, Vincent Hanquez,
Stefano Stabellini
On Wed, 2 Dec 2009, Andres Lagar-Cavilla wrote:
> Simple function to get the dominfo state of a single domain.
>
> Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
>
>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 7/7] libxenlight resend: get state for one domain
2009-12-02 18:03 [PATCH 7/7] libxenlight resend: get state for one domain Andres Lagar-Cavilla
2009-12-03 12:42 ` Stefano Stabellini
@ 2009-12-03 16:02 ` Vincent Hanquez
2009-12-03 17:08 ` [PATCH 7/7] libxenlight meta-resend: " Andres Lagar-Cavilla
2 siblings, 0 replies; 4+ messages in thread
From: Vincent Hanquez @ 2009-12-03 16:02 UTC (permalink / raw)
To: Andres Lagar-Cavilla
Cc: xen-devel@lists.xensource.com, Vincent Hanquez,
Stefano Stabellini
On Wed, Dec 02, 2009 at 06:03:37PM +0000, Andres Lagar-Cavilla wrote:
> Simple function to get the dominfo state of a single domain.
>
> Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
the function is buggy. you need to check that you got the right domain before
returning the domaininfo. the hypercall returns the first domain from the domid
given. i.e. if domid is not available, domid+n might be returned.
--
Vincent
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 7/7] libxenlight meta-resend: get state for one domain
2009-12-02 18:03 [PATCH 7/7] libxenlight resend: get state for one domain Andres Lagar-Cavilla
2009-12-03 12:42 ` Stefano Stabellini
2009-12-03 16:02 ` Vincent Hanquez
@ 2009-12-03 17:08 ` Andres Lagar-Cavilla
2 siblings, 0 replies; 4+ messages in thread
From: Andres Lagar-Cavilla @ 2009-12-03 17:08 UTC (permalink / raw)
To: Stefano Stabellini, Vincent Hanquez, xen-devel
[-- Attachment #1: Type: text/plain, Size: 128 bytes --]
Simple function to get the dominfo state of a single domain.
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
[-- Attachment #2: 07_get_state_one_domain.patch --]
[-- Type: text/x-patch, Size: 1816 bytes --]
# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.com>
# Date 1259857202 18000
# Node ID 3588737e991624290d499c2804959af14b8128de
# Parent 7315ca037a680d18a6c23d030139b5389a73000b
Simple function to get the dominfo state of a single domain.
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
diff -r 7315ca037a68 -r 3588737e9916 libxl.c
--- a/libxl.c
+++ b/libxl.c
@@ -334,6 +334,31 @@ static int libxl_save_device_model(struc
return 0;
}
+xc_dominfo_t *libxl_domain_info(struct libxl_ctx *ctx, uint32_t domid)
+{
+ xc_dominfo_t *info;
+ int rc;
+
+ info = (xc_dominfo_t *) calloc(1, sizeof(xc_dominfo_t));
+ if (!info) {
+ return NULL;
+ }
+ rc = xc_domain_getinfo(ctx->xch, domid, 1, info);
+ if (rc != 1) {
+ free(info);
+ XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "Failed to get info for domain %u",
+ domid);
+ return NULL;
+ }
+ if (info->domid != domid) {
+ free(info);
+ XL_LOG(ctx, XL_LOG_ERROR, "Failed to get info for domain %u"
+ ", seems to not exist anymore", domid);
+ return NULL;
+ }
+
+ return info;
+}
int libxl_domain_suspend(struct libxl_ctx *ctx, libxl_domain_suspend_info *info,
uint32_t domid, int fd)
{
diff -r 7315ca037a68 -r 3588737e9916 libxl.h
--- a/libxl.h
+++ b/libxl.h
@@ -276,6 +276,7 @@ int libxl_console_attach(struct libxl_ct
struct libxl_dominfo * libxl_domain_list(struct libxl_ctx *ctx, int *nb_domain);
xc_dominfo_t * libxl_domain_infolist(struct libxl_ctx *ctx, int *nb_domain);
+xc_dominfo_t * libxl_domain_info(struct libxl_ctx *ctx, uint32_t domid);
typedef struct libxl_device_model_starting libxl_device_model_starting;
int libxl_create_device_model(struct libxl_ctx *ctx,
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-12-03 17:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-02 18:03 [PATCH 7/7] libxenlight resend: get state for one domain Andres Lagar-Cavilla
2009-12-03 12:42 ` Stefano Stabellini
2009-12-03 16:02 ` Vincent Hanquez
2009-12-03 17:08 ` [PATCH 7/7] libxenlight meta-resend: " Andres Lagar-Cavilla
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.