Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
libvirt
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Libvirt Packaging Team
libvirt
Commits
c07c68f5
Commit
c07c68f5
authored
16 years ago
by
Guido Günther
Committed by
Guido Günther
16 years ago
Browse files
Options
Downloads
Patches
Plain Diff
prefer xenstoraged driver for listDomains
avoids seeing "ghost domains" due to bugs in several versions of the xen HV
parent
ff8e9ae5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
debian/patches/0006-xen-prefer-xenstoraged-driver-for-listDomains.patch
+116
-0
116 additions, 0 deletions
.../0006-xen-prefer-xenstoraged-driver-for-listDomains.patch
debian/patches/series
+1
-0
1 addition, 0 deletions
debian/patches/series
with
117 additions
and
0 deletions
debian/patches/0006-xen-prefer-xenstoraged-driver-for-listDomains.patch
0 → 100644
+
116
−
0
View file @
c07c68f5
From 20cd80189d752d5dc630afa8d29a3ebf0ac51649 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
Date: Wed, 26 Nov 2008 10:54:51 +0100
Subject: [PATCH] xen: prefer xenstoraged driver for listDomains
at least Debian's xen 3.2.1 reports ghost ids of already shutdown domains when
using the HV driver.
---
src/proxy_internal.c | 3 +--
src/proxy_internal.h | 2 ++
src/xen_unified.c | 29 +++++++++++++++++++++++------
src/xend_internal.c | 2 +-
src/xend_internal.h | 1 +
5 files changed, 28 insertions(+), 9 deletions(-)
diff --git a/src/proxy_internal.c b/src/proxy_internal.c
index 1378559..daf1193 100644
--- a/src/proxy_internal.c
+++ b/src/proxy_internal.c
@@ -37,7 +37,6 @@
static int xenProxyOpen(virConnectPtr conn, xmlURIPtr uri, virConnectAuthPtr aut
static int xenProxyGetVersion(virConnectPtr conn, unsigned long *hvVer);
static int xenProxyNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info);
static char *xenProxyGetCapabilities(virConnectPtr conn);
-static int xenProxyListDomains(virConnectPtr conn, int *ids, int maxids);
static int xenProxyNumOfDomains(virConnectPtr conn);
static unsigned long xenProxyDomainGetMaxMemory(virDomainPtr domain);
static int xenProxyDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info);
@@ -581,7 +580,7 @@
xenProxyGetVersion(virConnectPtr conn, unsigned long *hvVer)
*
* Returns the number of domain found or -1 in case of error
*/
-static int
+int
xenProxyListDomains(virConnectPtr conn, int *ids, int maxids)
{
virProxyPacket req;
diff --git a/src/proxy_internal.h b/src/proxy_internal.h
index 0e66c1c..693b10b 100644
--- a/src/proxy_internal.h
+++ b/src/proxy_internal.h
@@ -94,4 +94,6 @@
extern virDomainPtr xenProxyLookupByName(virConnectPtr conn,
extern char * xenProxyDomainDumpXML(virDomainPtr domain,
int flags);
+extern int xenProxyListDomains(virConnectPtr conn, int *ids,
+ int maxids);
#endif /* __LIBVIR_PROXY_H__ */
diff --git a/src/xen_unified.c b/src/xen_unified.c
index 5807391..0fb5d73 100644
--- a/src/xen_unified.c
+++ b/src/xen_unified.c
@@ -485,14 +485,31 @@
static int
xenUnifiedListDomains (virConnectPtr conn, int *ids, int maxids)
{
GET_PRIVATE(conn);
- int i, ret;
+ int ret;
- for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
- if (priv->opened[i] && drivers[i]->listDomains) {
- ret = drivers[i]->listDomains (conn, ids, maxids);
- if (ret >= 0) return ret;
- }
+ /* Try xenstore. */
+ if (priv->opened[XEN_UNIFIED_XS_OFFSET]) {
+ ret = xenStoreListDomains (conn, ids, maxids);
+ if (ret >= 0) return ret;
+ }
+ /* Try HV. */
+ if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET]) {
+ ret = xenHypervisorListDomains (conn, ids, maxids);
+ if (ret >= 0) return ret;
+ }
+
+ /* Try xend. */
+ if (priv->opened[XEN_UNIFIED_XEND_OFFSET]) {
+ ret = xenDaemonListDomains (conn, ids, maxids);
+ if (ret >= 0) return ret;
+ }
+
+ /* Try proxy. */
+ if (priv->opened[XEN_UNIFIED_PROXY_OFFSET]) {
+ ret = xenProxyListDomains (conn, ids, maxids);
+ if (ret >= 0) return ret;
+ }
return -1;
}
diff --git a/src/xend_internal.c b/src/xend_internal.c
index 2e1a8d1..9f1ad42 100644
--- a/src/xend_internal.c
+++ b/src/xend_internal.c
@@ -3455,7 +3455,7 @@
xenDaemonGetVersion(virConnectPtr conn, unsigned long *hvVer)
*
* Returns the number of domain found or -1 in case of error
*/
-static int
+int
xenDaemonListDomains(virConnectPtr conn, int *ids, int maxids)
{
struct sexpr *root = NULL;
diff --git a/src/xend_internal.h b/src/xend_internal.h
index 12fa379..af90290 100644
--- a/src/xend_internal.h
+++ b/src/xend_internal.h
@@ -178,5 +178,6 @@
int xenDaemonDomainMigratePrepare (virConnectPtr dconn, char **cookie, int *cook
int xenDaemonDomainMigratePerform (virDomainPtr domain, const char *cookie, int cookielen, const char *uri, unsigned long flags, const char *dname, unsigned long resource);
int xenDaemonDomainBlockPeek (virDomainPtr domain, const char *path, unsigned long long offset, size_t size, void *buffer);
+int xenDaemonListDomains(virConnectPtr conn, int *ids, int maxids);
#endif /* __XEND_INTERNAL_H_ */
--
1.6.0.3
This diff is collapsed.
Click to expand it.
debian/patches/series
+
1
−
0
View file @
c07c68f5
...
...
@@ -3,3 +3,4 @@
0003-allow-libvirt-group-to-access-the-socket.patch
0004-support-virtio-and-scsi-disks-in-qemudDomainBlockSta.patch
0005-fix-define-vs.-defined-typos.patch
0006-xen-prefer-xenstoraged-driver-for-listDomains.patch
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment