Compare commits

...

141 Commits

Author SHA1 Message Date
Cole Robinson 5f6883e0fb Rebased to version 0.10.2.8
CVE-2013-4311: Insecure polkit usage (bz #1009539, bz #1005332)
CVE-2013-4296: Invalid free memory stats (bz #1006173, bz #1009667)
CVE-2013-4291: Supplementary groups handling (bz #1006509, bz #1006511)
Fix LXC container creation if selinux disabled (bz #977114)
Fix virsh change-media with block disk type (bz #951192)
2013-09-20 17:30:22 -04:00
Cole Robinson 6ed21f35ce Rebased to version 0.10.2.7
Fix crash if udev logging enabled (bz #969152)
Fix possible deadlock from getpwuid_r (bz #964358)
2013-08-01 19:32:09 -04:00
Cole Robinson fd4b7c7eda Really fix spec dates. 2013-06-12 18:35:13 -04:00
Cole Robinson a7685ecb49 Fix bogus spec dates 2013-06-12 18:16:33 -04:00
Cole Robinson 4987454f4d Rebased to version 0.10.2.6
Fix launching qemu with ccid database property (bz #904692)
Don't error if disk resize isn't multiple of 512 (bz #951495)
Fix racey cgroup error at VM startup (bz #965169)
Fix crash in nwfilter at daemon shutdown (bz #967740)
2013-06-12 17:57:01 -04:00
Cole Robinson 7d54a9531e Rebased to version 0.10.2.5
Fix creating snapshot on lvm pool (bz #955371)
Properly escape audit paths (bz #922186)
Follow updated packaging guidelines for user alloc (bz #924501)
CVE-2013-1962 Open files DoS (bz #963789, bz #953107)
2013-05-19 18:57:02 -04:00
Cole Robinson ec17372ebc Rebased to version 0.10.2.4
Fix 'Cannot parse sensitivity level in s0' error (bz #902103)
Fix updating NIC that has boot order set (bz #906446)
Fix virsh list for vmware ESX (bz #910702)
Fix libxl disk backend default (bz #912488)
2013-04-01 17:22:27 -04:00
Cole Robinson 64e6ea2c74 Rebased to version 0.10.2.3
Fix libxl driver to build against xen 4.2 (bz #870689)
Fix possible crash when destroying guests (bz #877110)
Fix loading sysctl file (bz #887017)
Fix svirt memory leak (bz #890039)
Fix attaching PCI netdev to VM (bz #893131)
Fix libvirtd segfault on shutdown (bz #903194)
Raise mem limit to stop qemu processes from getting OOM killed (bz #903432)
CVE-2013-0170 libvirt: use-after-free in virNetMessageFree() (bz #893450, bz #905173)
2013-01-28 15:20:46 -05:00
Cole Robinson 4877a48e58 Fix scriplet warning when uninstalling libvirt-client (bz #888071) 2012-12-17 18:45:55 -05:00
Cole Robinson 9862314ee5 Fix conflict with NM launched dnsmasq (bz #886663)
Fix selinux denials when launching non-kvm qemu guests (bz #885837)
2012-12-16 14:47:07 -05:00
Cole Robinson 5e3f148cab Rebased to version 0.10.2.2
CVE-2012-3411: avoid open DNS proxy with dnsmasq (bz #874702, bz #882309)
Don't ignore address for USB disks (bz #861309)
Fix error with blkdeviotune (bz #872582)
Fix cloning LVM volume (bz #869607)
Fix VDSM error when libvirt doesn't format CPU topology (bz #876475)
Use systemd macros in spec file (bz #850186)
2012-12-09 19:29:03 -05:00
Cole Robinson 8fa149f902 Add ppc64 and s390x as KVM arches for Fedora >= 18 (bz #872545) 2012-12-06 09:19:26 -05:00
Cole Robinson cc9cfaa90d Cleanly save session VMs on logout/shutdown (bz #872254) 2012-11-13 08:53:57 -05:00
Cole Robinson 2c2e71c0ce Disable libxl on F18 too 2012-10-30 20:54:40 -04:00
Cole Robinson 96b1b18b42 Rebased to version 0.10.2.1
Fix lvm volume creation when alloc=0 (bz #866481)
Clarify virsh send-keys man page example (bz #860004)
Fix occasional deadlock via virDomainDestroy (bz #859009)
Fix LXC deadlock from ctrl-c (bz #848119)
Fix occasional selinux denials with macvtap (bz #798605)
Fix multilib conflict with systemtap files (bz #831425)
Don't trigger keytab warning in system logs (bz #745203)
Fix qemu domxml-2-native NIC model out (bz #636832)
Fix error message if not enough space for lvm vol (bz #609104)
2012-10-27 17:56:09 -04:00
Cole Robinson f7763bfd17 Disable libxl driver, since it doesn't build with xen 4.2 in rawhide 2012-10-25 17:16:59 -04:00
Richard W.M. Jones 404e58cb18 Add upstream patches: don't duplicate environment variables (RHBZ#859596). 2012-09-24 20:59:05 +01:00
Richard W.M. Jones cd3767e3b9 Re-add 0001-Use-qemu-system-i386-as-binary-instead-of-qemu.patch
NB: This patch is Fedora-specific and not upstream.
2012-09-24 18:36:40 +01:00
Daniel Veillard f1867a5ecc Upstream release 0.10.2 2012-09-24 14:22:55 +08:00
Richard W.M. Jones b5548f62cb Add (upstream) patches to label sockets for SELinux (RHBZ#853393). 2012-09-21 18:58:41 +01:00
Richard W.M. Jones 52f3bedee7 Fix for 32 bit qemu renamed to qemu-system-i386 (RHBZ#857026).
The difference in the output of virsh capabilities (non-root)
before and after is:

 <capabilities>

   <host>
-    <uuid>9ecd5b8f-4b44-5dae-f4c6-4b9cf108e47a</uuid>
+    <uuid>4cae6f0f-dd64-8d9a-bc36-b3f2e62844cf</uuid>
     <cpu>
       <arch>i686</arch>
       <model>Westmere</model>
@@ -34,7 +34,7 @@
     <os_type>hvm</os_type>
     <arch name='i686'>
       <wordsize>32</wordsize>
-      <emulator>/bin/qemu-system-x86_64</emulator>
+      <emulator>/bin/qemu-system-i386</emulator>
       <machine>pc-1.2</machine>
       <machine>none</machine>
       <machine canonical='pc-1.2'>pc</machine>
2012-09-13 15:03:19 +01:00
Cole Robinson f87237919c Drop unneeded dnsmasq --filterwin2k
Fix unwanted connection closing, needed for boxes
Fix libvirtd segfault with old netcf-libs (bz 853381)
2012-09-12 08:18:36 -04:00
Daniel P. Berrange e8969fb913 Remove dep on ceph RPM (rhbz #854360) 2012-09-05 11:01:22 +01:00
Daniel Veillard 74d46bc7dd Release of libvirt-0.10.1
Brown paper bag release
2012-08-31 21:52:10 +08:00
Daniel Veillard 4b6ea94306 Upstream release of 0.10.0
- agent: add qemuAgentArbitraryCommand() for general qemu agent command
- Introduce virDomainPinEmulator and virDomainGetEmulatorPinInfo functions
- network: use firewalld instead of iptables, when available
- network: make network driver vlan-aware
- esx: Implement network driver
- driver for parallels hypervisor
- Various LXC improvements
- Add virDomainGetHostname
- a lot of bug fixes, improvements and portability work
2012-08-29 14:32:06 +08:00
Daniel Veillard 963754bc8c Fix a missing build requirement on dbus-devel 2012-08-23 16:14:20 +08:00
Daniel Veillard 7b5483236c release candidate 1 of 0.10.0 2012-08-23 15:53:24 +08:00
Daniel P. Berrange 438006407c Add correct patch for fixing module linkage & enable autotools
Add the correct patch to fix the module linkage problems
and enable autotools, so the Makefile.am changes actually
get applied
2012-08-14 16:21:02 +01:00
Daniel Veillard 76c8282ee2 Fix missing symbols in libvirt daemon in rc0 snapshot 2012-08-14 20:06:04 +08:00
Daniel Veillard f463598b24 Prerelease for libvirt-0.10.0
Snapshot before 0.10.0 expected beginning of september
2012-08-08 22:45:35 +08:00
Richard W.M. Jones f4e752a385 Add upstream patch to fix RHBZ#842114. 2012-07-23 14:09:48 +01:00
Dennis Gilmore c37cb21dea - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild 2012-07-19 16:33:02 -05:00
Cole Robinson e0bfc1f8aa BuildRequires: openssl-devel for rbd 2012-07-15 13:26:31 -04:00
Daniel Veillard 544ad4a787 Release of libvirt-0.9.13
- S390: support for s390(x)
- snapshot: implement new APIs for esx and vbox
- snapshot: new query APIs and many improvements
- virsh: Allow users to reedit rejected XML
- nwfilter: add DHCP snooping
- Enable driver modules in libvirt RPM
- Default to enable driver modules for libvirtd
- storage backend: Add RBD (RADOS Block Device) support
- sVirt support for LXC domains inprovement
- a lot of bug fixes, improvements and portability work
2012-07-02 13:15:52 +08:00
Daniel Veillard 8f163760ed Update to 0.9.12 2012-05-14 22:23:10 +08:00
Cole Robinson 565427cf89 Remove all accidentally added patches 2012-04-27 17:01:40 -04:00
Cole Robinson e10da2f6d4 Rebased to version 0.9.11.3
Abide URI username when connecting to hypervisor (bz 811397)
Fix managed USB mode (bz 814866)
Fix crash connecting to ESX host (bz 811891)
2012-04-27 16:56:05 -04:00
Cole Robinson aa386576d5 Fix python doc filelist 2012-04-26 20:39:12 -04:00
Cole Robinson c73c129b48 Rebased to version 0.9.11.2
Abide URI username when connecting to hypervisor (bz 811397)
Fix managed USB mode (bz 814866)
Fix crash connecting to ESX host (bz 811891)
2012-04-26 20:14:34 -04:00
Daniel P. Berrange afe729ac3c Fix initial hypervisor conditionals 2012-04-04 11:42:12 +01:00
Daniel P. Berrange b6038bae4f Remove bogus xen-devel dep from libvirt-devel RPM 2012-04-04 11:42:00 +01:00
Daniel P. Berrange e6d9787587 Introduce per-hypervisor virtual RPMs 2012-04-04 11:41:48 +01:00
Daniel P. Berrange 44699dc495 Split config files & daemon off from main daemon RPM 2012-04-04 11:41:26 +01:00
Daniel P. Berrange 991d719dde Remove API XML files from libvirt RPM 2012-04-04 11:41:06 +01:00
Daniel P. Berrange 96a520b555 Move all documentation into a -docs sub-RPM 2012-04-04 11:40:53 +01:00
Daniel P. Berrange e31df5e9de Update to 0.9.11 release 2012-04-04 11:40:32 +01:00
Daniel P. Berrange 6763b267b9 Fix client only RPM build & other misc RPM problems 2012-04-04 11:39:42 +01:00
Daniel P. Berrange 24e91208a4 spec: Add missed dependancy for numad 2012-04-04 11:38:11 +01:00
Daniel P. Berrange 15dec999e7 Add qemu support for ppc64 on FC16 or above for rpm packaging 2012-04-04 11:37:55 +01:00
Daniel P. Berrange d6b0635d3d Fixed service handling in specfile 2012-04-04 11:37:36 +01:00
Daniel P. Berrange 336a93264e storage: Allow runtime detection of scrub 2012-04-04 11:36:56 +01:00
Daniel P. Berrange 6398d1cff5 Fix typos in API XML file paths 2012-04-04 11:36:26 +01:00
Daniel P. Berrange 6926ed26ea Install API XML desc to a standard location 2012-04-04 11:36:11 +01:00
Daniel P. Berrange 6253f97a2d Revert previous change 2012-04-03 11:02:04 +01:00
Daniel P. Berrange 37ddbd0eac Refactor RPM spec to allow install without default configs 2012-03-31 12:38:10 +01:00
Daniel P. Berrange 95fe7c8df2 Rebuild for libparted soname break 2012-03-15 15:10:56 +00:00
Peter Robinson 79ae809020 fix ix86 macros 2012-02-17 15:27:03 +00:00
Daniel P. Berrange f19e302ba9 Update to 0.9.10 2012-02-13 16:10:28 +00:00
Daniel P. Berrange e9c1d3f4b0 Update to 0.9.10-rc2 release 2012-02-08 11:34:10 +00:00
Daniel P. Berrange 0f577d932b Fix LXC I/O handling 2012-01-12 21:07:02 +00:00
Daniel P. Berrange 21a02c2e90 Fix LXC I/O handling 2012-01-12 21:04:43 +00:00
Daniel Veillard 4e460d5f09 Upstream release of 0.9.9 2012-01-07 21:53:09 +08:00
Peter Robinson f9de2f6bc6 update util-linux-ng -> util-linux 2011-12-29 16:21:18 +00:00
Daniel P. Berrange 2daa1b7814 Add BR on gettext-devel when autotools is enabled 2011-12-08 14:39:53 +00:00
Daniel P. Berrange f99eeb8567 Fix install of libvirt-guests.service and libvirtd.service 2011-12-08 13:50:55 +00:00
Daniel Veillard 7069f75cb8 update to libvirt-0.9.8
cleanup of old patches, of spec too
2011-12-08 17:03:16 +08:00
Justin M. Forbes 2cac7dac46 Remove versioning on yajl buildreq 2011-11-14 17:54:13 -06:00
Daniel P. Berrange 913c3c6554 Rebuild for yajl 2.0.1 release 2011-11-10 16:24:26 +00:00
Daniel P. Berrange a5a4c0c89b Another attempt to disable shunloadtest 2011-11-08 20:18:01 +00:00
Daniel P. Berrange 8c8aca2fab Update to 0.9.7 release 2011-11-08 19:52:05 +00:00
Dan Horák daf8e124ca xenlight available only on Xen arches (#745020) 2011-10-11 10:29:54 +02:00
Laine Stump 38c4b724fe release 0.9.6-2
* Make PCI multifunction support more manual - Bug 742836
* Builds on F15 should still use cgconfig - Bug 738725
2011-10-03 00:27:06 -04:00
Daniel Veillard 4d00487275 Upstream release of 0.9.6
Fix the qemu reboot bug from 0.9.5 and a few others bug fixes
2011-09-22 16:33:16 +08:00
Daniel Veillard a6831c26c1 Upstream release of libvirt-0.9.5 2011-09-20 14:51:18 +08:00
Daniel Veillard c363c7ebdb Upstream release of 0.9.4 2011-08-03 13:19:23 +08:00
Dan Horak 18ee6daf8a xenlight available only on Xen arches 2011-07-30 13:16:44 -04:00
Peter Robinson 459eb426c3 add ARM to NUMA platform exlcludes 2011-07-06 15:19:11 +01:00
Daniel Veillard a0d670d2bf Temporary disable sanlock as version is too old 2011-07-04 23:05:01 +08:00
Daniel Veillard d7b41212c1 Updating for 0.9.3 upstream release, Daniel 2011-07-04 21:22:51 +08:00
Richard W.M. Jones 2e1539eba4 Rebuild because of libparted soname bump (libparted.so.0 -> libparted.so.1). 2011-06-29 22:07:28 +01:00
Laine Stump ee9521d87c update to 0.9.2
- require netcf-0.1.8 so transactional network config APIs are included
- document that CVE-2011-2178 has been resolved
2011-06-21 20:25:22 -04:00
Daniel Veillard 8d8fc08bac Deactivate sanlock for now until Dan Berrange updates it 2011-06-06 17:06:09 +08:00
Daniel Veillard e79d304c79 Release of libvirt-0.9.2 upstream 2011-06-06 13:19:32 +08:00
Richard W.M. Jones db03f03fd9 Add patch so users can try out virt-dmesg. 2011-05-25 22:29:05 +01:00
Daniel Veillard 957403ebec Update to upstream release 0.9.1
- support various persistent domain updates
- improvements on memory APIs
- Add virDomainEventRebootNew
- various improvements to libxl driver
- Spice: support audio, images and stream compression
- Various improvements and bug fixes
2011-05-05 13:23:46 +08:00
Daniel Veillard 6c32e1aaeb Fix libvirt-0.9.0 build for rawhide, Daniel 2011-04-08 15:16:29 +08:00
Daniel Veillard 362e335c0b Try to force the buidl with libxenlight 2011-04-07 17:13:40 +08:00
Daniel Veillard ed6c49f874 Update to release 0.9.0 2011-04-07 15:47:13 +08:00
Daniel Veillard 47fcec5405 Fix for CVE-2011-1146, missing checks on read-only connections 2011-03-14 21:48:48 +08:00
Daniel P. Berrange d7239a45b6 Add patch to fix -kernel boot with latest QEMU 2011-02-21 14:34:17 +00:00
Daniel Veillard f13fb18c58 Release of libvirt-0.8.8 upstream
- expose new API for sysinfo extraction
- cgroup blkio weight support
- smartcard device support
- qemu: Support per-device boot ordering
- Various improvements and bug fixes
Daniel
2011-02-17 12:29:20 +08:00
Dennis Gilmore d29644418d - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild 2011-02-08 06:38:06 -06:00
Daniel Veillard ed9e426b26 Update to libvirt 0.8.7
- Preliminary support for VirtualBox 4.0
- IPv6 support
- Add VMware Workstation and Player driver driver
- Add network disk support
- Various improvements and bug fixes
- from 0.8.6:
- Add support for iSCSI target auto-discovery
- QED: Basic support for QED images
- remote console support
- support for SPICE graphics
- sysinfo and VMBIOS support
- virsh qemu-monitor-command
2011-01-06 10:45:38 +08:00
Daniel Veillard 659febf9ff Temporary disable xen support on fedora build
temporary workaround since 0.8.5 fails with xen on F15 missing
MAX_VIRT_CPUS, to fix once sorted out upstream
2010-10-29 18:11:45 +02:00
Daniel Veillard fca1fccfad Upstream release of 0.8.5
- Enable JSON and netdev features in QEMU >= 0.13
- framework for auditing integration
- framework DTrace/SystemTap integration
- Setting the number of vcpu at boot
- Enable support for nested SVM
- Virtio plan9fs filesystem QEMU
- Memory parameter controls
- various improvements and bug fixes
Daniel
2010-10-29 17:57:15 +02:00
Jesse Keating f713d63bab - Rebuilt for gcc bug 634757 2010-09-29 14:43:44 -07:00
Dan Horák 5a45e466cf - disable the nwfilterxml2xmltest also on s390(x) 2010-09-16 22:29:05 +02:00
Daniel Veillard 742b24eb23 Upstream release libvirt-0.8.4 2010-09-13 15:26:25 +02:00
Daniel P. Berrange 03369d2383 Fix potential overflow in boot menu code 2010-08-23 21:14:34 +01:00
Daniel P. Berrange 2605d662e0 Update to 0.8.3 sources 2010-08-23 19:50:11 +01:00
Daniel P. Berrange e8394ab5b5 Update 0.8.3 release 2010-08-23 19:45:47 +01:00
Fedora Release Engineering 8ad156a5c2 dist-git conversion 2010-07-29 07:20:27 +00:00
dmalcolm f2d6fb6239 - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild 2010-07-22 02:22:13 +00:00
Daniel P. Berrange e3a592c38d Fix CVE-2010-2237, CVE-2010-2238, CVE-2010-2239, CVE-2010-2242 2010-07-12 16:01:43 +00:00
Daniel Veillard 7e99819dda Release of libvirt-0.8.2, update of spec file, Daniel 2010-07-05 15:51:43 +00:00
Daniel Veillard a160d7f98d Upstream release of libvirt-0.8.1, Daniel 2010-04-30 17:10:08 +00:00
Daniel Veillard 36cab842e8 - Upstream release 0.8.0
- Snapshotting support (QEmu/VBox/ESX)
- Network filtering API
- XenAPI driver
- new APIs for domain events
- Libvirt managed save API
- timer subselection for domain clock
- synchronous hooks
- API to update guest CPU to host CPU
- virDomainUpdateDeviceFlags new API
- migrate max downtime API
- volume wiping API
- and many bug fixes
Daniel
2010-04-12 18:05:13 +00:00
Richard W.M. Jones 7b7b86e327 No change, just rebuild against new libparted with bumped soname. 2010-03-30 21:08:36 +00:00
Cole Robinson f4bfe638b6 Fix USB devices by product with security enabled (bz 574136)
Set kernel/initrd in security driver, fixes some URL installs (bz 566425)
2010-03-22 15:19:02 +00:00
Daniel Veillard 0e9d242f05 Upstream release 0.7.7
Daniel
2010-03-05 16:33:57 +00:00
Adam Jackson e24467a8c2 * Tue Feb 16 2010 Adam Jackson <ajax@redhat.com> 0.7.6-2
- libvirt-0.7.6-add-needed.patch: Fix FTBFS from --no-add-needed
- Add BuildRequires: xmlrpc-c-client for libxmlrpc_client.so
2010-02-17 00:11:39 +00:00
Adam Jackson b39c370a76 add the patch 2010-02-16 23:59:23 +00:00
Adam Jackson 62e4e7cde2 * Tue Feb 16 2010 Adam Jackson <ajax@redhat.com> 0.7.6-2
- libvirt-0.7.6-add-needed.patch: Fix FTBFS from --no-add-needed
2010-02-16 23:49:24 +00:00
Daniel Veillard f822179f97 Oops forgot to bump version, Daniel 2010-02-03 17:40:46 +00:00
Daniel Veillard 47e7e1e548 upstream release of 0.7.6
daniel
2010-02-03 17:39:33 +00:00
Chris Weyl e73b75314b * Thu Jan 14 2010 Chris Weyl <cweyl@alumni.drew.edu> 0.7.5-3
- bump for libssh2 rebuild
2010-01-14 16:59:58 +00:00
Daniel P. Berrange 8193a55b4a Rebuild for libparted soname change 2010-01-12 14:10:20 +00:00
Daniel Veillard 6036708fa2 Fix a problem in spec file, Daniel 2009-12-23 15:56:25 +00:00
Daniel Veillard 4717aa0b6d Upstream release of 0.7.5, Daniel 2009-12-23 15:40:21 +00:00
Bill Nottingham 97ae25ea7d Fix typo that causes a failure to update the common directory. (releng #2781) 2009-11-25 23:51:22 +00:00
Daniel Veillard 6470ed033b Upstream release of 0.7.3, Daniel 2009-11-20 18:59:17 +00:00
Daniel Veillard b550f9c1d5 Fix netcf BuildRequire, Daniel 2009-11-20 18:02:51 +00:00
Daniel Veillard ee0273ffc3 Upstream release of libvirt-0.7.3, Daniel 2009-11-20 16:55:47 +00:00
Daniel P. Berrange 50fce74b00 Really fix restore file labelling this time 2009-11-19 12:51:32 +00:00
Daniel P. Berrange e29f71d1c9 Disable numactl on s390[x] 2009-11-11 18:11:49 +00:00
Daniel P. Berrange 427ed20801 Fix QEMU save/restore permissions / labelling 2009-11-11 15:33:52 +00:00
Mark McLoughlin d23e6c285b * Thu Oct 29 2009 Mark McLoughlin <markmc@redhat.com> - 0.7.2-3
- Avoid compressing small log files (#531030)
2009-10-29 17:26:05 +00:00
Mark McLoughlin 2c139b45d8 * Thu Oct 29 2009 Mark McLoughlin <markmc@redhat.com> - 0.7.2-2
- Fix qemu machine types handling
2009-10-29 10:57:55 +00:00
Mark McLoughlin 762435e3b7 * Thu Oct 29 2009 Mark McLoughlin <markmc@redhat.com> - 0.7.2-2
- Make libvirt-devel require libvirt-client, not libvirt
2009-10-29 10:15:23 +00:00
Daniel Veillard 6383d6b056 0.7.2 release, Daniel 2009-10-14 13:03:30 +00:00
Mark McLoughlin 3712441ea6 Add the second patch for #523158 2009-10-13 15:43:47 +00:00
Mark McLoughlin 9d0bc882fa * Tue Oct 13 2009 Mark McLoughlin <markmc@redhat.com> - 0.7.1-12
- Fix restore of qemu guest using raw save format (#523158)
2009-10-13 15:34:15 +00:00
Mark McLoughlin 90dddf3d3d * Fri Oct 9 2009 Mark McLoughlin <markmc@redhat.com> - 0.7.1-11
- Fix libvirtd memory leak during error reply sending (#528162)
- Add several PCI hot-unplug typo fixes from upstream
2009-10-09 14:53:48 +00:00
Mark McLoughlin 86abd54d02 * Tue Oct 6 2009 Mark McLoughlin <markmc@redhat.com> - 0.7.1-10
- Create /var/log/libvirt/{lxc,uml} dirs for logrotate
- Make libvirt-python dependon on libvirt-client
- Sync misc minor changes from upstream spec
2009-10-06 12:48:58 +00:00
Mark McLoughlin 4ab5ad5425 * Tue Oct 6 2009 Mark McLoughlin <markmc@redhat.com> - 0.7.1-9
- Change logrotate config to weekly (#526769)
2009-10-06 09:45:04 +00:00
Mark McLoughlin f9c1b758c3 - Re-label qcow2 backing files (#497131) 2009-10-01 15:17:31 +00:00
Mark McLoughlin 38cf1bd5ba * Thu Oct 1 2009 Mark McLoughlin <markmc@redhat.com> - 0.7.1-8
- Disable sound backend, even when selinux is disabled (#524499)
2009-10-01 08:35:16 +00:00
Mark McLoughlin aeda455930 * Wed Sep 30 2009 Mark McLoughlin <markmc@redhat.com> - 0.7.1-7
- Fix USB device passthrough (#522683)
2009-09-30 17:58:52 +00:00
Chris Weyl 288291b795 * Mon Sep 21 2009 Chris Weyl <cweyl@alumni.drew.edu> - 0.7.1-6
- rebuild for libssh2 1.2
2009-09-22 03:52:07 +00:00
Mark McLoughlin 7c2073faca * Mon Sep 21 2009 Mark McLoughlin <markmc@redhat.com> - 0.7.1-5
- Don't set a bogus error in virDrvSupportsFeature()
- Fix raw save format
2009-09-21 15:32:34 +00:00
Mark McLoughlin 5b528ba717 Fix typo 2009-09-17 14:58:55 +00:00
11 changed files with 2491 additions and 357 deletions
-13
View File
@@ -1,13 +0,0 @@
.build*.log
*.rpm
i686
x86_64
libvirt-*.tar.gz
libvirt-0.6.0.tar.gz
libvirt-0.6.1.tar.gz
libvirt-0.6.2.tar.gz
libvirt-0.6.3.tar.gz
libvirt-0.6.4.tar.gz
libvirt-0.6.5.tar.gz
libvirt-0.7.0.tar.gz
libvirt-0.7.1.tar.gz
+5
View File
@@ -0,0 +1,5 @@
.build*.log
*.rpm
i686
x86_64
libvirt-*.tar.gz
@@ -0,0 +1,27 @@
From 37865f1dead1fac2ee34af48f96d19d686296e04 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 13 Sep 2012 14:37:22 +0100
Subject: [PATCH] Use 'qemu-system-i386' as binary instead of 'qemu'.
---
src/qemu/qemu_capabilities.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index af3b0b2..179b3d2 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -244,8 +244,8 @@ static const struct qemu_feature_flags const arch_info_x86_64_flags [] = {
/* The archicture tables for supported QEMU archs */
static const struct qemu_arch_info const arch_info_hvm[] = {
- { "i686", 32, NULL, "qemu",
- "qemu-system-x86_64", arch_info_i686_flags, 4 },
+ { "i686", 32, NULL, "qemu-system-i386",
+ NULL, arch_info_i686_flags, 4 },
{ "x86_64", 64, NULL, "qemu-system-x86_64",
NULL, arch_info_x86_64_flags, 2 },
{ "arm", 32, NULL, "qemu-system-arm", NULL, NULL, 0 },
--
1.7.11.4
+1 -1
View File
@@ -4,7 +4,7 @@ NAME := libvirt
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
-51
View File
@@ -1,51 +0,0 @@
From 127a39777e9809053bb98a9082e27c73543ccfa2 Mon Sep 17 00:00:00 2001
From: Daniel P. Berrange <berrange@redhat.com>
Date: Mon, 17 Aug 2009 08:32:08 +0100
Subject: [PATCH] Disable sound cards when running sVirt
Temporary hack till PulseAudio autostart problems are sorted out when
SELinux enforcing (bz 486112)
Fedora-patch: libvirt-0.6.4-svirt-sound.patch
---
src/qemu_conf.c | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/src/qemu_conf.c b/src/qemu_conf.c
index f92bcef..f3b4ef0 100644
--- a/src/qemu_conf.c
+++ b/src/qemu_conf.c
@@ -1510,6 +1510,20 @@ int qemudBuildCommandLine(virConnectPtr conn,
char uuid[VIR_UUID_STRING_BUFLEN];
char domid[50];
const char *cpu = NULL;
+ int skipSound = 0;
+
+ if (driver->securityDriver &&
+ driver->securityDriver->name &&
+ STREQ(driver->securityDriver->name, "selinux") &&
+ getuid() == 0) {
+ static int soundWarned = 0;
+ skipSound = 1;
+ if (def->nsounds &&
+ !soundWarned) {
+ soundWarned = 1;
+ VIR_WARN0("Sound cards for VMs are disabled while SELinux security model is active");
+ }
+ }
uname_normalize(&ut);
@@ -2181,7 +2195,8 @@ int qemudBuildCommandLine(virConnectPtr conn,
}
/* Add sound hardware */
- if (def->nsounds) {
+ if (def->nsounds &&
+ !skipSound) {
int size = 100;
char *modstr;
if (VIR_ALLOC_N(modstr, size+1) < 0)
--
1.6.2.5
+225
View File
@@ -0,0 +1,225 @@
Return-Path: alexl@redhat.com
Received: from zmta04.collab.prod.int.phx2.redhat.com (LHLO
zmta04.collab.prod.int.phx2.redhat.com) (10.5.81.11) by
zmail20.collab.prod.int.phx2.redhat.com with LMTP; Tue, 9 Oct 2012 11:26:38
-0400 (EDT)
Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23])
by zmta04.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id D4096D0927
for <alexl@mail.corp.redhat.com>; Tue, 9 Oct 2012 11:26:38 -0400 (EDT)
Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1])
by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q99FQV93016417;
Tue, 9 Oct 2012 11:26:33 -0400
From: Alexander Larsson <alexl@redhat.com>
To: libvir-list@redhat.com
Cc: Alexander Larsson <alexl@redhat.com>
Subject: [PATCH 1/2] virdbus: Add virDBusGetSessionBus helper
Date: Tue, 9 Oct 2012 17:26:28 +0200
Message-Id: <1349796389-6122-2-git-send-email-alexl@redhat.com>
In-Reply-To: <1349796389-6122-1-git-send-email-alexl@redhat.com>
References: <1349796389-6122-1-git-send-email-alexl@redhat.com>
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23
This splits out some common code from virDBusGetSystemBus and
uses it to implement a new virDBusGetSessionBus helper.
---
src/libvirt_private.syms | 1 +
src/util/virdbus.c | 84 ++++++++++++++++++++++++++++++++++++------------
src/util/virdbus.h | 1 +
3 files changed, 66 insertions(+), 20 deletions(-)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index a8c81e7..88f1b2f 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1310,6 +1310,7 @@ virConsoleOpen;
# virdbus.h
virDBusGetSystemBus;
+virDBusGetSessionBus;
# virdomainlist.h
diff --git a/src/util/virdbus.c b/src/util/virdbus.c
index 4acce12..2dc7265 100644
--- a/src/util/virdbus.c
+++ b/src/util/virdbus.c
@@ -32,40 +32,49 @@
#ifdef HAVE_DBUS
static DBusConnection *systembus = NULL;
-static virOnceControl once = VIR_ONCE_CONTROL_INITIALIZER;
-static DBusError dbuserr;
+static DBusConnection *sessionbus = NULL;
+static virOnceControl systemonce = VIR_ONCE_CONTROL_INITIALIZER;
+static virOnceControl sessiononce = VIR_ONCE_CONTROL_INITIALIZER;
+static DBusError systemdbuserr;
+static DBusError sessiondbuserr;
static dbus_bool_t virDBusAddWatch(DBusWatch *watch, void *data);
static void virDBusRemoveWatch(DBusWatch *watch, void *data);
static void virDBusToggleWatch(DBusWatch *watch, void *data);
-static void virDBusSystemBusInit(void)
+static DBusConnection *virDBusBusInit(DBusBusType type, DBusError *dbuserr)
{
+ DBusConnection *bus;
+
/* Allocate and initialize a new HAL context */
dbus_connection_set_change_sigpipe(FALSE);
dbus_threads_init_default();
- dbus_error_init(&dbuserr);
- if (!(systembus = dbus_bus_get(DBUS_BUS_SYSTEM, &dbuserr)))
- return;
+ dbus_error_init(dbuserr);
+ if (!(bus = dbus_bus_get(type, dbuserr)))
+ return NULL;
- dbus_connection_set_exit_on_disconnect(systembus, FALSE);
+ dbus_connection_set_exit_on_disconnect(bus, FALSE);
/* Register dbus watch callbacks */
- if (!dbus_connection_set_watch_functions(systembus,
+ if (!dbus_connection_set_watch_functions(bus,
virDBusAddWatch,
virDBusRemoveWatch,
virDBusToggleWatch,
- NULL, NULL)) {
- systembus = NULL;
- return;
+ bus, NULL)) {
+ return NULL;
}
+ return bus;
}
+static void virDBusSystemBusInit(void)
+{
+ systembus = virDBusBusInit (DBUS_BUS_SYSTEM, &systemdbuserr);
+}
DBusConnection *virDBusGetSystemBus(void)
{
- if (virOnce(&once, virDBusSystemBusInit) < 0) {
+ if (virOnce(&systemonce, virDBusSystemBusInit) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Unable to run one time DBus initializer"));
return NULL;
@@ -74,7 +83,7 @@ DBusConnection *virDBusGetSystemBus(void)
if (!systembus) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to get DBus system bus connection: %s"),
- dbuserr.message ? dbuserr.message : "watch setup failed");
+ systemdbuserr.message ? systemdbuserr.message : "watch setup failed");
return NULL;
}
@@ -82,13 +91,45 @@ DBusConnection *virDBusGetSystemBus(void)
}
+static void virDBusSessionBusInit(void)
+{
+ sessionbus = virDBusBusInit (DBUS_BUS_SESSION, &sessiondbuserr);
+}
+
+DBusConnection *virDBusGetSessionBus(void)
+{
+ if (virOnce(&sessiononce, virDBusSessionBusInit) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to run one time DBus initializer"));
+ return NULL;
+ }
+
+ if (!sessionbus) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to get DBus session bus connection: %s"),
+ sessiondbuserr.message ? sessiondbuserr.message : "watch setup failed");
+ return NULL;
+ }
+
+ return sessionbus;
+}
+
+struct virDBusWatch
+{
+ int watch;
+ DBusConnection *bus;
+};
+
static void virDBusWatchCallback(int fdatch ATTRIBUTE_UNUSED,
int fd ATTRIBUTE_UNUSED,
int events, void *opaque)
{
DBusWatch *watch = opaque;
+ struct virDBusWatch *info;
int dbus_flags = 0;
+ info = dbus_watch_get_data(watch);
+
if (events & VIR_EVENT_HANDLE_READABLE)
dbus_flags |= DBUS_WATCH_READABLE;
if (events & VIR_EVENT_HANDLE_WRITABLE)
@@ -100,7 +141,7 @@ static void virDBusWatchCallback(int fdatch ATTRIBUTE_UNUSED,
(void)dbus_watch_handle(watch, dbus_flags);
- while (dbus_connection_dispatch(systembus) == DBUS_DISPATCH_DATA_REMAINS)
+ while (dbus_connection_dispatch(info->bus) == DBUS_DISPATCH_DATA_REMAINS)
/* keep dispatching while data remains */;
}
@@ -120,18 +161,13 @@ static int virDBusTranslateWatchFlags(int dbus_flags)
}
-struct virDBusWatch
-{
- int watch;
-};
-
static void virDBusWatchFree(void *data) {
struct virDBusWatch *info = data;
VIR_FREE(info);
}
static dbus_bool_t virDBusAddWatch(DBusWatch *watch,
- void *data ATTRIBUTE_UNUSED)
+ void *data)
{
int flags = 0;
int fd;
@@ -148,6 +184,7 @@ static dbus_bool_t virDBusAddWatch(DBusWatch *watch,
# else
fd = dbus_watch_get_fd(watch);
# endif
+ info->bus = (DBusConnection *)data;
info->watch = virEventAddHandle(fd, flags,
virDBusWatchCallback,
watch, NULL);
@@ -194,4 +231,11 @@ DBusConnection *virDBusGetSystemBus(void)
return NULL;
}
+DBusConnection *virDBusGetSessionBus(void)
+{
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("DBus support not compiled into this binary"));
+ return NULL;
+}
+
#endif /* ! HAVE_DBUS */
diff --git a/src/util/virdbus.h b/src/util/virdbus.h
index 27dca00..e443fbe 100644
--- a/src/util/virdbus.h
+++ b/src/util/virdbus.h
@@ -30,5 +30,6 @@
# include "internal.h"
DBusConnection *virDBusGetSystemBus(void);
+DBusConnection *virDBusGetSessionBus(void);
#endif /* __VIR_DBUS_H__ */
--
1.7.12.1
@@ -1,44 +0,0 @@
From 18067a3cde7183fd17eea199fac2e49edfe1cb22 Mon Sep 17 00:00:00 2001
From: Mark McLoughlin <markmc@redhat.com>
Date: Thu, 17 Sep 2009 15:31:08 +0100
Subject: [PATCH] Fix net/disk hot-unplug segfault
When we hot-unplug the last device, we're currently double-freeing
the device definition.
Reported by Michal Nowak here:
https://bugzilla.redhat.com/523953
* src/qemu_driver.c: fix double free
Fedora-patch: libvirt-fix-net-hotunplug-double-free.patch
---
src/qemu_driver.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index a65334f..de31581 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -5998,7 +5998,7 @@ try_command:
/* ignore, harmless */
}
} else {
- VIR_FREE(vm->def->disks[0]);
+ VIR_FREE(vm->def->disks);
vm->def->ndisks = 0;
}
virDomainDiskDefFree(detach);
@@ -6100,7 +6100,7 @@ qemudDomainDetachNetDevice(virConnectPtr conn,
/* ignore, harmless */
}
} else {
- VIR_FREE(vm->def->nets[0]);
+ VIR_FREE(vm->def->nets);
vm->def->nnets = 0;
}
virDomainNetDefFree(detach);
--
1.6.2.5
@@ -1,48 +0,0 @@
From 9ef0cb152e92db1aa87d89529812328935c8535a Mon Sep 17 00:00:00 2001
From: Mark McLoughlin <markmc@redhat.com>
Date: Thu, 17 Sep 2009 15:32:45 +0100
Subject: [PATCH] Fix leak in PCI hostdev hot-unplug
* src/qemu_driver.c: sync the hostdev hot-unplug code with the disk/net
code.
Fedora-patch: libvirt-fix-pci-hostdev-hotunplug-leak.patch
---
src/qemu_driver.c | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index de31581..2ddcdc0 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -6206,14 +6206,20 @@ static int qemudDomainDetachHostPciDevice(virConnectPtr conn,
pciFreeDevice(conn, pci);
}
- if (i != --vm->def->nhostdevs)
- memmove(&vm->def->hostdevs[i],
- &vm->def->hostdevs[i+1],
- sizeof(*vm->def->hostdevs) * (vm->def->nhostdevs-i));
- if (VIR_REALLOC_N(vm->def->hostdevs, vm->def->nhostdevs) < 0) {
- virReportOOMError(conn);
- ret = -1;
+ if (vm->def->nhostdevs > 1) {
+ memmove(vm->def->hostdevs + i,
+ vm->def->hostdevs + i + 1,
+ sizeof(*vm->def->hostdevs) *
+ (vm->def->nhostdevs - (i + 1)));
+ vm->def->nhostdevs--;
+ if (VIR_REALLOC_N(vm->def->hostdevs, vm->def->nhostdevs) < 0) {
+ /* ignore, harmless */
+ }
+ } else {
+ VIR_FREE(vm->def->hostdevs);
+ vm->def->nhostdevs = 0;
}
+ virDomainHostdevDefFree(detach);
return ret;
}
--
1.6.2.5
+303
View File
@@ -0,0 +1,303 @@
Return-Path: alexl@redhat.com
Received: from zmta06.collab.prod.int.phx2.redhat.com (LHLO
zmta06.collab.prod.int.phx2.redhat.com) (10.5.81.13) by
zmail20.collab.prod.int.phx2.redhat.com with LMTP; Tue, 9 Oct 2012 11:26:39
-0400 (EDT)
Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23])
by zmta06.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id D4A8516044F
for <alexl@mail.corp.redhat.com>; Tue, 9 Oct 2012 11:26:39 -0400 (EDT)
Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1])
by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q99FQV94016417;
Tue, 9 Oct 2012 11:26:34 -0400
From: Alexander Larsson <alexl@redhat.com>
To: libvir-list@redhat.com
Cc: Alexander Larsson <alexl@redhat.com>
Subject: [PATCH 2/2] Shut down session libvirtd cleanly
Date: Tue, 9 Oct 2012 17:26:29 +0200
Message-Id: <1349796389-6122-3-git-send-email-alexl@redhat.com>
In-Reply-To: <1349796389-6122-1-git-send-email-alexl@redhat.com>
References: <1349796389-6122-1-git-send-email-alexl@redhat.com>
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23
When the session dies or when the system is going to be shut down
we save all active VMs and exit libvirtd.
Additionally whenever there is an active domain we hold a
shutdown inhibitor to avoid shutting down before all the
VMs are saved.
---
daemon/libvirtd.c | 244 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 244 insertions(+)
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index b49acc5..c3bf2ce 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -98,6 +98,11 @@
#include "configmake.h"
+#ifdef HAVE_DBUS
+# include <dbus/dbus.h>
+# include "virdbus.h"
+#endif
+
#if HAVE_SASL
virNetSASLContextPtr saslCtxt = NULL;
#endif
@@ -769,6 +774,212 @@ static int daemonSetupSignals(virNetServerPtr srv)
return 0;
}
+#ifdef HAVE_DBUS
+
+static DBusConnection *sessionBus;
+static DBusConnection *systemBus;
+static virConnectPtr sessionConnection;
+static int numActiveDomains;
+static bool hasInhibit;
+static bool callingInhibit;
+static int inhibitFd = -1;
+
+static void runSaveAllDomains(void *opaque)
+{
+ virNetServerPtr srv = opaque;
+ int numDomains, i;
+ int state;
+ virDomainPtr *domains = NULL;
+ unsigned int *flags = NULL;
+
+ numDomains = virConnectListAllDomains(sessionConnection, &domains, VIR_CONNECT_LIST_DOMAINS_ACTIVE);
+ if (numDomains < 0)
+ goto cleanup;
+
+ if (VIR_ALLOC_N(flags, numDomains) < 0) {
+ virReportOOMError();
+ goto cleanup;
+ }
+
+ /* First we pause all VMs to make them stop dirtying
+ pages, etc. We remember if any VMs were paused so
+ we can restore that on resume. */
+ for (i = 0 ; i < numDomains ; i++) {
+ flags[i] = VIR_DOMAIN_SAVE_RUNNING;
+ if (virDomainGetState (domains[i], &state, NULL, 0) == 0) {
+ if (state == VIR_DOMAIN_PAUSED) {
+ flags[i] = VIR_DOMAIN_SAVE_PAUSED;
+ }
+ }
+ virDomainSuspend (domains[i]);
+ }
+
+ /* Then we save the VMs to disk */
+ for (i = 0 ; i < numDomains ; i++)
+ virDomainManagedSave (domains[i], flags[i]);
+
+ VIR_FREE (domains);
+ VIR_FREE (flags);
+
+ cleanup:
+ if (domains != NULL) {
+ for (i = 0 ; i < numDomains ; i++)
+ virDomainFree (domains[i]);
+ VIR_FREE (domains);
+ }
+ if (flags != NULL)
+ VIR_FREE (flags);
+
+ /* We don't need any shutdown inhibit lock anymore now */
+ if (inhibitFd != -1) {
+ if (VIR_CLOSE (inhibitFd) < 0)
+ virReportSystemError(errno, "%s", _("failed to close file"));
+ inhibitFd = -1;
+ }
+
+ /* Exit libvirtd cleanly */
+ virNetServerQuit (srv);
+}
+
+/* We do this in a thread to not block the main loop */
+static void saveAllDomains(virNetServerPtr srv)
+{
+ virThread thr;
+ virObjectRef(srv);
+ if (virThreadCreate(&thr, false, runSaveAllDomains, srv) < 0) {
+ virObjectUnref(srv);
+ }
+}
+
+static void gotInhibitReply (DBusPendingCall *pending,
+ void *opaque ATTRIBUTE_UNUSED)
+{
+ DBusMessage *reply;
+ int fd;
+
+ callingInhibit = false;
+
+ reply = dbus_pending_call_steal_reply (pending);
+ if (reply == NULL)
+ return;
+
+ if (dbus_message_get_args (reply, NULL,
+ DBUS_TYPE_UNIX_FD, &fd,
+ DBUS_TYPE_INVALID)) {
+ if (hasInhibit)
+ inhibitFd = fd;
+ else {
+ /* We stopped the last VM since we made the inhibit call */
+ if (VIR_CLOSE (fd) < 0) {
+ virReportSystemError(errno, "%s", _("failed to close file"));
+ }
+ }
+ }
+ dbus_message_unref (reply);
+}
+
+/* As per: http://www.freedesktop.org/wiki/Software/systemd/inhibit */
+static void callInhibit(const char *what,
+ const char *who,
+ const char *why,
+ const char *mode)
+{
+ DBusMessage *message;
+ DBusPendingCall *pendingReply;
+
+ if (systemBus == NULL)
+ return;
+
+ /* Only one outstanding call at a time */
+ if (callingInhibit)
+ return;
+
+ message = dbus_message_new_method_call ("org.freedesktop.login1",
+ "/org/freedesktop/login1",
+ "org.freedesktop.login1.Manager",
+ "Inhibit");
+ if (message == NULL)
+ return;
+
+ dbus_message_append_args (message,
+ DBUS_TYPE_STRING, &what,
+ DBUS_TYPE_STRING, &who,
+ DBUS_TYPE_STRING, &why,
+ DBUS_TYPE_STRING, &mode,
+ DBUS_TYPE_INVALID);
+
+ pendingReply = NULL;
+ if (dbus_connection_send_with_reply (systemBus, message,
+ &pendingReply,
+ 25*1000)) {
+ dbus_pending_call_set_notify (pendingReply,
+ gotInhibitReply,
+ NULL, NULL);
+ callingInhibit = true;
+ }
+ dbus_message_unref (message);
+}
+
+
+static void numActiveDomainsChanged(void)
+{
+ if (numActiveDomains > 0 && !hasInhibit) {
+ callInhibit("shutdown", _("Libvirt"), _("Virtual machines need to be saved"), "delay");
+ hasInhibit = true;
+ } else if (numActiveDomains == 0 && hasInhibit) {
+ if (inhibitFd != -1) {
+ if (VIR_CLOSE (inhibitFd) < 0) {
+ virReportSystemError(errno, "%s", _("failed to close file"));
+ }
+ inhibitFd = -1;
+ }
+ hasInhibit = false;
+ }
+}
+
+static int lifecycleEventCallback(virConnectPtr conn ATTRIBUTE_UNUSED,
+ virDomainPtr dom ATTRIBUTE_UNUSED,
+ int event,
+ int detail ATTRIBUTE_UNUSED,
+ void *opaque ATTRIBUTE_UNUSED)
+{
+ if (event == VIR_DOMAIN_EVENT_STOPPED)
+ numActiveDomains--;
+ else if (event == VIR_DOMAIN_EVENT_STARTED)
+ numActiveDomains++;
+
+ numActiveDomainsChanged();
+
+ return 0;
+}
+
+static DBusHandlerResult handleSessionMessageFunc(DBusConnection *connection ATTRIBUTE_UNUSED,
+ DBusMessage *message,
+ void *userData)
+{
+ virNetServerPtr srv = userData;
+
+ if (dbus_message_is_signal(message, DBUS_INTERFACE_LOCAL, "Disconnected")) {
+ saveAllDomains (srv);
+ }
+
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+}
+
+static DBusHandlerResult handleSystemMessageFunc(DBusConnection *connection ATTRIBUTE_UNUSED,
+ DBusMessage *message,
+ void *userData)
+{
+ virNetServerPtr srv = userData;
+
+ if (dbus_message_is_signal(message, "org.freedesktop.login1.Manager", "PrepareForShutdown")) {
+ saveAllDomains (srv);
+ }
+
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+}
+#endif
+
static void daemonRunStateInit(void *opaque)
{
virNetServerPtr srv = opaque;
@@ -785,6 +996,39 @@ static void daemonRunStateInit(void *opaque)
return;
}
+#ifdef HAVE_DBUS
+ /* Tie the non-priviledged libvirtd to the session/shutdown lifecycle */
+ if (!virNetServerIsPrivileged(srv)) {
+
+ sessionBus = virDBusGetSessionBus ();
+ if (sessionBus != NULL) {
+ dbus_connection_add_filter(sessionBus,
+ handleSessionMessageFunc, srv, NULL);
+ }
+
+ systemBus = virDBusGetSystemBus ();
+ if (systemBus != NULL) {
+ dbus_connection_add_filter(systemBus,
+ handleSystemMessageFunc, srv, NULL);
+ dbus_bus_add_match(systemBus,
+ "type='signal',sender='org.freedesktop.login1', interface='org.freedesktop.login1.Manager'",
+ NULL);
+ }
+
+ sessionConnection = virConnectOpen("qemu:///session");
+ if (sessionConnection != NULL) {
+ numActiveDomains = virConnectNumOfDomains(sessionConnection);
+ virConnectDomainEventRegisterAny(sessionConnection,
+ NULL,
+ VIR_DOMAIN_EVENT_ID_LIFECYCLE,
+ VIR_DOMAIN_EVENT_CALLBACK (lifecycleEventCallback),
+ NULL, NULL);
+ numActiveDomainsChanged();
+ }
+
+ }
+#endif
+
/* Only now accept clients from network */
virNetServerUpdateServices(srv, true);
virObjectUnref(srv);
--
1.7.12.1
+1929 -199
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1 +1 @@
f1cd360a5da38b847e166c6482141940 libvirt-0.7.1.tar.gz
56078401a10162674dbd98846d0f607d libvirt-0.10.2.8.tar.gz