[libvirt] [PATCH] network: get vlan info for Open vSwitch interfaces from proper source
by Laine Stump
This bug was revealed by the crash described in
https://bugzilla.redhat.com/show_bug.cgi?id=852383
The vlan info pointer sent to virNetDevOpenvswitchAddPort should never
be non-NULL unless there is at least one tag. The factthat such a vlan
info pointer was receveid pointed out that a caller was passing the
wrong pointer. Instead of sending &net->vlan, the result of
virDomainNetGetActualVlan(net) should be sent - that function will
look for vlan info in net->data.network.actual->vlan, and in cany case
return NULL instead of a pointer if the vlan info it finds has no
tags.
Aside from causing the crash, sending a hardcoded &net->vlan has the
effect of ignoring vlan info from a <network> or <portgroup> config.
---
Since I'm not online in a regular fashion for the next few days (too
bad I wasn't online in the 12 hours or so *before* the 0.10.0 release
instead of after :-/), I would appreciate if whoever ACKs this could
push it. Thanks!
src/qemu/qemu_command.c | 2 +-
src/uml/uml_conf.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 8c32a4d..25f2451 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -258,7 +258,7 @@ qemuNetworkIfaceConnect(virDomainDefPtr def,
err = virNetDevTapCreateInBridgePort(brname, &net->ifname, &net->mac,
def->uuid, &tapfd,
virDomainNetGetActualVirtPortProfile(net),
- &net->vlan,
+ virDomainNetGetActualVlan(net),
tap_create_flags);
virDomainAuditNetDevice(def, net, "/dev/net/tun", tapfd >= 0);
if (err < 0) {
diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c
index 5461b42..410f3e2 100644
--- a/src/uml/uml_conf.c
+++ b/src/uml/uml_conf.c
@@ -141,7 +141,7 @@ umlConnectTapDevice(virConnectPtr conn,
if (virNetDevTapCreateInBridgePort(bridge, &net->ifname, &net->mac,
vm->uuid, NULL,
virDomainNetGetActualVirtPortProfile(net),
- &net->vlan,
+ virDomainNetGetActualVlan(net),
VIR_NETDEV_TAP_CREATE_IFUP) < 0) {
if (template_ifname)
VIR_FREE(net->ifname);
--
1.7.11.4
12 years, 2 months
[libvirt] Release of libvirt-0.10.0
by Daniel Veillard
As planned, I tagged the release this morning and pushed the builds
at the usual place:
ftp://libvirt.org/libvirt/
This is a huge release, with close to 550 commits, which is normal
considering the time since the 0.9.13 release, close to two month instead
of one. I think it's better to go back to monthly releases schedule for
now, and I would rather have the next one soon than late so expect to
enter a freeze for 0.10.1 about 3 weeks from now.
So quite a lot of features in that version including the Parallel
driver. But there is a very large set of commits which are code
improvements and refactoring which don't show up as features but are
fairly large !
Features:
- agent: add qemuAgentArbitraryCommand() for general qemu agent command (MATSUDA Daiki)
- Introduce virDomainPinEmulator and virDomainGetEmulatorPinInfo functions. (Tang Chen)
- network: use firewalld instead of iptables, when available (Thomas Woerner)
- network: make network driver vlan-aware (Laine Stump)
- esx: Implement network driver (Matthias Bolte)
- driver for parallels hypervisor (Dmitry Guryanov)
- Various LXC improvements (Daniel P. Berrange)
- Add virDomainGetHostname (Guido Günther)
Documentation:
- CPU allocation and pinning clarification (Martin Kletzander)
- libssh2_transport: Add docs to remote.html (Peter Krempa)
- Fix some typos in messages, docs and comments. (Yuri Chornoivan)
- fix blockpull/blockcopy bandwidth Mbps -> MiB/s (Stefan Hajnoczi)
- qemu: modify 3 error messages (Martin Kletzander)
- Enhance documentation of log_filters (Jiri Denemark)
- Update libvirtd --help output to match code (Doug Goldstein)
- Update paths in man page to reflect libvirtd code (Doug Goldstein)
- Fix man page file paths to real paths (Doug Goldstein)
- Update documentation for CPU quota/period support for LXC (Sukadev Bhattiprolu)
- docs/virsh: various minor fixes (Martin Kletzander)
- autogenerate search.php (Martin Kletzander)
- fix 404 page when fetched from different location (Martin Kletzander)
- Add method to print warnings in docBuilder class (Peter Krempa)
- maint: avoid regression on copyright listings (Eric Blake)
- maint: Use consistent copyright. (Osier Yang)
- add more description on libvirtd option timeout (Guannan Ren)
- virsh man page - domain-id consistency (Jan Tomko)
- Fixup manpage names and copyright dates (Laine Stump)
- conf: Fix typo in virDomainHostdevSubsys comment (Jiri Denemark)
- maint: spelling correction in AUTHORS (Eric Blake)
- virsh: Clarify that memtune parameters may be rounded in the man page (Jan Tomko)
- Fix time keeping example for the guest clock (Doug Goldstein)
- Desert the FSF address in copyright (Osier Yang)
- Improve patch submission guidelines (Michal Privoznik)
- Clarify direct migration (Jiri Denemark)
- added description of the vendor_id attribute (Hendrik Schwartke)
- virsh: Clarify documentation for virsh dompmsuspend command (Peter Krempa)
Portability:
- Don't require gawk for a simple print expression (Guido Günther)
- Portability fixes for non-linux or old linux platforms (Daniel Veillard)
- build: define 'inline' iff HAVE_LIBNL1 (Michal Privoznik)
- build: work with older libnl1 headers (Eric Blake)
- specfile: require libnl3 for Fedora >= 18 and RHEL >= 7 (Laine Stump)
- build: add LIBNL_CFLAGS to build of libvirt_lxc (Laine Stump)
- Fix a missing build requirement on dbus-devel (Daniel Veillard)
- Fix parameter list in virNetlinkEvent{Add,Remove}Client Win32 stubs (Daniel P. Berrange)
- build: avoid $(builddir) in Makefile (Eric Blake)
- build: network requires location of dbus headers (Eric Blake)
- atomic: mark header functions static (Eric Blake)
- build: work with glibc that lacks CPU_COUNT (Eric Blake)
- build: work with older RHEL 5 kernel (Eric Blake)
- build: silence stupid gcc warning on STREQ_NULLABLE (Eric Blake)
- Fix parsing of uid/gid on Mingw32 (Daniel P. Berrange)
- build: fix build with autoconf 2.59 (Eric Blake)
- Fix build of virsh on Win32 by moving SA_SIGINFO stub (Daniel P. Berrange)
- Make Win32 stub of vshAskReedit non-static (Daniel P. Berrange)
- Fix WIN32 conditional for disabling console command (Daniel P. Berrange)
- build: avoid warnings on older gcc (Eric Blake)
- Fix virJSONValueToString prototype for Mingw32 (Daniel P. Berrange)
- random: link with -lm when needed (Eric Blake)
- build: fix link error with appArmor (Eric Blake)
- virsh.c: Fix compiler warning (Cole Robinson)
- Avoid clash of base64 symbols (Daniel P. Berrange)
- build: fix build without HAVE_CAPNG (Eric Blake)
- Fix libnl CFLAGS/LIBS inclusion (Doug Goldstein)
- build: fix compilation without struct ifreq (Eric Blake)
- configure: rbd doesn't need -lcrypto (Cole Robinson)
- build: fix typo that breaks non-Linux builds (Eric Blake)
BugFixes:
- nwfilter: Don't try to acquire DBus context when DBus is disabled (Peter Krempa)
- util: Prevent libvirtd crash (Alex Jia)
- security_dac: Don't return uninitialised uid and gid for image labels (Peter Krempa)
- security_dac: Don't return uninitialised value when parsing seclabels (Peter Krempa)
- security_dac: Avoid segfault when no label is requested (Peter Krempa)
- util: Fix error message when getpwuid_r fails to find the user (Peter Krempa)
- conf: Fix the problem which cause libvirtd to crash (Osier Yang)
- qemu: Fix define logic (Michal Privoznik)
- qemu_agent: Switch to virReportSystemError() on system error (Michal Privoznik)
- conf: prevent NULL pointer access in virSecurityLabelDefsParseXML (Ján Tomko)
- rpc: fix segmentation fault caused by null client-sock (Guannan Ren)
- qemu: fix regression with spice tls port allocation (Martin Kletzander)
- qemu: fix regression with pinning (Martin Kletzander)
- virsh: fix missing return value (Alex Jia)
- xen-xs: fix uuid of renamed domain (Philipp Hahn)
- openvz: check the exitstatus of vzlist (Laine Stump)
- network: fix virtual network bridge delay setting (Laine Stump)
- qemu: forbid suspend if already pmsuspended (Michal Privoznik)
- fix check of vcpuid in virDomainVcpuPinDefParseXML (Hu Tao)
- util: eliminate erroneous VIR_WARNs in (eb|ip)tables.c (Laine Stump)
- dnsmasq: avoid forwarding queries without a domain (Gene Czarcinski)
- virsh: don't print error info when snapshot xml is not changed (Guannan Ren)
- Fix typo in Makefile.am s/LDFOAGS/LDFLAGS/ (Daniel P. Berrange)
- client: Change default location of known_hosts file for libssh2 layer (Peter Krempa)
- command: avoid double close in virExecWithHook (Ján Tomko)
- Fix regression generating image context (Daniel P. Berrange)
- selinux: Fix incorrect object label generation. (Viktor Mihajlovski)
- conf: log error when encountering multiple filterrefs in interface (Laine Stump)
- openvz: unlock virDomainObj objects in openvzOpen (Dmitry Guryanov)
- util: typos in fallback code fo virDoubleToStr (Martin Kletzander)
- Fix timebomb in LIBVIRT_VERSION_INFO calculation (Daniel P. Berrange)
- json: fix interface locale dependency (Martin Kletzander)
- virsh: say save-image-edit failed only when it does (Ján Tomko)
- sanlock: don't unlink lockspace if registration fails (Asad Saeed)
- build: Distribute check-symfile.pl (Cole Robinson)
- Release only specific sanlock resource (Frido Roose)
- build: fix binary location in stap files --with-driver-modules (Laine Stump)
- nwfilter: fix crash during filter define when lxc driver failed startup (Laine Stump)
- nwfilter: remove target table before renaming it (Stefan Berger)
- qemu: Fix debug message in p2p migration (Jiri Denemark)
- Fix errno check, prevent spurious errors under heavy load (Peter Feiner)
- rpc: fix a virObject typo error in struct _virNetServer (Guannan Ren)
- Set LIBVIRT_AUTOSTART=0 when running test suites (Daniel P. Berrange)
- qemu: Set reasonable RSS limit on domain startup (Michal Privoznik)
- conf: Remove console stream callback only when freeing console helper (Peter Krempa)
- client: Free message when freeing client (Peter Krempa)
- build: fix "make rpm" (Laine Stump)
- Fix typo s/AM_CLFAGS/AM_CFLAGS/ in sanlock link (Daniel P. Berrange)
- virsh: console: Avoid using stream after being freed. (Peter Krempa)
- remote: Fill snapshot argument in remoteDomainSnapshotListAllChildren (Peter Krempa)
- qemu: Fix typo in qemuDomainModifyDeviceFlags (Michal Privoznik)
- build: commit to 0.10.0 release naming (Eric Blake)
- build: Link security driver into daemon (Jiri Denemark)
- Fix rpm build failures (Daniel Veillard)
- Add missing parallels_utils.h to Makefile.am (Daniel Veillard)
- qemu: syntax fix (Marc-André Lureau)
- qemu: fix use after free (Eric Blake)
- build: distribute virsh related source files (Guannan Ren)
- daemon: Fix crash in virTypedParameterArrayClear (Jiri Denemark)
- conf: Remove callback from stream when freeing entries in console hash (Peter Krempa)
- Process all pending I/O for a RPC client before checking EOF (Daniel P. Berrange)
- libvirt-guests: systemd host shutdown does not work (Gerd v. Egidy)
- virsh: Fix error resetting on fallback paths (Peter Krempa)
- virsh: Check for existence of storage before undefining the domain (Peter Krempa)
- util: Fix typoes on return value and comments (Guannan Ren)
- fixed SegFault in virauth (Martin Kletzander)
- virsh: fixed domdisplay command (Martin Kletzander)
- building: fix deps error when some drivers are not built (Wen Congyang)
- ESX: Fix ESX_VI__TEMPLATE__DYNAMIC_DEEP_COPY (Ata E Husain Bohra)
- tests: avoid seclabeltest crash (Eric Blake)
- Only enforce check for YAJL when starting a VM (Daniel P. Berrange)
- Make the 'lxc_driver' global variable non-static (Gao feng)
- Reset the 'quit' flag in virNetServerRun (Daniel P. Berrange)
- Don't autostart domains when reloading config (Daniel P. Berrange)
- esx: Fix esxVI_String_Deserialize (Matthias Bolte)
- nodeinfo: deal with offline cpus in a node (Eric Blake)
- lxcContainerMountCGroups also mounts a tmpfs that needs to be labeled. (Dan Walsh)
- remote: Fix locking in stream APIs (Jiri Denemark)
- qemu: Do not fail virConnectCompareCPU if host CPU is not known (Jiri Denemark)
- qemu: Fix probing for guest capabilities (Jiri Denemark)
- fix failure when building with --disable-debug (Hu Tao)
- virsh: remove unnecessary sleep for nodecpustats --percent (Viktor Mihajlovski)
- Fix daemon auto-spawning (Christophe Fergeau)
- Fix directory removal in filesystem storage driver (Sascha Peilicke)
- storage: Default pool permission mode to 0755 (Osier Yang)
- Fix shutdown of LXC controller (Daniel P. Berrange)
- openvz: Handle domain obj hash map errors (Guido Günther)
- Fix /domain/features setting in qemuParseCommandLine (Christophe Fergeau)
- systemd: start libvirtd after network (Jim Fehlig)
- util: Use current uid and gid if they are passed as -1 for virDirCreate (Osier Yang)
- virsh: Ensure the parents of the readline history path exists (Osier Yang)
- Fix a string format bug in qemu_cgroup.c (tangchen)
- storage_backend_fs: Allocate entry for host before accessing it (Peter Krempa)
- storage_backend_fs: Don't free a part of a structure on error (Peter Krempa)
- Only ummount /proc, /sys, /dev if the root source is '/' (Daniel P. Berrange)
- Fix one test regression on auth Ceph support (Daniel Veillard)
- Avoid build shared source files again for libvirt_lxc (Daniel P. Berrange)
- qemu: Always set auth_supported for Ceph disks. (Wido den Hollander)
- virsh: Fix ordering of arguments when calling vshCalloc. (Peter Krempa)
- remote: Fill remote parameters in remoteDomainListAllSnapshots() (Peter Krempa)
- qemu: Mark domains as having managed state image only on managed save (Peter Krempa)
- fix key error for qemuMonitorGetBlockStatsInfo (lvroyce)
Improvements:
- Introduce new VIR_ERR_AGENT_UNRESPONSIVE error code (Michal Privoznik)
- qemu: Switch to unified func name (Michal Privoznik)
- snapshot: rename an enum (Eric Blake)
- snapshot: split snapshot conf code into own file (Eric Blake)
- snapshot: make virDomainSnapshotObjList opaque (Eric Blake)
- conf: Don't always require security/@model (Michal Privoznik)
- security: Add DAC to security_drivers (Michal Privoznik)
- nwfilter: don't log error if firewalld is disabled, improve diagnostics (Laine Stump)
- qemu-agent: available in 0.10.0 (Eric Blake)
- agent: add qemu-agent-command to virsh (MATSUDA Daiki)
- agent: add python module support (MATSUDA Daiki)
- agent: add remote driver support (MATSUDA Daiki)
- agent: add qemu driver support (MATSUDA Daiki)
- agent: add virDrvDomainQemuAgentCommand prototype for drivers. (MATSUDA Daiki)
- agent : add @seconds variable to qemuAgentSend(). (MATSUDA Daiki)
- Add uevent netlink service. (Tang Chen)
- Introduce virNetlinkEventServiceStopAll() to stop all netlink services. (Tang Chen)
- Improve netlink to support all protocol. (Tang Chen)
- libssh2_session: Add support for creating known_hosts file (Peter Krempa)
- qemu: support of emulator_period and emulator_quota's modification (Wen Congyang)
- new interface to control emulator_period/emulator_quota (Hu Tao)
- qemu: introduce period/quota tuning for emulator (Hu Tao)
- limit cpu bandwidth only for vcpus (Hu Tao)
- new command emulatorpin (Hu Tao)
- Add a new function vshPrintPinInfo. (Hu Tao)
- remote: introduce emulator pinning RPCs (Tang Chen)
- qemu: support emulator pinning (Hu Tao)
- Introduce virDomainEmulatorPinAdd and virDomainEmulatorPinDel functions (Tang Chen)
- Add qemuProcessSetEmulatorAffinites and set emulator threads affinities (Tang Chen)
- qemu: synchronize emulatorpin info to cgroup (Tang Chen)
- Support emulatorpin xml parse. (Tang Chen)
- Change virDomainVcpuPinDefParseXML to support parsing emulatorpin (Hu Tao)
- Enable cpuset cgroup and synchronous vcpupin info to cgroup. (Hu Tao)
- updates of some vcpupin related functions (Hu Tao)
- refactor virDomainVcpuPinAdd() (Hu Tao)
- add function bitmapFromBytemap() to convert bytemap to bitmap (Hu Tao)
- create a new cgroup and move all emulator threads to the new cgroup (Wen Congyang)
- Introduce the function virCgroupMoveTask (Hu Tao)
- Introduce the function virCgroupForEmulator (Wen Congyang)
- output status information during guest shutdown again (Gerd v. Egidy)
- qemu: Disk Geometry Override Support (J.B. Joret)
- Support for Disk Geometry Override (J.B. Joret)
- nwfilter: provide basic support for firewalld (Stefan Berger)
- sanlock: Provide better error if lockspace directory is missing (Jiri Denemark)
- daemon: Autodetect lock driver directory (Jiri Denemark)
- build: split driver_storage into convenience library (Eric Blake)
- libssh2_transport: Use libssh2 driver code in remote driver (Peter Krempa)
- libssh2_transport: Add libssh2 session support to net client code (Peter Krempa)
- libssh2_transport: add ssh context support to virNetSocket (Peter Krempa)
- libssh2_transport: add main libssh2 transport implementation (Peter Krempa)
- Add test case for SELinux label generation (Daniel P. Berrange)
- Honour current sensitivity and category ranges in SELinux label generation (Daniel P. Berrange)
- qemu: configurable remote display port boundaries (Martin Kletzander)
- qemu: Unify port-wise SPICE and VNC behavior (Martin Kletzander)
- virsh: split out virsh-volume.c (Eric Blake)
- virsh: split out virsh-snapshot.c (Eric Blake)
- virsh: split out virsh-secret.c (Eric Blake)
- virsh: split out virsh-pool.c (Eric Blake)
- virsh: split out virsh-nwfilter.c (Eric Blake)
- virsh: split out virsh-nodedev.c (Eric Blake)
- virsh: split out virsh-network.c (Eric Blake)
- virsh: split out virsh-interface.c (Eric Blake)
- virsh: declare more common functions (Eric Blake)
- virsh: split out virsh-host.c (Eric Blake)
- virsh: split out virsh-domain-monitor.c (Eric Blake)
- Update the remote API (Marcelo Cerri)
- Support for multiple default security drivers in QEMU config (Marcelo Cerri)
- Update security layer to handle many security labels (Marcelo Cerri)
- Multiple security drivers in XML data (Marcelo Cerri)
- Internal refactory of data structures (Marcelo Cerri)
- virsh: use common namespacing (Eric Blake)
- Add support for creating sockets & RPC servers from a pre-opened fd (Daniel P. Berrange)
- Refactor impl of the virNetServerClientNew method (Daniel P. Berrange)
- Refactor the way new clients are registered with the server (Daniel P. Berrange)
- virsh: split out virsh-domain.c (Eric Blake)
- virsh: split out virsh.h (Eric Blake)
- virsh: move vshWatchJob earlier (Eric Blake)
- qemu: support netdevs from <forward mode='hostdev'> networks (Shradha Shah)
- network: support <forward mode='hostdev'> in network driver (Shradha Shah)
- conf: add function virDevicePCIAddressEqual (Shradha Shah)
- network: return netdev name or pci addr of the VF in actualDevice (Shradha Shah)
- conf: parser/formatter/rng for <forward mode='hostdev'> (Shradha Shah)
- network: helper function to create interface pool from PF (Shradha Shah)
- conf: move DevicePCIAddress functions to separate file (Shradha Shah)
- conf: Fix ABI stability check for spicevmc channel (Jiri Denemark)
- network: add support for setting VLANs on Open vSwitch ports (Kyle Mestery)
- qemu: Set swap_hard_limit before hard_limit (Osier Yang)
- build: ship stamp files (Eric Blake)
- qemu: support setting vlan tag for <interface type='hostdev'> (Laine Stump)
- util: properly save/restore original vlan tag for VFs (Laine Stump)
- qemu: Ensure the cpuset is formatted as expected before passing to cgroup (Osier Yang)
- conf: add <vlan> element to network and domain interface elements (Laine Stump)
- util: add virNetDevVlanType (Laine Stump)
- schema: fix some problems in network/interface schemas (Laine Stump)
- util: include memory.h even if WITH_VIRTUALPORT isn't defined (Laine Stump)
- Replace unset REMOTE_PID_FILE with proper value (Doug Goldstein)
- Refactor RPC client private data setup (Daniel P. Berrange)
- Add further debugging lines to domain lock manager (Daniel P. Berrange)
- Allow sync IO and keepalives to be skipped in RPC client setup (Daniel P. Berrange)
- Change interaction when accepting new RPC client connections (Daniel P. Berrange)
- Add APIs for virThreadPoolPtr to query some config params (Daniel P. Berrange)
- Allow control over JSON string pretty printing (Daniel P. Berrange)
- Change function signature for creating new lock manager instances (Daniel P. Berrange)
- parallels: add domain configuration example (Dmitry Guryanov)
- parallels: cleanup parallelsOpen and fix error message (Dmitry Guryanov)
- parallels: change URI to parallels:///system (Dmitry Guryanov)
- virsh: Add helper to avoid the strcase check for virsh-*.c (Osier Yang)
- network: add connections counter to networks (Laine Stump)
- network: change cleanup: to success/cleanup/error: in network*() functions (Laine Stump)
- conf: output forward device connections count in network XML (Laine Stump)
- conf: rename interface "usageCount" to "connections" (Laine Stump)
- conf: use a unique data type for PF array in virDomainNetDef (Laine Stump)
- network: merge relevant virtualports rather than choosing one (Laine Stump)
- conf: support partially-specified <virtualport> in parser and formatter (Laine Stump)
- conf: simplify Buffer Indentation in virDomainNetDefFormat (Laine Stump)
- conf: make error returns from virDomainActualNetDefFormat consistent (Laine Stump)
- conf: move virtPortProfile out of unions in virDomainNetDef (Laine Stump)
- util: utility functions for virNetDevVPortProfile (Laine Stump)
- util: add openvswitch case to virNetDevVPortProfileEqual (Laine Stump)
- util: eliminate union in virNetDevVPortProfile (Laine Stump)
- util: make return value of virUUIDFormat and virMacAddrFormat useful (Laine Stump)
- Pull code which finds a free MCS label out into its own method (Daniel P. Berrange)
- Honour current user and role in SELinux label generation (Daniel P. Berrange)
- Fix error reporting in virSecuritySELinuxGenNewContext (Daniel P. Berrange)
- Use VIR_ERR_CONFIG_UNSUPPORTED if requested security driver is disabled (Daniel P. Berrange)
- Add missing domain_conf.h include in security_manager.h (Daniel P. Berrange)
- Add virRandom() API to generate numbers with non-power-of-2 limit (Daniel P. Berrange)
- virsh: make 'help' command ignore spurious options (Cole Robinson)
- virsh: Convert '<cmd> --help' to 'help <cmd>' (Cole Robinson)
- virterror: Add error message for unsupported operations. (Peter Krempa)
- build: fix PROBE() usage of intptr_t (Eric Blake)
- esx: Remove redundant checks for esxVI_LookupHostSystemProperties result (Matthias Bolte)
- esx: Fix dynamic deep copy (Matthias Bolte)
- esx: Implement interface driver (Matthias Bolte)
- Add APIs for obtaining the unique ID of LVM & SCSI volumes (Daniel P. Berrange)
- examples: Update strings for event details (Jiri Denemark)
- qemu: Migrate at unlimited speed by default (Jiri Denemark)
- qemu: Refactor parsing of block device IO tuning parameters. (Peter Krempa)
- remote: Clean up coding style and refactor remote connection opening (Peter Krempa)
- Allow rbd backing stores (Peter Feiner)
- qemu: add two qemu caps for lsi and virtio-scsi SCSI controllers (Guannan Ren)
- qemu: add capabilities flags related to scsi controller (Guannan Ren)
- util: include stderr in log message when an external command fails (Laine Stump)
- Turn virNetClient* into virObject instances (Daniel P. Berrange)
- Turn virNetServer* into virObject instances (Daniel P. Berrange)
- Turn virSocket into a virObject (Daniel P. Berrange)
- Turn virKeepAlive into a virObject (Daniel P. Berrange)
- Turn virNetSASLContext and virNetSASLSession into virObject instances (Daniel P. Berrange)
- Turn virNetTLSContext and virNetTLSSession into virObject instances (Daniel P. Berrange)
- Turn qemuAgentPtr and qemuMonitorPtr into virObjectPtr instances (Daniel P. Berrange)
- Turn virDomainObjPtr into a virObjectPtr (Daniel P. Berrange)
- Convert public datatypes to inherit from virObject (Daniel P. Berrange)
- Add a generic reference counted virObject type (Daniel P. Berrange)
- apparmor: QEMU bridge helper policy updates (Richa Marwaha)
- Add -netdev bridge support (Richa Marwaha)
- Add -netdev bridge capabilities (Richa Marwaha)
- virrandom: make virRandomInitialize an automatic one-shot (Eric Blake)
- virsh: Use vshPrint instead of printf (Osier Yang)
- xen-xm: Generate UUID if not specified (Jim Fehlig)
- ESX: Add "Byte" datatype (Ata E Husain Bohra)
- parallels: translate error message (Eric Blake)
- Export virUUIDIsValid to libvirt internal code (Daniel P. Berrange)
- qemu: Allow to attach/detach controller device persistently (Osier Yang)
- Added timestamps to storage volumes (Hendrik Schwartke)
- Update xml schemas according to libvirt source (Ján Tomko)
- build: add stubs so mdns code can be unconditionally compiled (Eric Blake)
- virsh: Switch to close callback (Michal Privoznik)
- daemon: Portable auto-detection of driver module directory (Jiri Denemark)
- build: Rename security manager library (Jiri Denemark)
- build: Link security manager into libvirt.so (Jiri Denemark)
- Rewrite virAtomic APIs using GLib's atomic ops code (Daniel P. Berrange)
- Remove manual one-shot global initializers (Daniel P. Berrange)
- qemu: Add support for "none" USB controller (Peter Krempa)
- domain_conf: Add helpers to verify if device configuration is valid (Peter Krempa)
- domain_conf: Add USB controler model "none" (Peter Krempa)
- storage: netfs and iscsi need option srcSpec for resource discovery (Guannan Ren)
- maint: consolidate AUTHOR listings for Gerd von Egidy (Gerd v. Egidy)
- parallels: implement VM creation (Dmitry Guryanov)
- parallels: add storage driver (Dmitry Guryanov)
- parallels: implement virDomainDefineXML operation for existing domains (Dmitry Guryanov)
- parallels: add support of VNC remote display (Dmitry Guryanov)
- parallels: get info about serial ports (Dmitry Guryanov)
- parallels: implement functions for domain life cycle management (Dmitry Guryanov)
- parallels: add functions to list domains and get info (Dmitry Guryanov)
- add function virCommandNewVAList (Dmitry Guryanov)
- parallels: add driver skeleton (Dmitry Guryanov)
- Only perform symbol check against libvirt.so (Daniel P. Berrange)
- Don't link nwfilter or secrets driver to libvirt.so (Daniel P. Berrange)
- Remove bogus libvirt_network.syms file (Daniel P. Berrange)
- build: Don't export xenLinuxDomainBlockStats symbol (Jiri Denemark)
- Improve error message in LXC startup with network is not active (Daniel P. Berrange)
- Remove tabs from all perl files & enforce this (Daniel P. Berrange)
- Add handling for reboots of LXC containers (Daniel P. Berrange)
- Allow CAP_SYS_REBOOT on new enough kernels (Daniel P. Berrange)
- Run an RPC protocol over the LXC controller monitor (Daniel P. Berrange)
- Make RPC code generator a little more flexible (Daniel P. Berrange)
- Move LXC monitor code out into separate file (Daniel P. Berrange)
- Convert the LXC driver to use virNetClient (Daniel P. Berrange)
- Replace use of lxcError with virReportError (Daniel P. Berrange)
- Rename lxc_driver_t to virLXCDriver (Daniel P. Berrange)
- Rename all APIs in lxc_domain.c to have a virLXCDomain prefix (Daniel P. Berrange)
- Rename all APIs in lxc_process.c to have a virLXCProcess prefix (Daniel P. Berrange)
- Extend events demo to show close callbacks in use (Daniel P. Berrange)
- Update remote driver to support the connection close callbacks (Daniel P. Berrange)
- Add callback to virNetClient to be invoked on connection close (Daniel P. Berrange)
- Ensure client is marked for close in all error paths (Daniel P. Berrange)
- Add public API to register a callback to be invoked on connection close (Daniel P. Berrange)
- esx: Improve error reporting for unknown VI types (Matthias Bolte)
- security: Skip labeling resources when seclabel defaults to none (Jiri Denemark)
- lib: Revert removing of Summary and Description fields in headers (Peter Krempa)
- Add a test case that checks there are no bogus entries in .syms (Daniel P. Berrange)
- virsh: Refactor error clearing on graceful fallback paths (Peter Krempa)
- maint: don't permit format strings without % (Eric Blake)
- maint: avoid empty regex in syntax checker (Eric Blake)
- virsh: check if specified debug level is in range (Ján Tomko)
- build: update to latest gnulib, for secure tarball (Eric Blake)
- util: set minimum value of nodesuspend duration to 60 seconds (Guannan Ren)
- virsh: Move command group definition into its own file (Osier Yang)
- virsh: Split cmds in node device group from virsh.c (Osier Yang)
- virsh: Split cmds in host group from virsh.c (Osier Yang)
- virsh: Split cmds to manage domain snapshot from virsh.c (Osier Yang)
- virsh: Split cmds to manage secret from virsh.c (Osier Yang)
- virsh: Split cmds to manage network filter from virsh.c (Osier Yang)
- virsh: Split cmds to manage host interface from virsh.c (Osier Yang)
- virsh: Split cmds to manage network from virsh.c (Osier Yang)
- virsh: Split cmds of storage pool group from virsh.c (Osier Yang)
- virsh: Split cmds of storage volume group from virsh.c (Osier Yang)
- virsh: Split cmds of domain group from virsh.c (Osier Yang)
- virsh: Split cmds for domain monitoring from virsh.c (Osier Yang)
- virsh: Move definition of cmds and cmd groups right at the top of main (Osier Yang)
- daemon: Fix the wrong macro name (Osier Yang)
- More advanced auto-detection of driver module directory (Daniel P. Berrange)
- adding handling EINTR to poll to make it more robust (Royce Lv)
- build: regenerate .png files (Eric Blake)
- Make ESX & Hyper-V code generator safe with parallel builds (Daniel P. Berrange)
- tests: Add support for catching domain XML parsing errors (Peter Krempa)
- maint: Clean up coding style and fix error message spelling (Peter Krempa)
- Fix test failure when no IPv6 is avail (Doug Goldstein)
- vmx: handle shared folders parsing (Jean-Baptiste Rouault)
- vmx: handle shared folders formatting (Jean-Baptiste Rouault)
- openvz: Implement domainGetHostname (Guido Günther)
- openvz: Add openvzVEGetStringParam (Guido Günther)
- remote: Provide RPC call for domainGetHostname (Guido Günther)
- virsh: Add domhostname (Guido Günther)
- Report 'errno' in int1 field of virErrorPtr (Daniel P. Berrange)
- Use a hash table for storing MCS labels (Daniel P. Berrange)
- Fix error handling when adding MCS labels (Daniel P. Berrange)
- Use standard naming prefix for SELinux driver function names (Daniel P. Berrange)
- Disable NWFilter driver completely when unprivileged (Daniel P. Berrange)
- Replace use of custom macros with virReportError in the Xen drivers (Daniel P. Berrange)
- Make sure xenHypervisorInit correctly reports errors (Daniel P. Berrange)
- Ensure failure to talk to Xen hypervisor is fatal when privileged (Daniel P. Berrange)
- Using virOnce for global initialization (Daniel P. Berrange)
- Replace use of VMX_ERROR with virReportError (Daniel P. Berrange)
- Replace use of virNetError with virReportError (Daniel P. Berrange)
- Replace use of virConfError with virReportError (Daniel P. Berrange)
- Replace use of nodeReportError with virReportError (Daniel P. Berrange)
- Replace use of virSecurityReportError with virReportError (Daniel P. Berrange)
- Replace use of PHYP_ERROR with virReportError (Daniel P. Berrange)
- Replace use of HYPERV_ERROR with virReportError (Daniel P. Berrange)
- Replace use of ESX_ERROR & ESX_VI_ERROR with virReportError (Daniel P. Berrange)
- Replace use of virLockError with virReportError (Daniel P. Berrange)
- Replace use of libxlError with virReportError (Daniel P. Berrange)
- Add missing "%s" format string to constant error messages in lock manager (Jiri Denemark)
- Add missing "%s" format string to constant error messages in libxl driver (Jiri Denemark)
- Replace use of streamsReportError with virReportError (Daniel P. Berrange)
- Replace use of remoteError with virReportError (Daniel P. Berrange)
- Replace use of XENXS_ERROR with virReportError (Daniel P. Berrange)
- Replace use of openvzError with virReportError (Daniel P. Berrange)
- Fix Xen driver to have sensible error messages (Daniel P. Berrange)
- Move LXC process management code into separate file (Daniel P. Berrange)
- Move cgroup setup code out of lxc_controller.c (Daniel P. Berrange)
- Move LXC domain private data into separate file (Daniel P. Berrange)
- Replace use of vmwareError with virReportError (Daniel P. Berrange)
- Replace use of virCPUReportError with virReportError (Daniel P. Berrange)
- Replace use of testError with virReportError (Daniel P. Berrange)
- Replace use of vboxError with virReportError (Daniel P. Berrange)
- Replace use of xenapiError with virReportError (Daniel P. Berrange)
- Replace use of qemuReportError with virReportError (Daniel P. Berrange)
- qemu: Add missing "%s" before translation macros (Peter Krempa)
- Replace use of umlReportError with virReportError (Daniel P. Berrange)
- Add lots of internal symbols to libvirt_private.syms (Daniel P. Berrange)
- If in delay close mode for an RPC client, don't read further data (Daniel P. Berrange)
- Add missing deps on driver modules in libvirt RPM (Daniel P. Berrange)
- Replace use of networkReportError with virReportError (Daniel P. Berrange)
- maint: add mailmap entry for Dan Walsh (Eric Blake)
- esx: Extend esxVI_CURL_Download for partial downloads (Matthias Bolte)
- Replace use of interfaceReportError with virReportError (Daniel P. Berrange)
- Replace use of virNWFilterReportError with virReportError (Daniel P. Berrange)i Add missing "%s" with constant string error message in nwfilter_dhcpsnoop.c (Daniel P. Berrange)
- Add a sheepdog backend for the storage driver (Sebastian Wiedenroth)
- Mount all tmpfs filesystems with correct SELinux label (Daniel J Walsh)
- Replace use of virNodeDeviceReportError with virReportError (Daniel P. Berrange)
- Replace use of virSecretReportError with virReportError (Daniel P. Berrange)
- Replace use of virStorageReportError with virReportError (Daniel P. Berrange)
- Add missing "%s" format to const error message in RBD storage driver (Daniel P. Berrange)
- Convert all files in src/conf/ to use virReportError() (Daniel P. Berrange)
- Add missing _(...) around 2 error messages in test driver (Daniel P. Berrange)
- Fix parameter passed with VIR_ERR_INVALID_ARG in sanlock driver (Daniel P. Berrange)
- Convert all files in src/rpc/ to use virReportError() (Daniel P. Berrange)
- Convert (nearly) all files in src/util/ to use virReportError() (Daniel P. Berrange)
- Fix bogus cast to (int) in virNetServerMDNSTimeoutNew (Daniel P. Berrange)
- Add missing "%s" with constant string error message in stats_linux.c (Daniel P. Berrange)
- Remove newline from end of error message in virnodesuspend.c (Daniel P. Berrange)
- Add _(...) around two error messages in src/util/ (Daniel P. Berrange)
- Introduce virReportError macro for general error reporting (Daniel P. Berrange)
- xenapi: Convert to virMacAddr (Jiri Denemark)
- nwfilter: Convert to virMacAddrPtr not virMacAddrPtr* (Michal Privoznik)
- nwfilter: Convert to virMacAddrPtr completely (Michal Privoznik)
- Convert 'raw MAC address' usages to use virMacAddr (Stefan Berger)
- Wire up handling for QMP's BALLOON_EVENT (Daniel P. Berrange)
- Define public API for receiving guest memory balloon events (Daniel P. Berrange)
- ARMHF: CPU Support for armhf. (Chuck Short)
- Support creation of sparse LVM volumes (Daniel P. Berrange)
- Remove all use of virRun in storage code (Daniel P. Berrange)
- test: Add test case for nodeinfotest if host machine doesn't have NUMA (Peter Krempa)
- test: Add new test case for nodeinfotest (Peter Krempa)
- nodeinfo: Fix gathering of nodeinfo data structure (Peter Krempa)
- nodeinfo_test: Enhance test data before changing nodeinfo gathering (Peter Krempa)
- S390: Adding testcases for s390 (Viktor Mihajlovski)
- S390: Domain Schema for s390-virtio machines. (Viktor Mihajlovski)
- S390: Add support for virtio-s390 devices. (Viktor Mihajlovski)
- qemu: Change tests to use (modified) qemuDomainAssignAddresses (Viktor Mihajlovski)
- qemu: Extended qemuDomainAssignAddresses to be callable from everywhere. (Viktor Mihajlovski)
- build: detect all improper uses of _("%s") (Eric Blake)
- maint: update preferred contributor name (Eric Blake)
- storage_conf: Break long line and polish coding style (Peter Krempa)
- esx: Wrap libcurl multi handle (Matthias Bolte)
- Switch to using virNetServer APIs for monitor socket (Daniel P. Berrange)
- Move loop device setup code into virfile.{c,h} (Daniel P. Berrange)
- Move cgroup objects into virLXCControllerPtr (Daniel P. Berrange)
- Move monitor into virLXCControllerPtr (Daniel P. Berrange)
- Move /dev/pts setup out of virLXCControllerRun (Daniel P. Berrange)
- Move security manager into virLXCControllerPtr object (Daniel P. Berrange)
- Move loop device FDs into virLXCControllerPtr object (Daniel P. Berrange)
- Move daemon handshake FD into virLXCControllerPtr (Daniel P. Berrange)
- Make console handling part of virLXCControllerPtr (Daniel P. Berrange)
- Store the init PID in the virLXCController object (Daniel P. Berrange)
- Move veth device management into virLXCControllerPtr object (Daniel P. Berrange)
- Introduce a virLXCControllerPtr object to hold LXC controller state (Daniel P. Berrange)
- Allow RPC server to run single threaded (Daniel P. Berrange)
- Add a opaque parameter to the RPC client init callback (Daniel P. Berrange)
- vmware: detect when a domain was shut down from the inside (Jean-Baptiste Rouault)
- Added the attribute vendor_id to the cpu model (Hendrik Schwartke)
- qemu: add rbd to whitelist of migration-safe formats (Josh Durgin)
Cleanups:
- atomic: fix whitespace in previous patch (Eric Blake)
- virsh: drop unused headers (Eric Blake)
- maint: prohibit translations in testsuite (Eric Blake)
- Fix syntax-check failures wrt virsh (Daniel P. Berrange)
- virsh: kill some double underscores (Eric Blake)
- Fix the indentions of libvirt.h.in (Osier Yang)
- build: fix syntax check during 'make distcheck' (Eric Blake)
- Move some SASL symbols into libvirt_sasl.syms (Daniel P. Berrange)
- Remove unused qemuProcessAutoDestroyRun decl from header (Daniel P. Berrange)
- maint: drop a leftover comment line (Eric Blake)
- Destroy virdomainlist.[ch] (Osier Yang)
- qemu:rename qemuCheckScsiControllerModel function (Guannan Ren)
- Don't check the 'connect' command in virsh-all test (Daniel P. Berrange)
- build: drop conditional use of mdns code (Eric Blake)
- Remove unused uuidstr variable from datatypes.c (Daniel P. Berrange)
- Fix indentions (Osier Yang)
- gitignore: Reorder alphabetically (Michal Privoznik)
- spec: Remove extra () with return statement (Jiri Denemark)
- conf: Remove dead code from virConsoleOpen() (Peter Krempa)
- python: Don't generate bodies for close callback functions (Peter Krempa)
- maint: regenerate bootstrap (Eric Blake)
- Remove accidentally commited virNetClientSetEOFNotify symbol (Daniel P. Berrange)
- Remove two non-existant NWFilter driver symbols from .syms (Daniel P. Berrange)
- tests: reduce length of nodeinfodata test names (Eric Blake)
- rpc: remove trailing whitespace character in error string (Guannan Ren)
- po: avoid spurious double spaces in messages (Eric Blake)
- virsh: remove extra space between function name and opening brace (Guido Günther)
- maint: revert gnulib update, until fixed automake is in more distros (Eric Blake)
- maint: use full author name for previous commit (Eric Blake)
That's a long list, a very long list, so thanks everybody for the
huge work, be it with patches, bug reports, documentation fixes, etc. !
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
12 years, 2 months
[libvirt] [PATCH] Fix configuration of QEMU security drivers
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
If no 'security_driver' config option was set, then the code
just loaded the 'dac' security driver. This is a regression
on previous behaviour, where we would probe for a possible
security driver. ie default to SELinux if available.
This changes things so that it 'security_driver' is not set,
we once again do probing. For simplicity we also always
create the stack driver, even if there is only one driver
active.
The desired semantics are:
- security_driver not set
-> probe for selinux/apparmour/nop
-> auto-add DAC driver
- security_driver set to a string
-> add that one driver
-> auto-add DAC driver
- security_driver set to a list
-> add all drivers in list
-> auto-add DAC driver
It is not allowed, or possible to specify 'dac' in the
security_driver config param, since that is always
enabled.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/qemu/qemu_driver.c | 135 +++++++++++++---------------------------
src/security/security_manager.c | 8 ++-
src/security/security_stack.c | 38 ++++-------
src/security/security_stack.h | 8 ---
4 files changed, 61 insertions(+), 128 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 9a25253..374349a 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -249,119 +249,70 @@ static int
qemuSecurityInit(struct qemud_driver *driver)
{
char **names;
- char *primary = NULL;
virSecurityManagerPtr mgr = NULL;
- virSecurityManagerPtr nested = NULL;
virSecurityManagerPtr stack = NULL;
bool hasDAC = false;
- /* set the name of the primary security driver */
- if (driver->securityDriverNames)
- primary = driver->securityDriverNames[0];
-
- /* add primary security driver */
- if ((primary == NULL && driver->privileged) ||
- STREQ_NULLABLE(primary, "dac")) {
- if (!driver->privileged) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("DAC security driver usable only when "
- "running privileged (as root)"));
- goto error;
- }
-
- mgr = virSecurityManagerNewDAC(QEMU_DRIVER_NAME,
- driver->user,
- driver->group,
- driver->allowDiskFormatProbing,
- driver->securityDefaultConfined,
- driver->securityRequireConfined,
- driver->dynamicOwnership);
- hasDAC = true;
- } else {
- mgr = virSecurityManagerNew(primary,
- QEMU_DRIVER_NAME,
- driver->allowDiskFormatProbing,
- driver->securityDefaultConfined,
- driver->securityRequireConfined);
- }
-
- if (!mgr)
- goto error;
-
- /* We need a stack to group the security drivers if:
- * - additional drivers are provived in configuration
- * - the primary driver isn't DAC and we are running privileged
- */
- if ((driver->privileged && !hasDAC) ||
- (driver->securityDriverNames && driver->securityDriverNames[1])) {
- if (!(stack = virSecurityManagerNewStack(mgr)))
- goto error;
- mgr = stack;
- }
-
- /* Loop through additional driver names and add them as nested */
if (driver->securityDriverNames) {
- names = driver->securityDriverNames + 1;
+ names = driver->securityDriverNames;
while (names && *names) {
- if (STREQ("dac", *names)) {
- /* A DAC driver has specific parameters */
- if (!driver->privileged) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("DAC security driver usable only when "
- "running privileged (as root)"));
- goto error;
- }
-
- nested = virSecurityManagerNewDAC(QEMU_DRIVER_NAME,
- driver->user,
- driver->group,
- driver->allowDiskFormatProbing,
- driver->securityDefaultConfined,
- driver->securityRequireConfined,
- driver->dynamicOwnership);
+ if (STREQ("dac", *names))
hasDAC = true;
- } else {
- nested = virSecurityManagerNew(*names,
- QEMU_DRIVER_NAME,
- driver->allowDiskFormatProbing,
- driver->securityDefaultConfined,
- driver->securityRequireConfined);
- }
-
- if (!nested)
- goto error;
- if (virSecurityManagerStackAddNested(stack, nested))
+ if (!(mgr = virSecurityManagerNew(*names,
+ QEMU_DRIVER_NAME,
+ driver->allowDiskFormatProbing,
+ driver->securityDefaultConfined,
+ driver->securityRequireConfined)))
goto error;
-
- nested = NULL;
+ if (!stack) {
+ if (!(stack = virSecurityManagerNewStack(mgr)))
+ goto error;
+ } else {
+ if (virSecurityManagerStackAddNested(stack, mgr) < 0)
+ goto error;
+ }
+ mgr = NULL;
names++;
}
- }
-
- if (driver->privileged && !hasDAC) {
- if (!(nested = virSecurityManagerNewDAC(QEMU_DRIVER_NAME,
- driver->user,
- driver->group,
- driver->allowDiskFormatProbing,
- driver->securityDefaultConfined,
- driver->securityRequireConfined,
- driver->dynamicOwnership)))
+ } else {
+ if (!(mgr = virSecurityManagerNew(NULL,
+ QEMU_DRIVER_NAME,
+ driver->allowDiskFormatProbing,
+ driver->securityDefaultConfined,
+ driver->securityRequireConfined)))
goto error;
-
- if (virSecurityManagerStackAddNested(stack, nested))
+ if (!(stack = virSecurityManagerNewStack(mgr)))
goto error;
+ mgr = NULL;
+ }
- nested = NULL;
+ if (!hasDAC && driver->privileged) {
+ if (!(mgr = virSecurityManagerNewDAC(QEMU_DRIVER_NAME,
+ driver->user,
+ driver->group,
+ driver->allowDiskFormatProbing,
+ driver->securityDefaultConfined,
+ driver->securityRequireConfined,
+ driver->dynamicOwnership)))
+ goto error;
+ if (!stack) {
+ if (!(stack = virSecurityManagerNewStack(mgr)))
+ goto error;
+ } else {
+ if (virSecurityManagerStackAddNested(stack, mgr) < 0)
+ goto error;
+ }
+ mgr = NULL;
}
- driver->securityManager = mgr;
+ driver->securityManager = stack;
return 0;
error:
VIR_ERROR(_("Failed to initialize security drivers"));
+ virSecurityManagerFree(stack);
virSecurityManagerFree(mgr);
- virSecurityManagerFree(nested);
return -1;
}
diff --git a/src/security/security_manager.c b/src/security/security_manager.c
index 0e106d5..367f7ad 100644
--- a/src/security/security_manager.c
+++ b/src/security/security_manager.c
@@ -49,6 +49,12 @@ static virSecurityManagerPtr virSecurityManagerNewDriver(virSecurityDriverPtr dr
{
virSecurityManagerPtr mgr;
+ VIR_DEBUG("drv=%p (%s) virtDriver=%s allowDiskFormatProbing=%d "
+ "defaultConfined=%d requireConfined=%d",
+ drv, drv->name, virtDriver,
+ allowDiskFormatProbing, defaultConfined,
+ requireConfined);
+
if (VIR_ALLOC_VAR(mgr, char, drv->privateDataLen) < 0) {
virReportOOMError();
return NULL;
@@ -80,7 +86,7 @@ virSecurityManagerPtr virSecurityManagerNewStack(virSecurityManagerPtr primary)
if (!mgr)
return NULL;
- virSecurityStackAddPrimary(mgr, primary);
+ virSecurityStackAddNested(mgr, primary);
return mgr;
}
diff --git a/src/security/security_stack.c b/src/security/security_stack.c
index 7dcd626..0eb7e76 100644
--- a/src/security/security_stack.c
+++ b/src/security/security_stack.c
@@ -38,35 +38,31 @@ struct _virSecurityStackItem {
};
struct _virSecurityStackData {
- virSecurityManagerPtr primary;
virSecurityStackItemPtr itemsHead;
};
int
-virSecurityStackAddPrimary(virSecurityManagerPtr mgr,
- virSecurityManagerPtr primary)
-{
- virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr);
- if (virSecurityStackAddNested(mgr, primary) < 0)
- return -1;
- priv->primary = primary;
- return 0;
-}
-
-int
virSecurityStackAddNested(virSecurityManagerPtr mgr,
virSecurityManagerPtr nested)
{
virSecurityStackItemPtr item = NULL;
virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr);
+ virSecurityStackItemPtr tmp;
+
+ tmp = priv->itemsHead;
+ while (tmp && tmp->next)
+ tmp = tmp->next;
if (VIR_ALLOC(item) < 0) {
virReportOOMError();
return -1;
}
item->securityManager = nested;
- item->next = priv->itemsHead;
- priv->itemsHead = item;
+ if (tmp)
+ tmp->next = item;
+ else
+ priv->itemsHead = item;
+
return 0;
}
@@ -74,19 +70,7 @@ virSecurityManagerPtr
virSecurityStackGetPrimary(virSecurityManagerPtr mgr)
{
virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr);
- return (priv->primary) ? priv->primary : priv->itemsHead->securityManager;
-}
-
-void virSecurityStackSetPrimary(virSecurityManagerPtr mgr,
- virSecurityManagerPtr primary)
-{
- virSecurityStackAddPrimary(mgr, primary);
-}
-
-void virSecurityStackSetSecondary(virSecurityManagerPtr mgr,
- virSecurityManagerPtr secondary)
-{
- virSecurityStackAddNested(mgr, secondary);
+ return priv->itemsHead->securityManager;
}
static virSecurityDriverStatus
diff --git a/src/security/security_stack.h b/src/security/security_stack.h
index 6898c03..5bb3be7 100644
--- a/src/security/security_stack.h
+++ b/src/security/security_stack.h
@@ -27,19 +27,11 @@ extern virSecurityDriver virSecurityDriverStack;
int
-virSecurityStackAddPrimary(virSecurityManagerPtr mgr,
- virSecurityManagerPtr primary);
-int
virSecurityStackAddNested(virSecurityManagerPtr mgr,
virSecurityManagerPtr nested);
virSecurityManagerPtr
virSecurityStackGetPrimary(virSecurityManagerPtr mgr);
-void virSecurityStackSetPrimary(virSecurityManagerPtr mgr,
- virSecurityManagerPtr primary);
-void virSecurityStackSetSecondary(virSecurityManagerPtr mgr,
- virSecurityManagerPtr secondary);
-
virSecurityManagerPtr*
virSecurityStackGetNested(virSecurityManagerPtr mgr);
--
1.7.11.2
12 years, 2 months
[libvirt] [PATCH] qemu: Sort the numa params only when it requires to affect the live config
by Osier Yang
As the next boot doesn't have to worry about the previous numa
params setting (there is no).
---
src/qemu/qemu_driver.c | 52 ++++++++++++++++++++++++-----------------------
1 files changed, 27 insertions(+), 25 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 955744a..bc7de9f 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -7204,32 +7204,34 @@ qemuDomainSetMemoryParameters(virDomainPtr dom,
goto cleanup;
}
- /* Get current swap hard limit */
- rc = virCgroupGetMemSwapHardLimit(group, &val);
- if (rc != 0) {
- virReportSystemError(-rc, "%s",
- _("unable to get swap hard limit"));
- goto cleanup;
- }
+ if (flags & VIR_DOMAIN_AFFECT_LIVE) {
+ /* Get current swap hard limit */
+ rc = virCgroupGetMemSwapHardLimit(group, &val);
+ if (rc != 0) {
+ virReportSystemError(-rc, "%s",
+ _("unable to get swap hard limit"));
+ goto cleanup;
+ }
- /* Swap hard_limit and swap_hard_limit to ensure the setting
- * could succeed if both of them are provided.
- */
- if (swap_hard_limit && hard_limit) {
- virTypedParameter param;
-
- if (swap_hard_limit->value.ul > val) {
- if (hard_limit_index < swap_hard_limit_index) {
- param = params[hard_limit_index];
- params[hard_limit_index] = params[swap_hard_limit_index];
- params[swap_hard_limit_index] = param;
- }
- } else {
- if (hard_limit_index > swap_hard_limit_index) {
- param = params[hard_limit_index];
- params[hard_limit_index] = params[swap_hard_limit_index];
- params[swap_hard_limit_index] = param;
- }
+ /* Swap hard_limit and swap_hard_limit to ensure the setting
+ * could succeed if both of them are provided.
+ */
+ if (swap_hard_limit && hard_limit) {
+ virTypedParameter param;
+
+ if (swap_hard_limit->value.ul > val) {
+ if (hard_limit_index < swap_hard_limit_index) {
+ param = params[hard_limit_index];
+ params[hard_limit_index] = params[swap_hard_limit_index];
+ params[swap_hard_limit_index] = param;
+ }
+ } else {
+ if (hard_limit_index > swap_hard_limit_index) {
+ param = params[hard_limit_index];
+ params[hard_limit_index] = params[swap_hard_limit_index];
+ params[swap_hard_limit_index] = param;
+ }
+ }
}
}
--
1.7.7.3
12 years, 2 months
[libvirt] Support for pass through lines in domain XML?
by Jagane Sundar
Hello All,
I have a question regarding the domain XML and its conversion to
hypervisor specific config files.
I am using libvirt to talk to vmware ESX. ESX has a feature where you
can add a line such as:
guestinfo.xxx=abc
in the .vmx file that describes the VM. Later, the guest can extract the
value of the variable xxx and use it. One potential use for such a
mechanism is to pass in the public key string for the root user. Another
use could be for passing in the static ip address to the VM. For
example, the following line can be added to the .vmx file for the VM:
guestinfo.ipaddress=10.0.0.223
In the guest, running the command:
$ vmtoolsd --cmd "info-get guestinfo.ipaddress"
will print out 10.0.0.223, and this value can be used by the script to
configure the static IP address.
My question is this: Is there a way for me to add this line
'guestinfo.ipaddress=10.0.0.223' to the domain XML. When this domain XML
is converted to a .vmx file, and the resulting VM is registered with
ESX, I want the line 'guestinfo.ipaddress=10.0.0.223' to be passed
through unmolested to the .vmx file.
Thanks and keep up the good work. libvirt is a useful abstraction for
those of us needing to work with multiple virtualization technologies.
-- Jagane
12 years, 2 months
[libvirt] [PATCH 0/2] Fix DAC driver domain start regression
by Peter Krempa
The DAC driver was registered twice, breaking starting of machines if no
other security driver was used (basicaly on all non-selinux machines).
Peter Krempa (2):
Revert "security: Add DAC to security_drivers"
qemu: Refactor initialisation of security drivers.
src/qemu/qemu_driver.c | 114 +++++++++++++++++++++++++----------------
src/security/security_driver.c | 2 -
2 files changed, 69 insertions(+), 47 deletions(-)
--
1.7.12
12 years, 2 months
[libvirt] [PATCH] qemu: Fix starting domains with no cpu cgroup
by Jiri Denemark
If cgroups are enabled in general but cpu cgroup is disabled in
qemu.conf or not mounted at all, libvirt would refuse to start any
domain even though scheduler parameters are not set in domain XML.
This patch makes cpu cgroup mandatory only for domains that actually
want to use it.
---
src/qemu/qemu_cgroup.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index be1b96d..df67ff3 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -549,7 +549,8 @@ int qemuSetupCgroupForVcpu(struct qemud_driver *driver, virDomainObjPtr vm)
if (driver->cgroup == NULL)
return 0; /* Not supported, so claim success */
- if (!qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_CPU)) {
+ if ((period || quota) &&
+ !qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_CPU)) {
virReportError(VIR_ERR_SYSTEM_ERROR, "%s",
_("cgroup cpu is not active"));
return -1;
--
1.7.12
12 years, 2 months
[libvirt] [PATCH] util: Prevent libvirtd crash
by Alex Jia
* src/util/virnetdevopenvswitch.c (virNetDevOpenvswitchAddPort): avoid libvirtd
crash due to derefing a NULL virtVlan->tag.
RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=852383
Signed-off-by: Alex Jia <ajia(a)redhat.com>
---
src/util/virnetdevopenvswitch.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.c
index 601d79e..7d38ff8 100644
--- a/src/util/virnetdevopenvswitch.c
+++ b/src/util/virnetdevopenvswitch.c
@@ -100,7 +100,8 @@ int virNetDevOpenvswitchAddPort(const char *brname, const char *ifname,
virBufferAsprintf(buf, "%d", virtVlan->tag[i]);
}
} else {
- virBufferAsprintf(buf, "tag=%d", virtVlan->tag[0]);
+ if (virtVlan->nTags)
+ virBufferAsprintf(buf, "tag=%d", virtVlan->tag[0]);
}
}
--
1.7.1
12 years, 2 months
[libvirt] [PATCH] security: remove dead code from virSecurityDACGenLabel
by Alex Jia
* src/security/security_dac.c: remove useless dead code.
Signed-off-by: Alex Jia <ajia(a)redhat.com>
---
src/security/security_dac.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/src/security/security_dac.c b/src/security/security_dac.c
index 5de7391..211fb37 100644
--- a/src/security/security_dac.c
+++ b/src/security/security_dac.c
@@ -891,7 +891,6 @@ virSecurityDACGenLabel(virSecurityManagerPtr mgr,
case VIR_DOMAIN_SECLABEL_NONE:
/* no op */
return 0;
- break;
default:
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected security label type '%s'"),
--
1.7.1
12 years, 2 months
[libvirt] [test-API][PATCH] Fix problem in create netfs pool and logical volume
by Wayne Sun
create_netfs_pool:
In rhel7 the source nfs mount dir shows in /proc/mounts will end with a
'/' which in rhel6 and rhel5 didn't. So the check with exact match will
fail on rhel7. Change with '/*' will accept with both '/' exist or not.
create_logical_volume:
When grep lvcreate command in /etc/lvm/backup/logical_pool for create
logical volume, rhel6 and rhel7 command is slightly differnet with
rhel5, so make the change to fit for all version.
Signed-off-by: Wayne Sun <gsun(a)redhat.com>
---
repos/storage/create_logical_volume.py | 6 +++---
repos/storage/create_netfs_pool.py | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/repos/storage/create_logical_volume.py b/repos/storage/create_logical_volume.py
index 098c148..9fd1305 100644
--- a/repos/storage/create_logical_volume.py
+++ b/repos/storage/create_logical_volume.py
@@ -54,9 +54,9 @@ def check_volume_create(poolobj, poolname, volname, size):
logger.debug("%s file path: %s" % (poolname, path))
if os.access(path, os.R_OK):
logger.debug("execute grep lvcreate %s command" % path)
- stat, ret = commands.getstatusoutput("grep \
-'lvcreate --name %s -L %sK /dev/%s' %s"\
- % (volname, size, poolname, path))
+ stat, ret = commands.getstatusoutput(
+ "grep 'lvcreate --name %s -L %sK .*%s' %s"
+ % (volname, size, poolname, path))
if stat == 0 and volname in poolobj.listVolumes():
logger.debug(ret)
return True
diff --git a/repos/storage/create_netfs_pool.py b/repos/storage/create_netfs_pool.py
index 9fb7b69..4603788 100644
--- a/repos/storage/create_netfs_pool.py
+++ b/repos/storage/create_netfs_pool.py
@@ -44,7 +44,7 @@ def check_pool_create_OS(conn, poolname, logger):
(src_host, src_path, dest_path) )
fd = open("/proc/mounts","r")
mount = src_host + ":" + src_path
- pat = mount + "\s+" + dest_path
+ pat = mount + "/*\s+" + dest_path
found = 0
for line in fd:
if re.match(pat, line):
--
1.7.1
12 years, 2 months