forked from pool/libvirt
Updating link to change in openSUSE:Factory/libvirt revision 52.0
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=3edde9bf7d8e38f0fe238af7b554d82a
This commit is contained in:
parent
080b265f3d
commit
b55e177816
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2f91e7437893aa66fa7f2bace9ec57967ee66ac80be5cb6bbfba0acce78eb708
|
||||
size 6512919
|
3
libvirt-0.8.0.tar.bz2
Normal file
3
libvirt-0.8.0.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:98ff762add810e318d2d586ea419219e71fe29f25f32eab20bae1cd9edbbc703
|
||||
size 7478088
|
@ -1,3 +1,25 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Apr 12 18:15:38 MDT 2010 - jfehlig@novell.com
|
||||
|
||||
- Update to libvirt 0.8.0
|
||||
- Snapshot API framework
|
||||
- Add managed save API entry points
|
||||
- Timer subselection for domain clock
|
||||
- Add hook utilities
|
||||
- Network filtering API
|
||||
- Introduce a new virDomainUpdateDeviceFlags public API
|
||||
- Introduce a new public API for domain events
|
||||
- Public virDomainMigrateSetMaxDowntime API
|
||||
- Add public API for volume wiping
|
||||
- xenapi: Initial commit of the new driver
|
||||
- lots of improvements and bug fixes
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Mar 26 17:20:11 MDT 2010 - jfehlig@novell.com
|
||||
|
||||
- Fix 'virsh dominfo' crash when no security driver is configured
|
||||
fix-no-secdriver.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Mar 21 21:20:17 MST 2010 - jfehlig@novell.com
|
||||
|
||||
|
52
libvirt.spec
52
libvirt.spec
@ -1,5 +1,5 @@
|
||||
#
|
||||
# spec file for package libvirt (Version 0.7.7)
|
||||
# spec file for package libvirt (Version 0.8.0)
|
||||
#
|
||||
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
@ -113,7 +113,7 @@ Url: http://libvirt.org/
|
||||
License: LGPLv2.1+
|
||||
Group: Development/Libraries/C and C++
|
||||
AutoReqProv: yes
|
||||
Version: 0.7.7
|
||||
Version: 0.8.0
|
||||
Release: 1
|
||||
Summary: A C toolkit to interract with the virtualization capabilities of Linux
|
||||
# The client side, i.e. shared libs and virsh are in a subpackage
|
||||
@ -138,19 +138,16 @@ Requires: PolicyKit >= 0.6
|
||||
Source0: %{name}-%{version}.tar.bz2
|
||||
Source1: libvirtd.init
|
||||
# Upstream patches
|
||||
Patch0: xen-name-for-devid.patch
|
||||
Patch1: lxc-cgroup.patch
|
||||
# Need to go upstream
|
||||
Patch100: socat.patch
|
||||
Patch101: clone.patch
|
||||
Patch102: xen-pv-cdrom.patch
|
||||
Patch103: xen-domctl-ver7.patch
|
||||
Patch104: xen-tap2-support.patch
|
||||
Patch105: xend-disk-order.patch
|
||||
Patch100: xen-name-for-devid.patch
|
||||
Patch101: socat.patch
|
||||
Patch102: clone.patch
|
||||
Patch103: xen-pv-cdrom.patch
|
||||
Patch104: xen-domctl-ver7.patch
|
||||
Patch105: xen-tap2-support.patch
|
||||
Patch106: xend-disk-order.patch
|
||||
# Our patches
|
||||
Patch200: libvirtd-defaults.patch
|
||||
Patch201: suse-network.patch
|
||||
Patch202: snapshots.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
%description
|
||||
@ -254,17 +251,14 @@ Authors:
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%patch100 -p1
|
||||
%patch101
|
||||
%patch102 -p1
|
||||
%patch101 -p1
|
||||
%patch102
|
||||
%patch103 -p1
|
||||
%patch104 -p1
|
||||
%patch105 -p1
|
||||
%patch106 -p1
|
||||
%patch200 -p1
|
||||
%patch201 -p1
|
||||
%patch202 -p1
|
||||
|
||||
%build
|
||||
%if ! %{with_xen}
|
||||
@ -364,10 +358,15 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.*a $RPM_BUILD_ROOT%{py_sitedir}/*.*a
|
||||
%if ! %{with_lxc}
|
||||
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/lxc.conf
|
||||
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_lxc.aug
|
||||
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.lxc
|
||||
%endif
|
||||
%if ! %{with_qemu}
|
||||
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu.conf
|
||||
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_qemu.aug
|
||||
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.qemu
|
||||
%endif
|
||||
%if ! %{with_uml}
|
||||
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.uml
|
||||
%endif
|
||||
ln_dupes()
|
||||
{
|
||||
@ -420,10 +419,11 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/
|
||||
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/
|
||||
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/autostart
|
||||
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/nwfilter/
|
||||
%{_sysconfdir}/libvirt/nwfilter/*.xml
|
||||
%config /etc/init.d/libvirtd
|
||||
%{_sbindir}/rclibvirtd
|
||||
%config %{_sysconfdir}/libvirt/libvirtd.conf
|
||||
%config %{_sysconfdir}/logrotate.d/libvirtd
|
||||
%config %{_sysconfdir}/libvirt/qemu/networks/default.xml
|
||||
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/network/
|
||||
%dir %{_localstatedir}/run/libvirt/
|
||||
@ -439,24 +439,27 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%endif
|
||||
%{_datadir}/augeas
|
||||
%if %{with_qemu}
|
||||
%config %{_sysconfdir}/libvirt/qemu.conf
|
||||
%config (noreplace)%{_sysconfdir}/libvirt/qemu.conf
|
||||
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.qemu
|
||||
%dir %attr(0700, root, root) %{_localstatedir}/run/libvirt/qemu/
|
||||
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/qemu/
|
||||
%dir %attr(0700, root, root) %{_localstatedir}/cache/libvirt/qemu/
|
||||
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/qemu/
|
||||
%endif
|
||||
%if %{with_lxc}
|
||||
%config %{_sysconfdir}/libvirt/lxc.conf
|
||||
%config(noreplace) %{_sysconfdir}/libvirt/lxc.conf
|
||||
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.lxc
|
||||
%dir %attr(0700, root, root) %{_localstatedir}/run/libvirt/lxc/
|
||||
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/lxc/
|
||||
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/lxc/
|
||||
%attr(0755, root, root) %{_libdir}/%{name}/libvirt_lxc
|
||||
%endif
|
||||
%if %{with_uml}
|
||||
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.uml
|
||||
%dir %attr(0700, root, root) %{_localstatedir}/run/libvirt/uml/
|
||||
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/uml/
|
||||
%endif
|
||||
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/qemu/
|
||||
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/lxc/
|
||||
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/uml/
|
||||
%endif
|
||||
%if 0%{with_storage_disk}
|
||||
%{_libdir}/%{name}/libvirt_parthelper
|
||||
%endif
|
||||
@ -487,6 +490,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_datadir}/libvirt/schemas/secret.rng
|
||||
%{_datadir}/libvirt/schemas/storageencryption.rng
|
||||
%{_datadir}/libvirt/cpu_map.xml
|
||||
%{_datadir}/libvirt/schemas/nwfilter.rng
|
||||
%config %{_sysconfdir}/sasl2/libvirt.conf
|
||||
|
||||
%files devel
|
||||
|
@ -1,7 +1,7 @@
|
||||
Index: libvirt-0.7.5/daemon/libvirtd.conf
|
||||
Index: libvirt-0.8.0/daemon/libvirtd.conf
|
||||
===================================================================
|
||||
--- libvirt-0.7.5.orig/daemon/libvirtd.conf
|
||||
+++ libvirt-0.7.5/daemon/libvirtd.conf
|
||||
--- libvirt-0.8.0.orig/daemon/libvirtd.conf
|
||||
+++ libvirt-0.8.0/daemon/libvirtd.conf
|
||||
@@ -18,8 +18,8 @@
|
||||
# It is necessary to setup a CA and issue server certificates before
|
||||
# using this capability.
|
||||
@ -28,11 +28,11 @@ Index: libvirt-0.7.5/daemon/libvirtd.conf
|
||||
|
||||
# Override the default mDNS advertizement name. This must be
|
||||
# unique on the immediate broadcast network.
|
||||
Index: libvirt-0.7.5/daemon/libvirtd.c
|
||||
Index: libvirt-0.8.0/daemon/libvirtd.c
|
||||
===================================================================
|
||||
--- libvirt-0.7.5.orig/daemon/libvirtd.c
|
||||
+++ libvirt-0.7.5/daemon/libvirtd.c
|
||||
@@ -137,7 +137,7 @@ static int sigwrite = -1; /* Signa
|
||||
--- libvirt-0.8.0.orig/daemon/libvirtd.c
|
||||
+++ libvirt-0.8.0/daemon/libvirtd.c
|
||||
@@ -141,7 +141,7 @@ static int sigwrite = -1; /* Signa
|
||||
static int ipsock = 0; /* -l Listen for TCP/IP */
|
||||
|
||||
/* Defaults for configuration file elements */
|
||||
@ -41,7 +41,7 @@ Index: libvirt-0.7.5/daemon/libvirtd.c
|
||||
static int listen_tcp = 0;
|
||||
static char *listen_addr = (char *) LIBVIRTD_LISTEN_ADDR;
|
||||
static char *tls_port = (char *) LIBVIRTD_TLS_PORT;
|
||||
@@ -159,7 +159,7 @@ static int auth_tcp = REMOTE_AUTH_NONE;
|
||||
@@ -163,7 +163,7 @@ static int auth_tcp = REMOTE_AUTH_NONE;
|
||||
#endif
|
||||
static int auth_tls = REMOTE_AUTH_NONE;
|
||||
|
||||
|
@ -1,45 +0,0 @@
|
||||
commit f034c0bfd7089ba3400b7a44b97540c4a8785e35
|
||||
Author: Jim Fehlig <jfehlig@novell.com>
|
||||
Date: Sun Mar 21 19:59:13 2010 -0600
|
||||
|
||||
Avoid libvirtd crash when cgroups is not configured on host
|
||||
|
||||
Invoking virDomainSetMemory() on lxc driver results in libvirtd
|
||||
segfault when cgroups has not been configured on the host.
|
||||
|
||||
Ensure driver->cgroup is non-null before invoking
|
||||
virCgroupForDomain(). To prevent similar segfaults in the future,
|
||||
ensure driver parameter to virCgroupForDomain() is non-null before
|
||||
dereferencing.
|
||||
|
||||
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
|
||||
index aeec593..ba13065 100644
|
||||
--- a/src/lxc/lxc_driver.c
|
||||
+++ b/src/lxc/lxc_driver.c
|
||||
@@ -625,6 +625,12 @@ static int lxcDomainSetMemory(virDomainPtr dom, unsigned long newmem) {
|
||||
}
|
||||
|
||||
if (virDomainObjIsActive(vm)) {
|
||||
+ if (driver->cgroup == NULL) {
|
||||
+ lxcError(VIR_ERR_NO_SUPPORT,
|
||||
+ "%s", _("cgroups must be configured on the host"));
|
||||
+ goto cleanup;
|
||||
+ }
|
||||
+
|
||||
if (virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0) != 0) {
|
||||
lxcError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Unable to get cgroup for %s\n"), vm->def->name);
|
||||
diff --git a/src/util/cgroup.c b/src/util/cgroup.c
|
||||
index 8777781..496d9d3 100644
|
||||
--- a/src/util/cgroup.c
|
||||
+++ b/src/util/cgroup.c
|
||||
@@ -692,6 +692,9 @@ int virCgroupForDomain(virCgroupPtr driver,
|
||||
int rc;
|
||||
char *path;
|
||||
|
||||
+ if (driver == NULL)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
if (virAsprintf(&path, "%s/%s", driver->path, name) < 0)
|
||||
return -ENOMEM;
|
||||
|
1056
snapshots.patch
1056
snapshots.patch
File diff suppressed because it is too large
Load Diff
@ -1,8 +1,8 @@
|
||||
Index: libvirt-0.7.7/src/remote/remote_driver.c
|
||||
Index: libvirt-0.8.0/src/remote/remote_driver.c
|
||||
===================================================================
|
||||
--- libvirt-0.7.7.orig/src/remote/remote_driver.c
|
||||
+++ libvirt-0.7.7/src/remote/remote_driver.c
|
||||
@@ -766,12 +766,29 @@ doRemoteOpen (virConnectPtr conn,
|
||||
--- libvirt-0.8.0.orig/src/remote/remote_driver.c
|
||||
+++ libvirt-0.8.0/src/remote/remote_driver.c
|
||||
@@ -768,12 +768,29 @@ doRemoteOpen (virConnectPtr conn,
|
||||
cmd_argv[j++] = strdup ("none");
|
||||
}
|
||||
cmd_argv[j++] = strdup (priv->hostname);
|
||||
|
@ -1,256 +0,0 @@
|
||||
Index: libvirt-0.7.7/src/conf/network_conf.c
|
||||
===================================================================
|
||||
--- libvirt-0.7.7.orig/src/conf/network_conf.c
|
||||
+++ libvirt-0.7.7/src/conf/network_conf.c
|
||||
@@ -845,6 +845,135 @@ error:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
+int virNetworkIsBridge(const char *name)
|
||||
+{
|
||||
+ char *path = NULL;
|
||||
+ int ret = 0;
|
||||
+ struct stat s;
|
||||
+
|
||||
+ if (asprintf(&path, "/sys/class/net/%s/bridge", name) < 0)
|
||||
+ goto out;
|
||||
+
|
||||
+ if (stat(path, &s) != 0)
|
||||
+ goto out;
|
||||
+
|
||||
+ if (S_ISDIR(s.st_mode))
|
||||
+ ret = 1;
|
||||
+
|
||||
+out:
|
||||
+ free(path);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+static unsigned long virNetworkDefSuseGetValue(const char *netName, const char *valName)
|
||||
+{
|
||||
+ unsigned long ret = 0;
|
||||
+ char *path = NULL;
|
||||
+ FILE *f;
|
||||
+
|
||||
+ if (asprintf(&path, "/sys/class/net/%s/bridge/%s", netName, valName) < 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ if ((f = fopen(path, "r")) == NULL)
|
||||
+ goto out;
|
||||
+
|
||||
+ if (fscanf(f, "%lu", &ret) != 1) {
|
||||
+ ret = 0;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ out:
|
||||
+ if (f != NULL)
|
||||
+ fclose(f);
|
||||
+ free(path);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static virNetworkObjPtr virNetworkLoadSuseNet(virNetworkObjListPtr nets,
|
||||
+ const char *name)
|
||||
+{
|
||||
+ virNetworkDefPtr def;
|
||||
+ virNetworkObjPtr network;
|
||||
+ int err;
|
||||
+
|
||||
+ if ((network = virNetworkFindByName(nets, name))) {
|
||||
+ virNetworkObjUnlock(network);
|
||||
+ return network;
|
||||
+ }
|
||||
+
|
||||
+ if (VIR_ALLOC(network) < 0) {
|
||||
+ virNetworkReportError(VIR_ERR_NO_MEMORY, NULL);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ network->autostart = 1;
|
||||
+ network->active = 1;
|
||||
+ network->suse = 1;
|
||||
+
|
||||
+ if (VIR_ALLOC(def) < 0) {
|
||||
+ virNetworkReportError(VIR_ERR_NO_MEMORY, NULL);
|
||||
+ goto error;
|
||||
+ }
|
||||
+
|
||||
+ network->def = def;
|
||||
+
|
||||
+ /* name */
|
||||
+ def->name = strdup(name);
|
||||
+ if (def->name == NULL) {
|
||||
+ virNetworkReportError(VIR_ERR_NO_MEMORY, NULL);
|
||||
+ goto error;
|
||||
+ }
|
||||
+
|
||||
+ /* uuid */
|
||||
+ if ((err = virUUIDGenerate(def->uuid))) {
|
||||
+ virNetworkReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
+ _("Failed to generate UUID: %s"), strerror(err));
|
||||
+ goto error;
|
||||
+ }
|
||||
+
|
||||
+ /* bridge information */
|
||||
+ def->bridge = strdup(name);
|
||||
+ if (def->bridge == NULL) {
|
||||
+ virNetworkReportError(VIR_ERR_NO_MEMORY, NULL);
|
||||
+ goto error;
|
||||
+ }
|
||||
+ def->stp = (int)virNetworkDefSuseGetValue(name, "stp_state");
|
||||
+ def->delay = virNetworkDefSuseGetValue(name, "forward_delay");
|
||||
+
|
||||
+ /* Add network to the list */
|
||||
+ if (VIR_REALLOC_N(nets->objs, nets->count + 1) < 0) {
|
||||
+ virNetworkReportError(VIR_ERR_NO_MEMORY, NULL);
|
||||
+ VIR_FREE(network);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ nets->objs[nets->count] = network;
|
||||
+ nets->count++;
|
||||
+
|
||||
+ return network;
|
||||
+
|
||||
+error:
|
||||
+ virNetworkObjFree(network);
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+void virNetworkLoadSuseNetworks(virNetworkObjListPtr nets)
|
||||
+{
|
||||
+ DIR *dir = NULL;
|
||||
+ struct dirent *de;
|
||||
+
|
||||
+ dir = opendir("/sys/class/net");
|
||||
+ if (dir == NULL)
|
||||
+ return;
|
||||
+
|
||||
+ while ((de = readdir(dir))) {
|
||||
+ if (virNetworkIsBridge(de->d_name)) {
|
||||
+ virNetworkLoadSuseNet(nets, de->d_name);
|
||||
+ }
|
||||
+ }
|
||||
+ closedir(dir);
|
||||
+}
|
||||
+
|
||||
int virNetworkLoadAllConfigs(virNetworkObjListPtr nets,
|
||||
const char *configDir,
|
||||
const char *autostartDir)
|
||||
@@ -882,6 +1011,7 @@ int virNetworkLoadAllConfigs(virNetworkO
|
||||
|
||||
closedir(dir);
|
||||
|
||||
+ virNetworkLoadSuseNetworks(nets);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Index: libvirt-0.7.7/src/conf/network_conf.h
|
||||
===================================================================
|
||||
--- libvirt-0.7.7.orig/src/conf/network_conf.h
|
||||
+++ libvirt-0.7.7/src/conf/network_conf.h
|
||||
@@ -94,6 +94,7 @@ struct _virNetworkObj {
|
||||
unsigned int active : 1;
|
||||
unsigned int autostart : 1;
|
||||
unsigned int persistent : 1;
|
||||
+ unsigned int suse : 1;
|
||||
|
||||
virNetworkDefPtr def; /* The current definition */
|
||||
virNetworkDefPtr newDef; /* New definition to activate at shutdown */
|
||||
@@ -172,4 +173,7 @@ int virNetworkSetBridgeName(const virNet
|
||||
void virNetworkObjLock(virNetworkObjPtr obj);
|
||||
void virNetworkObjUnlock(virNetworkObjPtr obj);
|
||||
|
||||
+int virNetworkIsBridge(const char *name);
|
||||
+void virNetworkLoadSuseNetworks(virNetworkObjListPtr nets);
|
||||
+
|
||||
#endif /* __NETWORK_CONF_H__ */
|
||||
Index: libvirt-0.7.7/src/network/bridge_driver.c
|
||||
===================================================================
|
||||
--- libvirt-0.7.7.orig/src/network/bridge_driver.c
|
||||
+++ libvirt-0.7.7/src/network/bridge_driver.c
|
||||
@@ -811,7 +811,8 @@ networkReloadIptablesRules(struct networ
|
||||
for (i = 0 ; i < driver->networks.count ; i++) {
|
||||
virNetworkObjLock(driver->networks.objs[i]);
|
||||
|
||||
- if (virNetworkObjIsActive(driver->networks.objs[i])) {
|
||||
+ if (virNetworkObjIsActive(driver->networks.objs[i]) &&
|
||||
+ !(driver->networks.objs[i]->suse)) {
|
||||
networkRemoveIptablesRules(driver, driver->networks.objs[i]);
|
||||
if (!networkAddIptablesRules(driver, driver->networks.objs[i])) {
|
||||
/* failed to add but already logged */
|
||||
@@ -1003,6 +1004,12 @@ static int networkShutdownNetworkDaemon(
|
||||
unlink(stateFile);
|
||||
VIR_FREE(stateFile);
|
||||
|
||||
+ if (network->suse) {
|
||||
+ VIR_WARN("Network '%s' is not under libvirt control and will not be "
|
||||
+ "shutdown\n", network->def->name);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
if (network->dnsmasqPid > 0)
|
||||
kill(network->dnsmasqPid, SIGTERM);
|
||||
|
||||
@@ -1098,11 +1105,25 @@ static int networkCloseNetwork(virConnec
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static void networkDriverSuseRefresh(struct network_driver *driver) {
|
||||
+ int i = 0;
|
||||
+ virNetworkObjPtr netObj;
|
||||
+
|
||||
+ virNetworkLoadSuseNetworks(&driver->networks);
|
||||
+ while (i < driver->networks.count) {
|
||||
+ netObj = driver->networks.objs[i];
|
||||
+ if (netObj->suse && !virNetworkIsBridge(netObj->def->name))
|
||||
+ virNetworkRemoveInactive(&driver->networks, netObj);
|
||||
+ i++;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static int networkNumNetworks(virConnectPtr conn) {
|
||||
int nactive = 0, i;
|
||||
struct network_driver *driver = conn->networkPrivateData;
|
||||
|
||||
networkDriverLock(driver);
|
||||
+ networkDriverSuseRefresh(driver);
|
||||
for (i = 0 ; i < driver->networks.count ; i++) {
|
||||
virNetworkObjLock(driver->networks.objs[i]);
|
||||
if (virNetworkObjIsActive(driver->networks.objs[i]))
|
||||
@@ -1119,6 +1140,7 @@ static int networkListNetworks(virConnec
|
||||
int got = 0, i;
|
||||
|
||||
networkDriverLock(driver);
|
||||
+ networkDriverSuseRefresh(driver);
|
||||
for (i = 0 ; i < driver->networks.count && got < nnames ; i++) {
|
||||
virNetworkObjLock(driver->networks.objs[i]);
|
||||
if (virNetworkObjIsActive(driver->networks.objs[i])) {
|
||||
@@ -1499,6 +1521,13 @@ static int networkSetAutostart(virNetwor
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
+ if (network->suse) {
|
||||
+ networkReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
+ ": Network '%s' is not under libvirt control",
|
||||
+ network->def->name);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
autostart = (autostart != 0);
|
||||
|
||||
if (network->autostart != autostart) {
|
||||
Index: libvirt-0.7.7/src/libvirt_private.syms
|
||||
===================================================================
|
||||
--- libvirt-0.7.7.orig/src/libvirt_private.syms
|
||||
+++ libvirt-0.7.7/src/libvirt_private.syms
|
||||
@@ -411,6 +411,8 @@ virNetworkSaveConfig;
|
||||
virNetworkSetBridgeName;
|
||||
virNetworkObjLock;
|
||||
virNetworkObjUnlock;
|
||||
+virNetworkLoadSuseNetworks;
|
||||
+virNetworkIsBridge;
|
||||
|
||||
|
||||
# nodeinfo.h
|
@ -1,7 +1,7 @@
|
||||
Index: libvirt-0.7.6/src/xen/xen_hypervisor.c
|
||||
Index: libvirt-0.8.0/src/xen/xen_hypervisor.c
|
||||
===================================================================
|
||||
--- libvirt-0.7.6.orig/src/xen/xen_hypervisor.c
|
||||
+++ libvirt-0.7.6/src/xen/xen_hypervisor.c
|
||||
--- libvirt-0.8.0.orig/src/xen/xen_hypervisor.c
|
||||
+++ libvirt-0.8.0/src/xen/xen_hypervisor.c
|
||||
@@ -230,11 +230,28 @@ struct xen_v2d6_getdomaininfo {
|
||||
};
|
||||
typedef struct xen_v2d6_getdomaininfo xen_v2d6_getdomaininfo;
|
||||
@ -251,11 +251,11 @@ Index: libvirt-0.7.6/src/xen/xen_hypervisor.c
|
||||
|
||||
|
||||
static int
|
||||
@@ -2106,8 +2156,16 @@ xenHypervisorInit(void)
|
||||
@@ -2105,8 +2155,16 @@ xenHypervisorInit(void)
|
||||
sys_interface_version = 7; /* XEN_SYSCTL_INTERFACE_VERSION */
|
||||
if (virXen_getdomaininfo(fd, 0, &info) == 1) {
|
||||
dom_interface_version = 6; /* XEN_DOMCTL_INTERFACE_VERSION */
|
||||
- DEBUG0("Using hypervisor call v2, sys ver7 dom ver6\n");
|
||||
- DEBUG0("Using hypervisor call v2, sys ver7 dom ver6");
|
||||
- goto done;
|
||||
+ if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0){
|
||||
+ DEBUG0("Using hypervisor call v2, sys ver6 dom ver6\n");
|
||||
|
@ -13,11 +13,11 @@ Date: Wed Jan 27 16:11:41 2010 -0700
|
||||
This approach allows removing a disk when domain is inactive. We
|
||||
obviously can't search xenstore when the domain is inactive.
|
||||
|
||||
Index: libvirt-0.7.7/src/xen/xend_internal.c
|
||||
Index: libvirt-0.8.0/src/xen/xend_internal.c
|
||||
===================================================================
|
||||
--- libvirt-0.7.7.orig/src/xen/xend_internal.c
|
||||
+++ libvirt-0.7.7/src/xen/xend_internal.c
|
||||
@@ -93,6 +93,7 @@ xenDaemonFormatSxprOnePCI(virConnectPtr
|
||||
--- libvirt-0.8.0.orig/src/xen/xend_internal.c
|
||||
+++ libvirt-0.8.0/src/xen/xend_internal.c
|
||||
@@ -91,6 +91,7 @@ xenDaemonFormatSxprOnePCI(virDomainHostd
|
||||
|
||||
static int
|
||||
virDomainXMLDevID(virDomainPtr domain,
|
||||
@ -25,7 +25,7 @@ Index: libvirt-0.7.7/src/xen/xend_internal.c
|
||||
virDomainDeviceDefPtr dev,
|
||||
char *class,
|
||||
char *ref,
|
||||
@@ -4212,7 +4213,7 @@ xenDaemonAttachDeviceFlags(virDomainPtr
|
||||
@@ -4161,7 +4162,7 @@ xenDaemonAttachDeviceFlags(virDomainPtr
|
||||
|
||||
sexpr = virBufferContentAndReset(&buf);
|
||||
|
||||
@ -34,7 +34,16 @@ Index: libvirt-0.7.7/src/xen/xend_internal.c
|
||||
/* device doesn't exist, define it */
|
||||
ret = xend_op(domain->conn, domain->name, "op", "device_create",
|
||||
"config", sexpr, NULL);
|
||||
@@ -4306,7 +4307,7 @@ xenDaemonDetachDeviceFlags(virDomainPtr
|
||||
@@ -4274,7 +4275,7 @@ xenDaemonUpdateDeviceFlags(virDomainPtr
|
||||
|
||||
sexpr = virBufferContentAndReset(&buf);
|
||||
|
||||
- if (virDomainXMLDevID(domain, dev, class, ref, sizeof(ref))) {
|
||||
+ if (virDomainXMLDevID(domain, def, dev, class, ref, sizeof(ref))) {
|
||||
virXendError(VIR_ERR_OPERATION_INVALID, "%s",
|
||||
_("requested device does not exist"));
|
||||
goto cleanup;
|
||||
@@ -4366,7 +4367,7 @@ xenDaemonDetachDeviceFlags(virDomainPtr
|
||||
def, xml, VIR_DOMAIN_XML_INACTIVE)))
|
||||
goto cleanup;
|
||||
|
||||
@ -43,7 +52,7 @@ Index: libvirt-0.7.7/src/xen/xend_internal.c
|
||||
goto cleanup;
|
||||
|
||||
if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV) {
|
||||
@@ -6060,6 +6061,7 @@ error:
|
||||
@@ -6114,6 +6115,7 @@ error:
|
||||
*/
|
||||
static int
|
||||
virDomainXMLDevID(virDomainPtr domain,
|
||||
@ -51,7 +60,7 @@ Index: libvirt-0.7.7/src/xen/xend_internal.c
|
||||
virDomainDeviceDefPtr dev,
|
||||
char *class,
|
||||
char *ref,
|
||||
@@ -6068,27 +6070,33 @@ virDomainXMLDevID(virDomainPtr domain,
|
||||
@@ -6122,27 +6124,33 @@ virDomainXMLDevID(virDomainPtr domain,
|
||||
xenUnifiedPrivatePtr priv = domain->conn->privateData;
|
||||
char *xref;
|
||||
char *tmp;
|
||||
|
@ -1,8 +1,8 @@
|
||||
Index: libvirt-0.7.7/src/xen/xend_internal.c
|
||||
Index: libvirt-0.8.0/src/xen/xend_internal.c
|
||||
===================================================================
|
||||
--- libvirt-0.7.7.orig/src/xen/xend_internal.c
|
||||
+++ libvirt-0.7.7/src/xen/xend_internal.c
|
||||
@@ -5475,7 +5475,10 @@ xenDaemonFormatSxprDisk(virConnectPtr co
|
||||
--- libvirt-0.8.0.orig/src/xen/xend_internal.c
|
||||
+++ libvirt-0.8.0/src/xen/xend_internal.c
|
||||
@@ -5524,7 +5524,10 @@ xenDaemonFormatSxprDisk(virConnectPtr co
|
||||
} else if (def->device == VIR_DOMAIN_DISK_DEVICE_CDROM) {
|
||||
virBufferVSprintf(buf, "(dev '%s:cdrom')", def->dst);
|
||||
} else {
|
||||
|
@ -1,8 +1,8 @@
|
||||
Index: libvirt-0.7.6/src/xen/xend_internal.c
|
||||
Index: libvirt-0.8.0/src/xen/xend_internal.c
|
||||
===================================================================
|
||||
--- libvirt-0.7.6.orig/src/xen/xend_internal.c
|
||||
+++ libvirt-0.7.6/src/xen/xend_internal.c
|
||||
@@ -1606,7 +1606,8 @@ xenDaemonParseSxprDisks(virConnectPtr co
|
||||
--- libvirt-0.8.0.orig/src/xen/xend_internal.c
|
||||
+++ libvirt-0.8.0/src/xen/xend_internal.c
|
||||
@@ -1593,7 +1593,8 @@ xenDaemonParseSxprDisks(virDomainDefPtr
|
||||
but blktap disks ended up in a differently named
|
||||
(device (tap ....)) block.... */
|
||||
if (sexpr_lookup(node, "device/vbd") ||
|
||||
@ -12,7 +12,7 @@ Index: libvirt-0.7.6/src/xen/xend_internal.c
|
||||
char *offset;
|
||||
const char *src = NULL;
|
||||
const char *dst = NULL;
|
||||
@@ -1617,10 +1618,14 @@ xenDaemonParseSxprDisks(virConnectPtr co
|
||||
@@ -1604,10 +1605,14 @@ xenDaemonParseSxprDisks(virDomainDefPtr
|
||||
src = sexpr_node(node, "device/vbd/uname");
|
||||
dst = sexpr_node(node, "device/vbd/dev");
|
||||
mode = sexpr_node(node, "device/vbd/mode");
|
||||
|
@ -1,8 +1,8 @@
|
||||
Index: libvirt-0.7.6/src/xen/xend_internal.c
|
||||
Index: libvirt-0.8.0/src/xen/xend_internal.c
|
||||
===================================================================
|
||||
--- libvirt-0.7.6.orig/src/xen/xend_internal.c
|
||||
+++ libvirt-0.7.6/src/xen/xend_internal.c
|
||||
@@ -1612,20 +1612,24 @@ xenDaemonParseSxprDisks(virConnectPtr co
|
||||
--- libvirt-0.8.0.orig/src/xen/xend_internal.c
|
||||
+++ libvirt-0.8.0/src/xen/xend_internal.c
|
||||
@@ -1599,20 +1599,24 @@ xenDaemonParseSxprDisks(virDomainDefPtr
|
||||
const char *src = NULL;
|
||||
const char *dst = NULL;
|
||||
const char *mode = NULL;
|
||||
@ -27,13 +27,11 @@ Index: libvirt-0.7.6/src/xen/xend_internal.c
|
||||
}
|
||||
|
||||
if (VIR_ALLOC(disk) < 0)
|
||||
@@ -1749,8 +1753,13 @@ xenDaemonParseSxprDisks(virConnectPtr co
|
||||
|
||||
@@ -1737,7 +1741,12 @@ xenDaemonParseSxprDisks(virDomainDefPtr
|
||||
if (VIR_REALLOC_N(def->disks, def->ndisks+1) < 0)
|
||||
goto no_memory;
|
||||
-
|
||||
|
||||
- def->disks[def->ndisks++] = disk;
|
||||
+
|
||||
+ if (bootable == 1 && def->ndisks > 0) {
|
||||
+ memmove(def->disks + 1, def->disks, sizeof(def->disks) * def->ndisks);
|
||||
+ def->disks[0] = disk;
|
||||
|
Loading…
Reference in New Issue
Block a user