* src/xend_internal.c: Lookup guest after starting persistent
config in order to refresh the domain ID field
---
src/xend_internal.c | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/src/xend_internal.c b/src/xend_internal.c
index 7bcee7d..459b6bc 100644
--- a/src/xend_internal.c
+++ b/src/xend_internal.c
@@ -4537,6 +4537,8 @@ virDomainPtr xenDaemonDomainDefineXML(virConnectPtr conn, const char
*xmlDesc) {
int xenDaemonDomainCreate(virDomainPtr domain)
{
xenUnifiedPrivatePtr priv;
+ int ret;
+ virDomainPtr tmp;
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
virXendError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG,
@@ -4549,7 +4551,17 @@ int xenDaemonDomainCreate(virDomainPtr domain)
if (priv->xendConfigVersion < 3)
return(-1);
- return xend_op(domain->conn, domain->name, "op", "start",
NULL);
+ ret = xend_op(domain->conn, domain->name, "op", "start",
NULL);
+
+ if (ret != -1) {
+ /* Need to force a refresh of this object's ID */
+ tmp = virDomainLookupByName(domain->conn, domain->name);
+ if (tmp) {
+ domain->id = tmp->id;
+ virDomainFree(tmp);
+ }
+ }
+ return ret;
}
int xenDaemonDomainUndefine(virDomainPtr domain)
--
1.6.4
Show replies by date
On Wed, Aug 26, 2009 at 06:24:09PM +0100, Daniel P. Berrange wrote:
* src/xend_internal.c: Lookup guest after starting persistent
config in order to refresh the domain ID field
Makes sense, pushing.
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit
http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine
http://rpmfind.net/
http://veillard.com/ | virtualization library
http://libvirt.org/