[libvirt] [PATCH] virsh: Remove useless codes of cmdVolPath
by Osier Yang
Variable "name" is never used in the codes, it's useless.
---
tools/virsh.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index e8258c1..371346a 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -10006,13 +10006,12 @@ static bool
cmdVolPath(vshControl *ctl, const vshCmd *cmd)
{
virStorageVolPtr vol;
- const char *name = NULL;
char * StorageVolPath;
if (!vshConnectionUsability(ctl, ctl->conn))
return false;
- if (!(vol = vshCommandOptVol(ctl, cmd, "vol", "pool", &name))) {
+ if (!(vol = vshCommandOptVol(ctl, cmd, "vol", "pool", NULL))) {
return false;
}
--
1.7.6
13 years, 2 months
[libvirt] [PATCH 0/2] Modify generic ethernet interface so it will work when sVirt is enabled with qemu
by Tyler Coumbes
Currently you cannot use generic ethernet interfaces with qemu when
sVirt is enabled. This is because
libvirt was having qemu handle the TAP creation and it doesn't have
the rights to do so.
This patch changes it so that libvirt handles and TAP creation and
deletion. Passing the TAP as
a file descriptor to qemu instead. Backwards capability has been
maintained in the following manner.
If a script is defined for the interface in the domain XML then it
uses the old method of having
qemu create the TAP and running the ifup script. If a script is not
defined then the new method
is used. When used with a script(old method) you will still be unable
to use sVirt. You can use the
old method without running a script. To do this define script='no'
this will use the old method,
but without a script.
I have been running this patched version for while now on Fedora 15. I
haven't ran into any issues.
Hopefully I didn't miss anything.
Previous patch proposal
https://www.redhat.com/archives/libvir-list/2011-July/msg00407.html
Thanks,
Tyler
13 years, 2 months
[libvirt] [PATCH] build: silence warning on 32-bit build
by Eric Blake
gcc warns when building libvirt 0.9.5 on a 32-bit machine:
qemu/qemu_migration.c: In function 'qemuMigrationToFile':
qemu/qemu_migration.c:2727:38: error: large integer implicitly truncated to unsigned type [-Woverflow]
* src/qemu/qemu_domain.h (QEMU_DOMAIN_FILE_MIG_BANDWIDTH_MAX): Cap
to long when building for 32-bit platform.
---
Pushing under the build-breaker rule.
src/qemu/qemu_domain.h | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index e44ff8a..cde3ada 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -37,7 +37,13 @@
(1 << VIR_DOMAIN_VIRT_XEN))
# define QEMU_DOMAIN_DEFAULT_MIG_BANDWIDTH_MAX (32 << 20)
-# define QEMU_DOMAIN_FILE_MIG_BANDWIDTH_MAX (INT64_MAX / (1024 * 1024))
+# if ULONG_MAX == 4294967295
+/* Qemu has a 64-bit limit, but we are limited by our historical choice of
+ * representing bandwidth in a long instead of a 64-bit int. */
+# define QEMU_DOMAIN_FILE_MIG_BANDWIDTH_MAX ULONG_MAX
+# else
+# define QEMU_DOMAIN_FILE_MIG_BANDWIDTH_MAX (INT64_MAX / (1024 * 1024))
+# endif
# define JOB_MASK(job) (1 << (job - 1))
# define DEFAULT_JOB_MASK \
--
1.7.4.4
13 years, 2 months
[libvirt] Release of libvirt-0.9.5
by Daniel Veillard
Okay, it is finally out of the box :-) available as usual on
ftp://libvirt.org/libvirt/
The snapshot support in that version should have improved a lot, and
for the curious there is some early support for Microsoft hypervisor
now, updated support for USB should also be a major user improvement.
Considering the amount of bug fixes, I would suggest to upgrade
to that version even if you don't need any new features !
Features:
- many snapshot improvements (Eric Blake)
- latency: Define new public API and structure (Osier Yang)
- USB2 and various USB improvements (Marc-André Lureau)
- storage: Add fs pool formatting (Osier Yang)
- Add public API for getting migration speed (Jim Fehlig)
- Add basic driver for Microsoft Hyper-V (Matthias Bolte)
Documentation:
- virsh: tweak previous domblkstat patch (Eric Blake)
- virsh: doc: Fix supported driver types for attach-disk command (Peter Krempa)
- doc: Add statment about permissions needed to do a core dump (Peter Krempa)
- snapshot: tweak snapshot-create-as diskspec docs (Eric Blake)
- qemu_api: doc improvements (Eric Blake)
- virsh: Fix command name in man page (Peter Krempa)
- fix incorrect option in send-key (Alex Jia)
- virsh: improve send-key documentation (Eric Blake)
- hyperv: Add basic documentation (Matthias Bolte)
- schedinfo: update man page about virsh schedinfo command (Taku Izumi)
- virsh: Clarify documentation of -d option (Jiri Denemark)
- schedinfo: add missing documentation (Taku Izumi)
- Improve tokenizing of linkable terms (Philipp Hahn)
- Add some docs about the RPC protocol and APIs (Daniel P. Berrange)
- Align table cells on top (Philipp Hahn)
- use IPv6 addresses in range reserved for documentation (Laine Stump)
- describe new virtual switch configuration in network XML docs (Laine Stump)
Portability:
- Update to require sanlock 1.8 for license compliance (Daniel P. Berrange)
- build: work around lack of MacOS fdatasync (Eric Blake)
- python: Fix bindings generated in VPATH build (Jiri Denemark)
- build: storage: Macro 'MKFS' is undefined on some platforms. (Peter Krempa)
- build: storage: Conditionaly compiled structure caused build fail on OSX (Peter Krempa)
- Avoid using "devname" as an identifier. (Peter Krempa)
- mingw: Don't use interface as an identifier (Matthias Bolte)
- esx: Use $(PYTHON) instead of the shebang to run the generator (Matthias Bolte)
- build: work around older systemtap header (Eric Blake)
- build: fix compilation on mingw64 (Eric Blake)
- build: fix virnetsocket on mingw (Eric Blake)
- build: fix virpidfile on mingw (Eric Blake)
- maint: fix some compilation issues on non-linux platforms (part 2) (Stefan Berger)
- maint: fix some compilation issues on non-linux platforms (Stefan Berger)
- Fix detection of GnuTLS 1.x.y (Matthias Bolte)
Bug Fixes:
- Fix crash on events due to allocation errors (Daniel Veillard)
- conf: Assign newDef of active domain as persistent conf if it is NULL (Osier Yang)
- storage: Ensure the device path exists before refreshing disk pool (Osier Yang)
- daemon: Error and exit if specified value for timeout is not valid (Osier Yang)
- vmx: avoid memory leak (Alex Jia)
- util: avoid memory leak (Alex Jia)
- remote: avoid memory leak (Alex Jia)
- qemu: avoid memory leak (Alex Jia)
- daemon: avoid memory leak (Alex Jia)
- Prevent crash from dlclose() of libvirt.so (Daniel P. Berrange)
- qemu: add return value check (Alex Jia)
- Avoid crash on restart if running guest has filterref (Stefan Berger)
- conf: avoid memory leak on virDomainDefParseXML (Alex Jia)
- Fix build after commit 829bce17 (Jim Fehlig)
- conf: add missing break in virDomainAuditRedirdev (Marc-André Lureau)
- snapshot: ABI stability must include memory sizing (Eric Blake)
- make: Fix 'make syntax-check' failing. (Peter Krempa)
- snapshot: fix double free of qemuImgBinary (Guannan Ren)
- virnetsocket: Pass KRB5CCNAME env variable (Michal Privoznik)
- Fix URL-escaping for domainDefine (Philipp Hahn)
- snapshot: fix regression with system checkpoints (Eric Blake)
- Don't treat pci_system_init failure as fatal if no PCI bus is present (Soren Hansen)
- rpc: avoid memory leak on virNetTLSContextValidCertificate (Alex Jia)
- tests: avoid memory leak on testTLSSessionInit (Alex Jia)
- libxl: avoid a dereference of a null pointer (Alex Jia)
- blockinfo: fix qemu regression in handling disk name (Eric Blake)
- esx: Fix managed object lookup with optional occurrence (Matthias Bolte)
- Threadpool: Initialize new dynamic workers (Michal Privoznik)
- Default USB device is on slot 1 function 2 (Marc-André Lureau)
- Fix localtime handling for Xen-PV domains (Philipp Hahn)
- snapshot: fix corner case on OOM during creation (Eric Blake)
- API: Init conn in case of it might be used uninitialized (Osier Yang)
- qemu: detect incomplete save files (Eric Blake)
- reserve slot 1 on pci bus0 (Wen Congyang)
- libvirtd: create run dir when running at non-root user (Xu He Jie)
- Don't overwrite errors from xend_{get,req} (Jim Fehlig)
- virsh: avoid memory leak on cmdVolCreateAs (Alex Jia)
- Fix tracking of RPC messages wrt streams (Daniel P. Berrange)
- Avoid use-after-free on streams, due to message callbacks (Daniel P. Berrange)
- Fix parted sector size assumption (Daniel P. Berrange)
- qemu: Fix a regression of domain save (Osier Yang)
- lxc: Fix incorrect changes on error codes. (Osier Yang)
- Stop libxl driver polluting logs on non-Xen hosts (Daniel P. Berrange)
- Fix memory leak parsing 'relabel' attribute in domain security XML (Daniel P. Berrange)
- Fix memory leak dispatching domain events (Daniel P. Berrange)
- Don't leak memory if a cgroup is mounted multiple times (Daniel P. Berrange)
- stream: remove redundant reference to client while sending stream data (Guannan Ren)
- Fix sanlock socket security labelling (Daniel P. Berrange)
- Fix incorrect path length check in sanlock lockspace setup (Daniel P. Berrange)
- snapshot: forbid snapshot on autodestroy domain (Eric Blake)
- Fix error detection in device change (Philipp Hahn)
- qemu: properly label outgoing pipe for tunneled migration (Eric Blake)
- Fix persistent migration config save (KAMEZAWA Hiroyuki)
- rpc: Don't close connection if program is unknown (Jiri Denemark)
- remote: Refuse connecting to remote socket (Michal Privoznik)
- Detect errors from the 'sendkey' command (Daniel P. Berrange)
- qemu: Correctly label migration TCP socket (Jiri Denemark)
- Do not try to cancel non-existent migration on source (Jiri Denemark)
- snapshot: don't leak resources on qemu snapshot failure (Eric Blake)
- Fix command test wrt gnutls initialize & fix debugging (Daniel P. Berrange)
- daemon: Move TLS initialization to virInitialize (Michal Privoznik)
- util: only fchown newly created files in virFileOpenAs (Laine Stump)
- qemu: fix off-by-one in pci slot reservation (Shradha Shah)
- pci: fix pciDeviceListSteal on multiple devices (Shradha Shah)
- qemu: Report error if qemu monitor command not found for BlockJob (Osier Yang)
- send-key: fix scan keycode map (KAMEZAWA Hiroyuki)
- storage: Flush host cache after write (Michal Privoznik)
- daemon: initialize GnuTLS (Michal Privoznik)
- Ensure async packets never get marked for sync replies (Daniel P. Berrange)
- Don't attempt to read from a stream if it is closed (Daniel P. Berrange)
- qemu: Init reattaching related members of pciDevice before reattach (Osier Yang)
- Fix race condition in abort of stream (Daniel P. Berrange)
- Ensure client streams are closed when marking a client for close (Daniel P. Berrange)
- Ensure stream is aborted when exiting console (Daniel P. Berrange)
- daemon: Add early libvirtd start verbose errors. (Peter Krempa)
- qemu: error message should show uri instead of (null) (Peter Krempa)
- libvirtd.init.in: stop/restart() - wrong return value in case of failure (Douglas Schilling Landgraf)
- daemon: Fix regression of libvirtd reloading support (Osier Yang)
- virsh: fix logic bug (Eric Blake)
- storage: Directory shouldn't be listed as type 'file' (Peter Krempa)
- network: eliminate potential memory leak on parse failure (Laine Stump)
- nwfilter: tolerate disappearing interfaces while instantiating filter (Stefan Berger)
- qemu: Fix -chardev udp if parameters are omitted (Cole Robinson)
- managedsave: prohibit use on transient domains (Eric Blake)
- Check stdoutWatch before removing the handler. (Juerg Haefliger)
- Fix memory leak while scanning snapshots (Philipp Hahn)
- build: fix regression in large file support (Eric Blake)
- Don't mount /dev for application containers (Daniel P. Berrange)
- qemu: avoid crash on process attach (Eric Blake)
- rpc:fix sasl session relocking intead of unlocking it (Guannan Ren)
- daemon: Unlink unix socket paths on shutdown (Osier Yang)
Improvements:
- Remove devname identifier from autogenerated RPC code (Peter Krempa)
- maint: Prefer names over email in 'git shortlog' (Eric Blake)
- virsh: Add more human-friendly output of domblkstat command (Peter Krempa)
- spec: silence warnings when installing in F16 (Eric Blake)
- snapshot: allow disk snapshots of qcow2 disks (Eric Blake)
- snapshot: affect persistent xml after disk snapshot (Eric Blake)
- qemu: Introduce shutdown reason for paused state (Jiri Denemark)
- qemu: Prevent disk corruption on domain shutdown (Jiri Denemark)
- qemu: Properly detect crash of a rebooted domain (Jiri Denemark)
- qemu: Fix shutoff reason when domain crashes (Jiri Denemark)
- rpc: convert unknown procedures to VIR_ERR_NO_SUPPORT (Eric Blake)
- python: Fix libvirt.py generation to include virterror info (Cole Robinson)
- sanlock: add missing test command in virt-sanlock-cleanup.in (Alex Jia)
- spec: Require augeas for sanlock (Michal Privoznik)
- Use max bandwidth from qemuDomainObjPrivate struct when migrating (Jim Fehlig)
- Set qemu migration speed unlimited when migrating to file (Jim Fehlig)
- Save migration speed in qemuDomainMigrateSetMaxSpeed (Jim Fehlig)
- Impl virDomainMigrateGetMaxSpeed in qemu driver (Jim Fehlig)
- Store max migration bandwidth in qemuDomainObjPrivate struct (Jim Fehlig)
- network: add missing exports (Eric Blake)
- xml: Clean up rest of virtual XML document names for XML strings (Peter Krempa)
- qemu_api: Update libvirt spec file (Osier Yang)
- qemu_api: Update Makefile to generate libvirtmod_qemu lib (Osier Yang)
- qemu_api: Update Py binding generator to generate files for QEMU APIs (Osier Yang)
- qemu_api: Add override XML and C files for QEMU APIs (Osier Yang)
- qemu_api: Add comments for API virDomainQemuMonitorCommand (Osier Yang)
- qemu_api: Update Makefile for subdir docs (Osier Yang)
- qemu_api: Modify apibuild.py to generate docs for QEMU APIs (Osier Yang)
- Do not log invalid operations in libvirtd logs (Daniel Veillard)
- selinux: Detect virt_use_nfs boolean set (Michal Privoznik)
- xml: Change virtual file names of xml documents parsed in memory (Peter Krempa)
- maint: update to latest gnulib (Eric Blake)
- snapshot: use new API for less work (Eric Blake)
- snapshot: new APIs for inspecting snapshot object (Eric Blake)
- virsh: fix typo in opts_send_key (Alex Jia)
- link-state: virsh: Add wrapper commands for changing link state (Peter Krempa)
- link-state: qemu: Add net intf modification to virUpdateDeviceFlags (Peter Krempa)
- link-state: qemu: Add monitor handling for link state modification (Peter Krempa)
- link-state: conf: Add element to XML for controling link state (Peter Krempa)
- link-state: util: Add equality comparison functions for structures (Peter Krempa)
- XML: Improve XML parsing error messages (Peter Krempa)
- redirdev: allows to specify device address (Marc-André Lureau)
- latency: Update virsh command domblkstat to use new API (Osier Yang)
- latency: Expose the new API for Python binding (Osier Yang)
- latency: Implemente internal API for qemu driver (Osier Yang)
- latency: Update monitor functions for new latency fields (Osier Yang)
- latency: Wire up the remote protocol (Osier Yang)
- latency: Implemente the public API (Osier Yang)
- latency: Define the internal driver callback (Osier Yang)
- qemu: Deal with stucked qemu on daemon startup (Michal Privoznik)
- qemu: Introduce job queue size limit (Michal Privoznik)
- daemon: Create priority workers pool (Michal Privoznik)
- snapshot: use SELinux and lock manager with external snapshots (Eric Blake)
- snapshot: wire up live qemu disk snapshots (Eric Blake)
- snapshot: wire up new qemu monitor command (Eric Blake)
- snapshot: make it possible to audit external snapshot (Eric Blake)
- snapshot: reject unimplemented disk snapshot features (Eric Blake)
- snapshot: wire up disk-only flag to snapshot-create (Eric Blake)
- snapshot: add flag for requesting disk snapshot (Eric Blake)
- snapshot: add virsh domblklist command (Eric Blake)
- snapshot: also support disks by path (Eric Blake)
- snapshot: add <disks> to snapshot xml (Eric Blake)
- snapshot: support extra state in snapshots (Eric Blake)
- snapshot: expose halt-after-creation in virsh (Eric Blake)
- snapshot: allow halting after snapshot (Eric Blake)
- snapshot: expose new delete flag in virsh (Eric Blake)
- snapshot: introduce new deletion flag (Eric Blake)
- snapshot: reject transient disks where code is not ready (Eric Blake)
- snapshot: additions to domain xml for disks (Eric Blake)
- Check for source conflicts in storage pools (Lei Li)
- Add a usb1 & usb2 qemuxml2argv test (Marc-André Lureau)
- PIIX3 USB controller is on function 2 (Marc-André Lureau)
- snapshot: store qemu domain details in xml (Eric Blake)
- snapshot: update rng to support full domain in xml (Eric Blake)
- snapshot: correctly escape generated xml (Eric Blake)
- snapshot: allow full domain xml in snapshot (Eric Blake)
- snapshot: refactor domain xml output (Eric Blake)
- snapshot: prevent migration from stranding snapshot data (Eric Blake)
- snapshot: support new undefine flags in qemu (Eric Blake)
- snapshot: cache qemu-img location (Eric Blake)
- snapshot: refactor some qemu code (Eric Blake)
- snapshot: teach virsh about new undefine flags (Eric Blake)
- snapshot: prevent stranding snapshot data on domain destruction (Eric Blake)
- snapshot: add qemu snapshot redefine support (Eric Blake)
- snapshot: add qemu snapshot creation without metadata (Eric Blake)
- snapshot: improve virsh snapshot-create, add snapshot-edit (Eric Blake)
- snapshot: refactor virsh snapshot creation (Eric Blake)
- snapshot: allow recreation of metadata (Eric Blake)
- snapshot: identify qemu snapshot roots (Eric Blake)
- snapshot: reflect new dumpxml and list options in virsh (Eric Blake)
- snapshot: identify which snapshots have metadata (Eric Blake)
- snapshot: let qemu discard only snapshot metadata (Eric Blake)
- snapshot: allow deletion of just snapshot metadata (Eric Blake)
- snapshot: simplify acting on just children (Eric Blake)
- snapshot: track current domain across deletion of children (Eric Blake)
- snapshot: avoid crash when deleting qemu snapshots (Eric Blake)
- snapshot: speed up snapshot location (Eric Blake)
- snapshot: add snapshot-list --parent to virsh (Eric Blake)
- snapshot: fine-tune qemu snapshot revert states (Eric Blake)
- snapshot: properly revert qemu to offline snapshots (Eric Blake)
- snapshot: improve reverting to qemu paused snapshots (Eric Blake)
- snapshot: fine-tune qemu saved images starting paused (Eric Blake)
- snapshot: expose --running and --paused in virsh (Eric Blake)
- snapshot: fine-tune ability to start paused (Eric Blake)
- snapshot: better events when starting paused (Eric Blake)
- Learn to use spicevmc as a redirection type for usb-redir (Marc-André Lureau)
- Add "redirdev" redirection device (Marc-André Lureau)
- qemu: Don't append 0 at usb id, so that it is compatible with legacy -usb (Marc-André Lureau)
- qemu: don't reserve slot 1 if a PIIX3 USB controller is defined there (Marc-André Lureau)
- Modify USB port to be defined as a port path (Marc-André Lureau)
- Add USB companion controllers support (Marc-André Lureau)
- USB devices gain a new USB address child element (Marc-André Lureau)
- test: USB controller can have a PCI address child element (Marc-André Lureau)
- Add a new controller type 'usb' with optionnal 'model' (Marc-André Lureau)
- Add USB controller models (Marc-André Lureau)
- Rename virDomainControllerModel to virDomainControllerModelSCSI (Marc-André Lureau)
- Add various USB devices QEMU_CAPS (Marc-André Lureau)
- tests: add missing files (Eric Blake)
- Add directsync cache mode support for disk driver (Osier Yang)
- storage: Add virsh support for fs pool formating (Osier Yang)
- storage: Add mkfs and libblkid to build system (Osier Yang)
- qemu: refactor file opening (Eric Blake)
- lxc: do not require 'ifconfig' or 'ipconfig' in container (Scott Moser)
- Create ptmx as a device (Serge Hallyn)
- BlockPull: Set initial bandwidth limit if specified (Adam Litke)
- BlockJob: Bandwidth parameter is in MB when using text monitor (Adam Litke)
- Increase size of buffer for xend response (Jim Fehlig)
- virsh: support 'virsh start --force-boot' on older servers (Eric Blake)
- build: fix 'make check' with pdwtags (Eric Blake)
- virsh: Expose virDomainMigrateGetMaxSpeed API (Jim Fehlig)
- virsh: prefer unsigned flags (Eric Blake)
- storage: Fix incorrect error codes (Osier Yang)
- remote: Fix incorrect error codes (Osier Yang)
- nodeinfo: Fix incorrect error codes (Osier Yang)
- conf: Substitute OPERATION_INVALID with INTERNAL_ERROR (Osier Yang)
- start: allow discarding managed save (Eric Blake)
- build: simplify use of verify (Eric Blake)
- rpc: fix a typo in debugging log in virNetServerProgramSendStreamData (Guannan Ren)
- maint: fix spelling errors on lose (Eric Blake)
- Fix generator to cope with call-by-ref long types (Jim Fehlig)
- hyperv: Add OpenWSMAN based client for the Hyper-V WMI API (Matthias Bolte)
- hyperv: Add driver skeleton (Matthias Bolte)
- hyperv: Add configure check for OpenWSMAN (Matthias Bolte)
- virterror: Fix error message for VIR_ERR_INVALID_ARG (Michal Privoznik)
- Fix keymap used to talk with QEMU (Daniel P. Berrange)
- security: Introduce SetSocketLabel (Jiri Denemark)
- security: Rename SetSocketLabel APIs to SetDaemonSocketLabel (Jiri Denemark)
- Ignore unused streams in virStreamAbort (Jiri Denemark)
- snapshot: track current snapshot across restarts (Eric Blake)
- snapshot: only pass snapshot to qemu command line when reverting (Eric Blake)
- libvirt: log all flags parameters (Eric Blake)
- virsh: add list --managed-save (Eric Blake)
- esx: Refactor a repeated string in the generator (Matthias Bolte)
- maint: fix comment typos (Eric Blake)
- virsh: Substitute goto label out with cleanup (Osier Yang)
- virsh: Do not try to free domain if it is NULL (Osier Yang)
- xen: Cleanup improper VIR_ERR_NO_SUPPORT use (Osier Yang)
- storage: Cleanup improper VIR_ERR_NO_SUPPORT use (Osier Yang)
- remote: Cleanup improper VIR_ERR_NO_SUPPORT use (Osier Yang)
- qemu: Cleanup improper VIR_ERR_NO_SUPPORT use (Osier Yang)
- nodeinfo: Cleanup improper VIR_ERR_NO_SUPPORT use (Osier Yang)
- lxc: Cleanup improper VIR_ERR_NO_SUPPORT use (Osier Yang)
- conf: Cleanup improper use of VIR_ERR_NO_SUPPORT in node_device_conf (Osier Yang)
- qemu: Substitute VIR_ERR_NO_SUPPORT with VIR_ERR_OPERATION_INVALID (Osier Yang)
- virsh: Print error if specified bandwidth is invalid for blockjob (Osier Yang)
- virsh: properly interleave shared stdout and stderr (Eric Blake)
- maint: simplify lots of libxml2 clients (Eric Blake)
- xml: add another convenience function (Eric Blake)
- maint: treat more libxml2 functions as free-like (Eric Blake)
- test: rewrite test to match change in behavior (Eric Blake)
- build: fix typo in recent test patch (Eric Blake)
- vmware: Allow to undefine a running domain (Osier Yang)
- uml: Allow to undefine a running domain (Osier Yang)
- test: Allow to undefine a running domain (Osier Yang)
- qemu: Allow to undefine a running domain (Osier Yang)
- openvz: Allow to undefine a running domain (Osier Yang)
- lxc: Allow to undefine a running domain (Osier Yang)
- libxl: Allow to undefine a running domain. (Osier Yang)
- qemu: Get memory balloon info correctly for text monitor (Osier Yang)
- qemu: disk migration verbose progress (Tom Vijlbrief)
- virsh: concatenate qemu-monitor-command arguments (Eric Blake)
- virsh: tweak misleading wording (Eric Blake)
- Tweak debugging message in RPC client code (Daniel P. Berrange)
- maint: add missing symbols (Stefan Berger)
- macvtap: Fix getPhysfn to get the PF of a direct attach network interface (Roopa Prabhu)
- interface: Add functions to get sriov PF/VF relationship of a net interface (Roopa Prabhu)
- pci: Add helper functions for sriov devices (Roopa Prabhu)
- pci: Move some pci sriov helper code out of node device driver to util/pci (Roopa Prabhu)
- qemu: support event_idx parameter for virtio disk and net devices (Laine Stump)
- qemu: Use fd: protocol for migration (Jiri Denemark)
- qemu: Use virNetSocket for tunneled migration (Jiri Denemark)
- qemu: Refactor do{Tunnel,Native}Migrate functions (Jiri Denemark)
- Support changing UNIX socket owner in virNetSocketNewListenUNIX (Jiri Denemark)
- Add backlog parameter to virNetSocketListen (Jiri Denemark)
- Add API for duplicating a socket/client file descriptor (Daniel P. Berrange)
- Swap virDomain / virDomainSnapshot declaration (Philipp Hahn)
- build: fix recent build failures (Eric Blake)
- Convert libvirtd to use crash-safe pidfile APIs (Daniel P. Berrange)
- Add some APIs which use locking for crashsafe pidfile handling (Daniel P. Berrange)
- Introduce functions for checking whether a pidfile is valid (Daniel P. Berrange)
- Move pidfile functions into util/virpidfile.{c,h} (Daniel P. Berrange)
- Add virFileLock and virFileUnlock APIs (Daniel P. Berrange)
- vbox, xenapi: add virDomainUndefineFlags (Eric Blake)
- virsh: don't reject undefine on active domain (Eric Blake)
- virsh: Add dir type for listing volumes with vol-list (Peter Krempa)
- virsh: add snapshot-parent (Eric Blake)
- virsh: add virsh snapshot-current --name (Eric Blake)
- virsh: fix snapshot-create-as to handle arbitrary names (Eric Blake)
- qemu: minor formatting cleanup (Eric Blake)
- Allow use of file images for LXC container filesystems (Daniel P. Berrange)
- Fix typo in LXC cgroups setup error message (Daniel P. Berrange)
- Allow use of block devices for guest filesystem (Daniel P. Berrange)
- qemu: Avoid overwriting errors from virGetHostname (Jiri Denemark)
- network: eliminate lag in updating dnsmasq hosts files (Laine Stump)
- build: update to latest gnulib (Eric Blake)
Cleanups:
- maint: ignore generated files (Eric Blake)
- Remove two references to files not generated (Daniel Veillard)
- latency: fix make check for remote protocol structs and numbers (Daniel Veillard)
- security: fix build (Eric Blake)
- Remove bogus virSecurityManagerSetProcessFDLabel method (Daniel P. Berrange)
- libvirt: avoid dead store in virDomainMigrateVersion3 (Alex Jia)
- qemu: avoid dead store in doPeer2PeerMigrate3 (Alex Jia)
- maint: ignore generated file (Eric Blake)
- maint: ignore generated file (Eric Blake)
- maint: let emacs avoid tabs in rng files (Eric Blake)
- virsh: fix dead store (Eric Blake)
- qemu: silence clang false positive (Eric Blake)
- qemu: avoid dead store in qemuMonitorTextBlockJob (Alex Jia)
- qemu: avoid dead store in qemuProcessStart (Alex Jia)
Thanks to everybody who contributed to this release, by submitting
bug, reports, documentation, patches or just ideas !
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/
13 years, 2 months
[libvirt] [PATCH] qemu: Prevent disk corruption on domain shutdown
by Jiri Denemark
Ever since we introduced fake reboot, we call qemuProcessKill as a
reaction to SHUTDOWN event. Unfortunately, qemu doesn't guarantee it
flushed all internal buffers before sending SHUTDOWN, in which case
killing the process forcibly may result in (virtual) disk corruption.
By sending just SIGTERM without SIGKILL we give qemu time to to flush
all buffers and exit. Once qemu exits, we will see an EOF on monitor
connection and tear down the domain. In case qemu ignores SIGTERM or
just hangs there, the process stays running but that's not any different
from a possible hang anytime during the shutdown process so I think it's
just fine.
Also qemu (since 0.14 until it's fixed) has a bug in SIGTERM processing
which causes it not to exit but instead send new SHUTDOWN event and keep
waiting. I think the best we can do is to ignore duplicate SHUTDOWN
events to avoid a SHUTDOWN-SIGTERM loop and leave the domain in paused
state.
---
src/qemu/qemu_driver.c | 2 +-
src/qemu/qemu_process.c | 25 ++++++++++++++++++-------
src/qemu/qemu_process.h | 2 +-
3 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d2626ff..9ff800f 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1870,7 +1870,7 @@ qemuDomainDestroyFlags(virDomainPtr dom,
* can kill the process even if a job is active. Killing
* it now means the job will be released
*/
- qemuProcessKill(vm);
+ qemuProcessKill(vm, false);
if (qemuDomainObjBeginJobWithDriver(driver, vm, QEMU_JOB_DESTROY) < 0)
goto cleanup;
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 24d1dc7..dbd697d 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -419,7 +419,7 @@ endjob:
cleanup:
if (vm) {
if (ret == -1)
- qemuProcessKill(vm);
+ qemuProcessKill(vm, false);
if (virDomainObjUnref(vm) > 0)
virDomainObjUnlock(vm);
}
@@ -437,6 +437,12 @@ qemuProcessHandleShutdown(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
VIR_DEBUG("vm=%p", vm);
virDomainObjLock(vm);
+ if (priv->gotShutdown) {
+ VIR_DEBUG("Ignoring repeated SHUTDOWN event from domain %s",
+ vm->def->name);
+ goto cleanup;
+ }
+
priv->gotShutdown = true;
if (priv->fakeReboot) {
virDomainObjRef(vm);
@@ -446,16 +452,17 @@ qemuProcessHandleShutdown(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
qemuProcessFakeReboot,
vm) < 0) {
VIR_ERROR(_("Failed to create reboot thread, killing domain"));
- qemuProcessKill(vm);
+ qemuProcessKill(vm, true);
if (virDomainObjUnref(vm) == 0)
vm = NULL;
}
} else {
- qemuProcessKill(vm);
+ qemuProcessKill(vm, true);
}
+
+cleanup:
if (vm)
virDomainObjUnlock(vm);
-
return 0;
}
@@ -3183,10 +3190,11 @@ cleanup:
}
-void qemuProcessKill(virDomainObjPtr vm)
+void qemuProcessKill(virDomainObjPtr vm, bool gracefully)
{
int i;
- VIR_DEBUG("vm=%s pid=%d", vm->def->name, vm->pid);
+ VIR_DEBUG("vm=%s pid=%d gracefully=%d",
+ vm->def->name, vm->pid, gracefully);
if (!virDomainObjIsActive(vm)) {
VIR_DEBUG("VM '%s' not active", vm->def->name);
@@ -3216,6 +3224,9 @@ void qemuProcessKill(virDomainObjPtr vm)
break;
}
+ if (i == 0 && gracefully)
+ break;
+
usleep(200 * 1000);
}
}
@@ -3300,7 +3311,7 @@ void qemuProcessStop(struct qemud_driver *driver,
}
/* shut it off for sure */
- qemuProcessKill(vm);
+ qemuProcessKill(vm, false);
/* Stop autodestroy in case guest is restarted */
qemuProcessAutoDestroyRemove(driver, vm);
diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h
index 96ba3f3..ef422c4 100644
--- a/src/qemu/qemu_process.h
+++ b/src/qemu/qemu_process.h
@@ -68,7 +68,7 @@ int qemuProcessAttach(virConnectPtr conn,
virDomainChrSourceDefPtr monConfig,
bool monJSON);
-void qemuProcessKill(virDomainObjPtr vm);
+void qemuProcessKill(virDomainObjPtr vm, bool gracefully);
int qemuProcessAutoDestroyInit(struct qemud_driver *driver);
void qemuProcessAutoDestroyRun(struct qemud_driver *driver,
--
1.7.6.1
13 years, 2 months
[libvirt] specifying rbd images in libvirt
by Sage Weil
Hi all,
Currently, you can specify an rbd (or nbd, sheepdog) image with xml
that looks like so:
<disk type='network' device='disk'>
<driver name='qemu' type='raw' cache='writeback'/>
<source protocol='rbd' name='mypool/myimage'>
<host name='monhost1.mydomain.com' port='6789'/>
<host name='monhost2.mydomain.com' port='6789'/>
<host name='monhost3.mydomain.com' port='6789'/>
</source>
<target dev='vda' bus='virtio'/>
</disk>
This works okay if you have authentication disabled and all of the default
settings are okay. Usually, though, there are other options you need to
specify to librbd to make it do what you want.
The current schema can be abused by adding options after the image name
like so:
<disk type='network' device='disk'>
<driver name='qemu' type='raw' cache='writeback'/>
<source protocol='rbd' name='mypool/myimage:conf=/etc/ceph/ceph.conf:id=admin:this=that:foo=bar'>
<host name='monhost1.mydomain.com' port='6789'/>
<host name='monhost2.mydomain.com' port='6789'/>
<host name='monhost3.mydomain.com' port='6789'/>
</source>
<target dev='vda' bus='virtio'/>
</disk>
This works only because that's what the qemu incantation looks like. In
general, though, this is ugly. I also doesn't generalize well to the
kernel-level rbd driver, which we'd like to also support, as that will
work with hypervisors other than qemu.
What about something more like this?
<disk type='network' device='disk'>
<driver name='qemu' type='raw' cache='writeback'/>
<source protocol='rbd' name='mypool/myimage'>
<option name='conf'>/etc/ceph/ceph.conf</option>
<option name='id'>myusername</option>
<option name='foo'>bar</option>
<host name='monhost1.mydomain.com' port='6789'/>
<host name='monhost2.mydomain.com' port='6789'/>
<host name='monhost3.mydomain.com' port='6789'/>
</source>
<target dev='vda' bus='virtio'/>
</disk>
I'm not married to any particular syntax/schema, as long as there is a
generic way to specify name/value pairs to configure the driver. I think
the above would generalize well to other network block devices as well,
which presumably also want a way to feed in information other than a
server address (e.g. for authentication).
Does that look reasonable? If there are no objections we can work up some
patches and send them along!
Thanks-
sage
13 years, 2 months
[libvirt] [PATCH] conf: Assign newDef of active domain as persistent conf if it is NULL
by Osier Yang
Libvirt loads the domain conf from status XML if it's running when
starting up. The problem is there is no record of the original conf.
(dom->newDef is NULL here).
So libvirt won't be able to restore the domain conf to original one
when destroying/shutdown. E.g.
1) attach a device without "--persistent"
2) restart libvirtd
3) destroy domain
4) start domain
One will see the the disk still exists.
This patch is to fix the peoblem by assigning persistent domain conf
to dom->newDef if it's NULL and the domain is running.
---
src/conf/domain_conf.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 00212db..cbb99d3 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -10533,9 +10533,15 @@ static virDomainObjPtr virDomainLoadConfig(virCapsPtr caps,
if ((dom = virDomainFindByUUID(doms, def->uuid))) {
dom->autostart = autostart;
+ if (virDomainObjIsActive(dom) &&
+ !dom->newDef) {
+ virDomainObjAssignDef(dom, def, false);
+ } else {
+ virDomainDefFree(def);
+ }
+
VIR_FREE(configFile);
VIR_FREE(autostartLink);
- virDomainDefFree(def);
return dom;
}
--
1.7.6
13 years, 2 months
[libvirt] [PATCH] storage: Ensure the device path exists before refreshing disk pool
by Osier Yang
Doing libvirt_parthelper on an not existed device path will get
an unfriendly error message. This patch is to prohibit it.
---
src/storage/storage_backend_disk.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/src/storage/storage_backend_disk.c b/src/storage/storage_backend_disk.c
index 80f9dd1..82d6e8a 100644
--- a/src/storage/storage_backend_disk.c
+++ b/src/storage/storage_backend_disk.c
@@ -262,7 +262,6 @@ static int
virStorageBackendDiskReadPartitions(virStoragePoolObjPtr pool,
virStorageVolDefPtr vol)
{
-
/*
* # libvirt_parthelper DEVICE
* /dev/sda1 normal data 32256 106928128 106896384
@@ -320,6 +319,13 @@ virStorageBackendDiskRefreshPool(virConnectPtr conn ATTRIBUTE_UNUSED,
virFileWaitForDevices();
+ if (!virFileExists(pool->def->source.devices[0].path)) {
+ virStorageReportError(VIR_ERR_INVALID_ARG,
+ _("device path '%s' doesn't exist"),
+ pool->def->source.devices[0].path);
+ return -1;
+ }
+
if (virStorageBackendDiskReadGeometry(pool) != 0) {
return -1;
}
--
1.7.6
13 years, 2 months
[libvirt] [PATCH] daemon: Error and exit if specified value for timeout is not valid
by Osier Yang
Silently setting "timeout" as -1 if the specified value is invalid
is a bit confused.
---
daemon/libvirtd.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index c708ff7..4dd68d5 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -1311,8 +1311,10 @@ int main(int argc, char **argv) {
if (virStrToLong_i(optarg, &tmp, 10, &timeout) != 0
|| timeout <= 0
/* Ensure that we can multiply by 1000 without overflowing. */
- || timeout > INT_MAX / 1000)
- timeout = -1;
+ || timeout > INT_MAX / 1000) {
+ VIR_ERROR(_("Invalid value for timeout"));
+ exit(EXIT_FAILURE);
+ }
break;
case 'p':
--
1.7.6
13 years, 2 months
[libvirt] [PATCH 0/5] avoid memory leaks
by ajia@redhat.com
Detected by Coverity.
* daemon/remote.c: Calling allocation function 'get_nonnull_domain' to
allocate memory to 'dom', but haven't released it in 'cleanup' section.
* src/qemu/qemu_command.c: Taking 'if (!port)' true branch then 'def = NULL',
the codes jump into 'error' section, the function 'virDomainDefFree(def)'
willn't release it.
* src/remote/remote_driver.c: Calling allocation function 'get_nonnull_domain' to
allocate memory to 'dom', but haven't released it in 'no_memory' section.
* src/util/pci.c: Calling allocation function 'pciGetVirtualFunctions' on
'virt_fns', but haven't released it in 'out' section.
* src/vmx/vmx.c: Calling allocation function 'virConfReadMem' to allocate
memory to 'conf' and then taking 'if (VIR_ALLOC(def) < 0)' true branch,
the codes haven't released it before 'return NULL'.
Signed-off-by: Alex Jia <ajia(a)redhat.com>
---
daemon/remote.c | 2 ++
src/qemu/qemu_command.c | 1 -
src/remote/remote_driver.c | 2 ++
src/util/pci.c | 1 +
src/vmx/vmx.c | 1 +
5 files changed, 6 insertions(+), 1 deletions(-)
13 years, 2 months