SHA256
1
0
forked from pool/libvirt

Plumb domain description in xend backend

OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=25
This commit is contained in:
James Fehlig 2009-12-07 22:08:05 +00:00 committed by Git OBS Bridge
parent f43c97a7dc
commit e07dd7f899
7 changed files with 89 additions and 17 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Dec 7 14:51:36 MST 2009 - jfehlig@novell.com
- Plumb domain description in xend backend
xend-description-tag.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Nov 24 17:46:08 MST 2009 - jfehlig@novell.com Tue Nov 24 17:46:08 MST 2009 - jfehlig@novell.com

View File

@ -93,6 +93,7 @@ Source1: libvirtd.init
# Upstream patches # Upstream patches
Patch0: xen-list-defined.patch Patch0: xen-list-defined.patch
Patch1: detach-disk.patch Patch1: detach-disk.patch
Patch2: xend-description-tag.patch
# Need to go upstream # Need to go upstream
Patch100: socat.patch Patch100: socat.patch
Patch101: clone.patch Patch101: clone.patch
@ -195,6 +196,7 @@ Authors:
%setup -q %setup -q
%patch0 -p1 %patch0 -p1
%patch1 -p1 %patch1 -p1
%patch2 -p1
%patch100 -p1 %patch100 -p1
%patch101 %patch101
%patch102 -p1 %patch102 -p1

View File

