Mailinglist Archive: opensuse-commit (1117 mails)

< Previous Next >
commit libvirt for openSUSE:Factory
  • From: root@xxxxxxxxxxxxxxx (h_root)
  • Date: Tue, 03 Feb 2009 22:58:23 +0100
  • Message-id: <20090203215823.55687678161@xxxxxxxxxxxxxxx>

Hello community,

here is the log from the commit of package libvirt for openSUSE:Factory
checked in at Tue Feb 3 22:58:23 CET 2009.


--------
--- libvirt/libvirt.changes 2009-01-28 23:58:08.000000000 +0100
+++ libvirt/libvirt.changes 2009-02-02 19:21:37.000000000 +0100
@@ -1,0 +2,6 @@
+Fri Jan 30 16:11:54 MST 2009 - jfehlig@xxxxxxxxxx
+
+- Fix build for architectures not supporting numa
+- Forward port suse-network.patch and snapshots.patch
+
+-------------------------------------------------------------------

calling whatdependson for head-i586


New:
----
snapshots.patch
suse-network.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libvirt.spec ++++++
--- /var/tmp/diff_new_pack.PF2645/_old 2009-02-03 22:57:25.000000000 +0100
+++ /var/tmp/diff_new_pack.PF2645/_new 2009-02-03 22:57:25.000000000 +0100
@@ -30,7 +30,7 @@
%endif

Name: libvirt
-BuildRequires: PolicyKit-devel bridge-utils cyrus-sasl-devel fdupes gettext
gnutls-devel hal-devel iptables-devel libnuma-devel libxml2-devel lvm2
ncurses-devel parted-devel pkg-config python-devel readline-devel util-linux
xhtml-dtd
+BuildRequires: PolicyKit-devel bridge-utils cyrus-sasl-devel fdupes gettext
gnutls-devel hal-devel iptables-devel libxml2-devel lvm2 ncurses-devel
parted-devel pkg-config python-devel readline-devel util-linux xhtml-dtd
%if %{with_xen}
BuildRequires: xen-devel
%endif
@@ -42,6 +42,9 @@
%if %{with_selinux}
BuildRequires: libselinux-devel
%endif
+%ifarch x86_64 ia64
+BuildRequires: libnuma-devel
+%endif
# Only for directory ownership:
BuildRequires: gtk-doc
Url: http://libvirt.org/
@@ -49,7 +52,7 @@
Group: Development/Libraries/C and C++
AutoReqProv: yes
Version: 0.5.1
-Release: 1
+Release: 2
Summary: A C toolkit to interract with the virtualization capabilities
of Linux
Requires: readline
Requires: ncurses
@@ -78,6 +81,8 @@
Patch7: migrate-params.patch
Patch8: cve-2008-5086.patch
Patch9: devhelp.patch
+Patch10: suse-network.patch
+Patch11: snapshots.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build

%description
@@ -179,6 +184,8 @@
%patch7 -p1
%patch8 -p1
%patch9 -p1
+%patch10 -p1
+%patch11 -p1

%build
%if ! %{with_xen}
@@ -312,6 +319,9 @@
%{py_sitedir}/libvirtmod*

%changelog
+* Fri Jan 30 2009 jfehlig@xxxxxxxxxx
+- Fix build for architectures not supporting numa
+- Forward port suse-network.patch and snapshots.patch
* Wed Jan 28 2009 jfehlig@xxxxxxxxxx
- Updated to version 0.5.1
- CPU and scheduler support for LXC

++++++ snapshots.patch ++++++
++++ 1139 lines (skipped)

++++++ suse-network.patch ++++++
Index: libvirt-0.5.1/src/network_conf.c
===================================================================
--- libvirt-0.5.1.orig/src/network_conf.c
+++ libvirt-0.5.1/src/network_conf.c
@@ -752,6 +752,137 @@ error:
return NULL;
}

+static 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(virConnectPtr conn,
+ virNetworkObjListPtr nets,
+ const char *name)
+{
+ virNetworkDefPtr def;
+ virNetworkObjPtr network;
+ int err;
+
+ if ((network = virNetworkFindByName(nets, name))) {
+ return network;
+ }
+
+ if (VIR_ALLOC(network) < 0) {
+ virNetworkReportError(conn, VIR_ERR_NO_MEMORY, NULL);
+ return NULL;
+ }
+
+ network->autostart = 1;
+ network->active = 1;
+ network->readonly = 1;
+
+ if (VIR_ALLOC(def) < 0) {
+ virNetworkReportError(conn, VIR_ERR_NO_MEMORY, NULL);
+ goto error;
+ }
+
+ network->def = def;
+
+ /* name */
+ def->name = strdup(name);
+ if (def->name == NULL) {
+ virNetworkReportError(conn, VIR_ERR_NO_MEMORY, NULL);
+ goto error;
+ }
+
+ /* uuid */
+ if ((err = virUUIDGenerate(def->uuid))) {
+ virNetworkReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("Failed to generate UUID: %s"), strerror(err));
+ goto error;
+ }
+
+ /* bridge information */
+ def->bridge = strdup(name);
+ if (def->bridge == NULL) {
+ virNetworkReportError(conn, 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(conn, VIR_ERR_NO_MEMORY, NULL);
+ VIR_FREE(network);
+ return NULL;
+ }
+
+ nets->objs[nets->count] = network;
+ nets->count++;
+
+ return network;
+
+ error:
+ virNetworkObjFree(network);
+ return NULL;
+}
+
+static void virNetworkLoadSuseNetworks(virConnectPtr conn,
+ 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(conn, nets, de->d_name);
+ }
+ }
+ closedir(dir);
+}
+
int virNetworkLoadAllConfigs(virConnectPtr conn,
virNetworkObjListPtr nets,
const char *configDir,
@@ -787,6 +918,7 @@ int virNetworkLoadAllConfigs(virConnectP

closedir(dir);

+ virNetworkLoadSuseNetworks(conn, nets);
return 0;
}

Index: libvirt-0.5.1/src/network_conf.h
===================================================================
--- libvirt-0.5.1.orig/src/network_conf.h
+++ libvirt-0.5.1/src/network_conf.h
@@ -86,6 +86,7 @@ struct _virNetworkObj {
unsigned int active : 1;
unsigned int autostart : 1;
unsigned int persistent : 1;
+ unsigned int readonly : 1;

char *configFile; /* Persistent config file path */
char *autostartLink; /* Symlink path for autostart */
Index: libvirt-0.5.1/src/network_driver.c
===================================================================
--- libvirt-0.5.1.orig/src/network_driver.c
+++ libvirt-0.5.1/src/network_driver.c
@@ -763,6 +763,11 @@ static int networkShutdownNetworkDaemon(
if (!virNetworkIsActive(network))
return 0;

+ if (network->readonly) {
+ networkLog(NETWORK_WARN, ": Network '%s' is readonly",
network->def->name);
+ return -1;
+ }
+
if (network->dnsmasqPid > 0)
kill(network->dnsmasqPid, SIGTERM);

@@ -1082,6 +1087,12 @@ static int networkSetAutostart(virNetwor
return -1;
}

+ if (network->readonly) {
+ networkReportError(net->conn, NULL, net, VIR_ERR_INTERNAL_ERROR,
+ ": Network '%s' is readonly", network->def->name);
+ return -1;
+ }
+
autostart = (autostart != 0);

if (network->autostart == autostart)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages