Hello community, here is the log from the commit of package libvirt checked in at Fri Nov 7 01:40:20 CET 2008. -------- --- libvirt/libvirt.changes 2008-10-24 00:39:26.000000000 +0200 +++ /mounts/work_src_done/STABLE/libvirt/libvirt.changes 2008-11-05 23:08:09.000000000 +0100 @@ -1,0 +2,12 @@ +Wed Nov 5 15:06:16 MST 2008 - jfehlig@novell.com + +- Expose networks managed outside of libvirt as read-only. + bnc#441633 + +------------------------------------------------------------------- +Wed Nov 5 14:55:33 MST 2008 - jfehlig@novell.com + +- Fix vnc port assignement in domain XML + bnc#441625 + +------------------------------------------------------------------- calling whatdependson for head-i586 New: ---- suse-network.patch vnc-port.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libvirt.spec ++++++ --- /var/tmp/diff_new_pack.q12142/_old 2008-11-07 01:37:58.000000000 +0100 +++ /var/tmp/diff_new_pack.q12142/_new 2008-11-07 01:37:58.000000000 +0100 @@ -49,7 +49,7 @@ Group: Development/Libraries/C and C++ AutoReqProv: yes Version: 0.4.6 -Release: 5 +Release: 6 Summary: A C toolkit to interract with the virtualization capabilities of Linux Requires: readline Requires: ncurses @@ -80,6 +80,8 @@ Patch11: cgmajor.patch Patch12: lxcpty.patch Patch13: clone.patch +Patch14: vnc-port.patch +Patch15: suse-network.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -184,6 +186,8 @@ %patch11 -p1 %patch12 -p1 %patch13 +%patch14 -p1 +%patch15 -p1 rm po/no.* %build @@ -316,6 +320,12 @@ %{py_sitedir}/libvirtmod* %changelog +* Wed Nov 05 2008 jfehlig@novell.com +- Expose networks managed outside of libvirt as read-only. + bnc#441633 +* Wed Nov 05 2008 jfehlig@novell.com +- Fix vnc port assignement in domain XML + bnc#441625 * Thu Oct 23 2008 jfehlig@novell.com - Add upstream patches to fix ordering problem with setting up cgroup containment on LXC domains. @@ -373,7 +383,7 @@ - Fixed spec file breakage due to SELinux enablement * Fri Aug 22 2008 prusnak@suse.cz - enabled SELinux support [Fate#303662] -* Tue Aug 12 2008 jfehlig@novell.com +* Mon Aug 11 2008 jfehlig@novell.com - Cleanup of libvirtd init script - Removed dnsmasq from BuildRequires * Sat Aug 09 2008 jfehlig@novell.com ++++++ suse-network.patch ++++++ Index: libvirt-0.4.6/src/network_conf.c =================================================================== --- libvirt-0.4.6.orig/src/network_conf.c +++ libvirt-0.4.6/src/network_conf.c @@ -752,6 +752,131 @@ 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(char *netName, 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, + virNetworkObjPtr *nets, + 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; + network->next = *nets; + + 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 */ + *nets = network; + return network; + + error: + virNetworkObjFree(network); + return NULL; +} + +static void virNetworkLoadSuseNetworks(virConnectPtr conn, + virNetworkObjPtr *nets) +{ + DIR *dir = NULL; + struct dirent *de; + int count = 0; + + dir = opendir("/sys/class/net"); + if (dir == NULL) + return NULL; + + while ((de = readdir(dir))) { + if (virNetworkIsBridge(de->d_name)) { + virNetworkLoadSuseNet(conn, nets, de->d_name); + } + } + closedir(dir); +} + int virNetworkLoadAllConfigs(virConnectPtr conn, virNetworkObjPtr *nets, const char *configDir, @@ -787,6 +912,7 @@ int virNetworkLoadAllConfigs(virConnectP closedir(dir); + virNetworkLoadSuseNetworks(conn, nets); return 0; } Index: libvirt-0.4.6/src/network_conf.h =================================================================== --- libvirt-0.4.6.orig/src/network_conf.h +++ libvirt-0.4.6/src/network_conf.h @@ -82,6 +82,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.4.6/src/qemu_driver.c =================================================================== --- libvirt-0.4.6.orig/src/qemu_driver.c +++ libvirt-0.4.6/src/qemu_driver.c @@ -1601,6 +1601,12 @@ static int qemudShutdownNetworkDaemon(vi if (!virNetworkIsActive(network)) return 0; + if (network->readonly) { + qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, + ": Network '%s' is readonly", network->def->name); + return -1; + } + if (network->dnsmasqPid > 0) kill(network->dnsmasqPid, SIGTERM); @@ -3974,6 +3980,12 @@ static int qemudNetworkSetAutostart(virN return -1; } + if (network->readonly) { + qemudReportError(net->conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, + ": Network '%s' is readonly", network->def->name); + return -1; + } + autostart = (autostart != 0); if (network->autostart == autostart) ++++++ vnc-port.patch ++++++ Index: libvirt-0.4.6/src/xend_internal.c =================================================================== --- libvirt-0.4.6.orig/src/xend_internal.c +++ libvirt-0.4.6/src/xend_internal.c @@ -2138,10 +2138,8 @@ xenDaemonParseSxprGraphicsNew(virConnect const char *keymap = sexpr_node(node, "device/vfb/keymap"); const char *unused = sexpr_node(node, "device/vfb/vncunused"); - if ((unused && STREQ(unused, "1")) || port == -1) { + if ((unused && STREQ(unused, "1")) || port == -1) graphics->data.vnc.autoport = 1; - port = -1; - } if (port >= 0 && port < 5900) port += 5900; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org