@ -2,7 +2,7 @@ Index: libvirt-0.7.4/src/xen/xend_internal.c
=================================================================== ===================================================================
--- libvirt-0.7.4.orig/src/xen/xend_internal.c --- libvirt-0.7.4.orig/src/xen/xend_internal.c
+++ libvirt-0.7.4/src/xen/xend_internal.c +++ libvirt-0.7.4/src/xen/xend_internal.c
@@ -4514,6 +4514,8 @@ xenDaemonDomainMigratePerform (virDomain @@ -4517,6 +4517,8 @@ xenDaemonDomainMigratePerform (virDomain
"node", "-1", "node", "-1",
"ssl", "0", "ssl", "0",
"resource", "0", /* required, xend ignores it */ "resource", "0", /* required, xend ignores it */

View File

@ -319,6 +319,18 @@ Index: libvirt-0.7.4/src/xen/xen_driver.c
xenUnifiedDomainCoreDump (virDomainPtr dom, const char *to, int flags) xenUnifiedDomainCoreDump (virDomainPtr dom, const char *to, int flags)
{ {
GET_PRIVATE(dom->conn); GET_PRIVATE(dom->conn);
@@ -1860,6 +1935,11 @@ static virDriver xenUnifiedDriver = {
xenUnifiedIsSecure,
xenUnifiedDomainIsActive,
xenUnifiedDomainisPersistent,
+ xenUnifiedDomainSnapshotCreate,
+ xenUnifiedDomainSnapshotApply,
+ xenUnifiedDomainSnapshotDelete,
+ xenUnifiedDomainNumOfSnapshots,
+ xenUnifiedDomainListSnapshots,
};
/**
Index: libvirt-0.7.4/src/xen/xen_driver.h Index: libvirt-0.7.4/src/xen/xen_driver.h
=================================================================== ===================================================================
--- libvirt-0.7.4.orig/src/xen/xen_driver.h --- libvirt-0.7.4.orig/src/xen/xen_driver.h
@ -352,7 +364,7 @@ Index: libvirt-0.7.4/src/xen/xend_internal.c
/* /*
* The number of Xen scheduler parameters * The number of Xen scheduler parameters
*/ */
@@ -3268,6 +3274,87 @@ xenDaemonDomainRestore(virConnectPtr con @@ -3271,6 +3277,87 @@ xenDaemonDomainRestore(virConnectPtr con
} }
return xend_op(conn, "", "op", "restore", "file", filename, NULL); return xend_op(conn, "", "op", "restore", "file", filename, NULL);
} }
@ -440,7 +452,7 @@ Index: libvirt-0.7.4/src/xen/xend_internal.c
#endif /* !PROXY */ #endif /* !PROXY */
/** /**
@@ -5116,6 +5203,11 @@ struct xenUnifiedDriver xenDaemonDriver @@ -5123,6 +5210,11 @@ struct xenUnifiedDriver xenDaemonDriver
xenDaemonGetSchedulerType, /* domainGetSchedulerType */ xenDaemonGetSchedulerType, /* domainGetSchedulerType */
xenDaemonGetSchedulerParameters, /* domainGetSchedulerParameters */ xenDaemonGetSchedulerParameters, /* domainGetSchedulerParameters */
xenDaemonSetSchedulerParameters, /* domainSetSchedulerParameters */ xenDaemonSetSchedulerParameters, /* domainSetSchedulerParameters */

View File

@ -1,20 +1,36 @@
Index: libvirt-0.7.4/src/xen/xend_internal.c commit 7cfbb17978c467625afab866b7a22119789abee0
=================================================================== Author: Matthias Bolte <matthias.bolte@googlemail.com>
--- libvirt-0.7.4.orig/src/xen/xend_internal.c Date: Thu Nov 26 00:09:40 2009 +0100
+++ libvirt-0.7.4/src/xen/xend_internal.c
@@ -4693,13 +4693,14 @@ xenDaemonListDefinedDomains(virConnectPt xen: Fix unconditional freeing in xenDaemonListDefinedDomains()
}
Commit 790f0b3057787bb64da8c46c111ff8d3eff7b2af causes the contents of
if (ret >= maxnames) the names array to be freed even on success, resulting in no listing of
- break; defined but inactive Xen domains.
+ goto out;
Spotted by Jim Fehlig
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index e370eb8..4d9dcd1 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -4696,12 +4696,17 @@ xenDaemonListDefinedDomains(virConnectPtr conn, char **const names, int maxnames
break;
} }
+cleanup:
+ sexpr_free(root);
+ return(ret);
+
error: error:
for (i = 0; i < ret; ++i) for (i = 0; i < ret; ++i)
VIR_FREE(names[i]); VIR_FREE(names[i]);
+out: - sexpr_free(root);
sexpr_free(root); - return(ret);
return(ret); + ret = -1;
+
+ goto cleanup;
} }
/**

View File

@ -2,7 +2,7 @@ Index: libvirt-0.7.4/src/xen/xend_internal.c
=================================================================== ===================================================================
--- libvirt-0.7.4.orig/src/xen/xend_internal.c --- libvirt-0.7.4.orig/src/xen/xend_internal.c
+++ libvirt-0.7.4/src/xen/xend_internal.c +++ libvirt-0.7.4/src/xen/xend_internal.c
@@ -5358,7 +5358,10 @@ xenDaemonFormatSxprDisk(virConnectPtr co @@ -5365,7 +5365,10 @@ xenDaemonFormatSxprDisk(virConnectPtr co
} else if (def->device == VIR_DOMAIN_DISK_DEVICE_CDROM) { } else if (def->device == VIR_DOMAIN_DISK_DEVICE_CDROM) {
virBufferVSprintf(buf, "(dev '%s:cdrom')", def->dst); virBufferVSprintf(buf, "(dev '%s:cdrom')", def->dst);
} else { } else {

View File

@ -0,0 +1,36 @@
From acba9b620128c4dcdbb95a1ea06604f3013a0518 Mon Sep 17 00:00:00 2001
From: Jim Fehlig <jfehlig@novell.com>
Date: Mon, 7 Dec 2009 14:24:21 -0700
Subject: [PATCH] Plumb domain description tag in xend backend
xen-unstable changesets 20321 and 20521 added support for
description in xend domain config. This patch extends that
support in xend backend.
---
src/xen/xend_internal.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
Index: libvirt-0.7.4/src/xen/xend_internal.c
===================================================================
--- libvirt-0.7.4.orig/src/xen/xend_internal.c
+++ libvirt-0.7.4/src/xen/xend_internal.c
@@ -2360,6 +2360,9 @@ xenDaemonParseSxpr(virConnectPtr conn,
}
virUUIDParse(tmp, def->uuid);
+ if (sexpr_node_copy(root, "domain/description", &def->description) < 0)
+ goto no_memory;
+
hvm = sexpr_lookup(root, "domain/image/hvm") ? 1 : 0;
if (!hvm) {
if (sexpr_node_copy(root, "domain/bootloader",
@@ -5676,6 +5679,9 @@ xenDaemonFormatSxpr(virConnectPtr conn,
virUUIDFormat(def->uuid, uuidstr);
virBufferVSprintf(&buf, "(uuid '%s')", uuidstr);
+ if (def->description)
+ virBufferVSprintf(&buf, "(description '%s')", def->description);
+
if (def->os.bootloader) {
if (def->os.bootloader[0])
virBufferVSprintf(&buf, "(bootloader '%s')", def->os.bootloader);