[libvirt] Release of libvirt-1.2.11
by Daniel Veillard
It's out ! Tagged in git and signed tarballs and rpms are available
from the usual place:
ftp://libvirt.org/libvirt/
I also tagged and pushed a libvirt-python release too, to be found at:
ftp://libvirt.org/libvirt/python/
Overall this includes around 350 commits, 2 are security fixes, and
this also includes a couple of new generic features. There is of course
a number of improvement on various drivers, notably parallels, drvbhyve,
linux containers, xen migration, and kvm.
This also pack an impressive amount of bug fixes (nearly 100), so I
would really suggest to update when possible.
Features:
- Implement public API for virDomainGetFSInfo (Tomoki Sekiyama)
- qemu: Add define for the new throttle options (Matthias Gatto)
Security:
- CVE-2014-8131: Fix possible deadlock and segfault in qemuConnectGetAllDomainStats() (Martin Kletzander)
- CVE-2014-7823: dumpxml: security hole with migratable flag (Eric Blake)
Documentation:
- virsh.pod: Fix typo (John Ferlan)
- Fix typo in path for storage pool (John Ferlan)
- Fix missing curly braces (Hao Liu)
- Fix simple typo s/ a API/ an API/ (Martin Kletzander)
- getstats: improve documentation (Eric Blake)
- Use gender-neutral pronoun in hacking.html.in (Christophe Fergeau)
- network: fix some trivial typos in docs/formatnetwork.html (Chen Fan)
- virsh.pod: Fix the pool-define-as and pool-create-as description (John Ferlan)
- Fix a couple of typos on the storage pool html (John Ferlan)
- storage: fix rbd pool indentation (Cole Robinson)
- Create html documentation even if XHTML1 DTD is not available to validate (Ian Campbell)
- More html/docs changes from libvirt.h.in split (John Ferlan)
- conf: fix a comment typo in virDomainVideoDefaultRAM (Wang Rui)
- Correct invalid hyperlinks (Martin Kletzander)
- Fix missing slashes in XML examples (Luyao Huang)
- fix simple typo in TPM paragraph (Martin Kletzander)
- tests: fix documentation for mocking methods (Martin Kletzander)
- virsh: document block.n.allocation stat (Eric Blake)
- storage_driver: fix a comment typo (Chen Hanxiao)
- domain: Move docs for storage hosts under the <source> element (Peter Krempa)
- virsh: sync domdisplay help and manual (Martin Kletzander)
- fix a typo in formatdomain.html (Chen Fan)
- Remove references to unused libvirt-libvirt.html (Nehal J Wani)
- Document NVRAM behavior on transient domains (Michal Privoznik)
- Adjust contributor guidelines about curly brackets (Martin Kletzander)
- Fix API docs for header file re-organization (Daniel P. Berrange)
- fix mismatched ACL attribute name (Luyao Huang)
- Add documentation for compat mode. (Prerna Saxena)
- examples: add systemtap script to ease lock debugging (Martin Kletzander)
Portability:
- Fix build on mingw (Ján Tomko)
- define NTF_{SELF,MASTER} if undefined (Guido Günther)
- build: fix mingw printing of pid (Eric Blake)
- build: fix unused variable in mingw (Eric Blake)
- libxl: Allow libxl to find pygrub binary. (Ian Campbell)
- build: fix build when not using dbus (Eric Blake)
- build: avoid 32-bit failure on older gcc (Eric Blake)
- build: fix build with older dbus headers (Eric Blake)
- maint: use portable shell (Eric Blake)
- qemuxml2argvtest: Run some test only on Linux (Michal Privoznik)
Bug Fixes:
- Avoid getting '-1:-1' in devices cgroup list (Cédric Bosdonnat)
- conf: goto error when value of max_sectors is too large (Luyao Huang)
- Ignore CPU features without a model for host-passthrough (Ján Tomko)
- Do not format CPU features without a model (Ján Tomko)
- qemu: bulk stats: Fix logic in monitor handling (Francesco Romani)
- dac: Add a new func to get DAC label of a running process (Luyao Huang)
- viriscsi: Need to sendtargets on Initiator IQN (John Ferlan)
- storage: Check stderr when matching parted output (Hao Liu)
- security: Manage SELinux labels on shared/readonly hostdev's (John Ferlan)
- tests: Fix sharable typo (John Ferlan)
- conf: forbid negative number in address(like controller, bus, slot...) (Luyao Huang)
- qemu: migration: Unlock vm on failed ACL check in protocol v2 APIs (Peter Krempa)
- network: don't allow multiple dhcp sections (Kyle DeFrancia)
- getstats: avoid memory leak on OOM (Eric Blake)
- util: check for an illegal character in a XML namespace prefix (Erik Skultety)
- qemu: snapshot: Forbid internal snapshot with passthrough devices (Shanzhi Yu)
- networkValidate: Disallow bandwidth in portgroups too (Michal Privoznik)
- qemu: process: Avoid uninitialized use two vars when reconnecting to vm (Peter Krempa)
- Fix handling of whitespae in preprocessor macros for API generator (Daniel P. Berrange)
- tests: Fix misplaced parenthesis in qemumonitorjsontest (Martin Kletzander)
- qemu: Fix virsh freeze when blockcopy storage file is removed (Erik Skultety)
- cpu: fix possible crash in getModels (Pavel Hrdina)
- leaseshelper: Skip entries missing expiry time on INIT action (Peter Krempa)
- storage: fix crash caused by no check return before set close (Luyao Huang)
- virsh: vol-upload disallow negative offset (Shanzhi Yu)
- parallels: fix compilation of parallels_storage.c (Dmitry Guryanov)
- Generate a MAC when loading a config instead of package update (Ján Tomko)
- Silently ignore MAC in NetworkLoadConfig (Ján Tomko)
- nwfilter: fix crash when adding non-existing nwfilter (Pavel Hrdina)
- Fix race condition in qemuGetProcessInfo (Eduardo Costa)
- libxl: Resolve Coverity CHECKED_RETURN (John Ferlan)
- domain_conf: Resolve Coverity CHECKED_RETURN (John Ferlan)
- virhook: Resolve Coverity NULL_RETURNS (John Ferlan)
- hotplug: Resolve Coverity FORWARD_NULL (John Ferlan)
- storage: Add mixed fc_host/scsi_host duplicate adapter source checks (John Ferlan)
- conf: Add device-related code for panic devices (Martin Kletzander)
- conf: Add device-related code for TPM devices (Martin Kletzander)
- qemu: fix block{commit,copy} abort handling (Erik Skultety)
- qemu: Don't track quiesced state of FSs (Michal Privoznik)
- Fix usage of virReportSystemError (Jiri Denemark)
- network: Fix upgrade from libvirt older than 1.2.4 (Jiri Denemark)
- Resolve build breaker (John Ferlan)
- lxc: don't unmount subtree if it contains the source of the mount (Cédric Bosdonnat)
- virt-aa-helper wasn't running virErrorInitialize (Cédric Bosdonnat)
- storage: qemu: Fix security labelling of new image chain elements (Peter Krempa)
- storage: Add thread to refresh for createVport (John Ferlan)
- storage: Fix issue finding LU's when block doesn't exist (John Ferlan)
- rpc: do not fail if the pid of the connecting process is not set (Giuseppe Scrivano)
- util: don't log failure when older iptables lacks -w (Eric Blake)
- qemu: Really fix crash in tunnelled migration (Jiri Denemark)
- virsh: Fix msg: blockjob is aborted from another client (Erik Skultety)
- qemu: Fix crash in tunnelled migration (Jiri Denemark)
- vbox: fix a bug in _machineStateInactive (Yohan BELLEGUIC)
- qemu: Resolve Coverity UNINIT (John Ferlan)
- qemu: Fix get blkiodevtune for a disk that has been hot unplugged (Luyao Huang)
- Re-add use of locking with iptables/ip6tables/ebtables (Daniel P. Berrange)
- qemu: Don't try to parse -help for new QEMU (Jiri Denemark)
- qemu: Always set migration capabilities (Jiri Denemark)
- lxc: fix setmem effect on a running LXC machine (Erik Skultety)
- nwfilter: fix deadlock caused updating network device and nwfilter (Pavel Hrdina)
- qemuPrepareNVRAM: Save domain conf only if domain's persistent (Michal Privoznik)
- storage: Introduce 'managed' for the fchost parent (John Ferlan)
- storage: Ensure fc_host parent matches wwnn/wwpn (John Ferlan)
- storage: Check for valid fc_host parent at startup (John Ferlan)
- qemu: Resolve Coverity DEADCODE. (Matthias Gatto)
- qemu: Fix copy_paste_error in qemuBuildDriveStr. (Matthias Gatto)
- Do not crash on gluster snapshots with no host name (Ján Tomko)
- Fix virDomainChrEquals for spicevmc (Ján Tomko)
- qemu: fix domain startup failing with 'strict' mode in numatune (Wang Rui)
- lxc: don't setup cpuset.mems if memory mode in numatune is not 'strict' (Wang Rui)
- qemu: don't setup cpuset.mems if memory mode in numatune is not 'strict' (Wang Rui)
- Fix invalid log, misused option types and a typo (Hao Liu)
- phyp: Fix NULL dereference in phypConnectOpen (Martin Kletzander)
- nodeinfo: report error when failure in nodeSetMemoryParameters (Jincheng Miao)
- virnuma: add nodeset NULL check in virNumaSetupMemoryPolicy (Chen Fan)
- Fix build-time pkg-config files in VPATH (Jiri Denemark)
- qemu: Update fsfreeze status on domain state transitions (Michal Privoznik)
- network: fix call virNetworkEventLifecycleNew when networkStartNetwork fail (Luyao Huang)
- numa: fix assumption in virNumaNodeIsAvailable() (Martin Kletzander)
- Free job statistics from the migration cookie (Ján Tomko)
- virsh: Fix types for option bandwidth in block* (Hao Liu)
- qemuDomainUpdateDeviceConfig: Allow startupPolicy update (Michal Privoznik)
- remote: Fix memory leak in remoteConnectGetAllDomainStats (Peter Krempa)
- Require at least one console for LXC domain (Ján Tomko)
- Do not probe for power mgmt capabilities in lxc emulator (Ján Tomko)
- util: fix releasing pidfile in cleanup (Martin Kletzander)
- qemu: stop NBD server after successful migration (Weiwei Li)
- qemu: avoid rare race when undefining domain (Martin Kletzander)
- qemu: make sure capability probing process can start (Martin Kletzander)
- vbox: don't register NULL driver (Martin Kletzander)
- qemu: make advice from numad available when building commandline (Martin Kletzander)
Improvements:
- network: Bring netdevs online later (Matthew Rosato)
- lxc: give RW access to /proc/sys/net/ipv[46] to containers (Cédric Bosdonnat)
- conf: Ignore device address for guestfwd channel (Martin Kletzander)
- maint: clean up the unused variable 'caps' in src/qemu/qemu_*.c (Wang Rui)
- parallels: report proper error in Create/Destroy/Suspend e.t.c. (Dmitry Guryanov)
- parallels: fix getJobResultHelper (Dmitry Guryanov)
- parallels: return PRL_RESULT from waitJob and getJobResult (Dmitry Guryanov)
- parallels: implement domainUndefine and domainUndefineFlags (Dmitry Guryanov)
- parallels: add cdroms support (Dmitry Guryanov)
- parallels: Add domainCreateWithFlags() function. (Alexander Burluka)
- parallels: added function virDomainIsActive() (Alexander Burluka)
- parallels: refactor parallelsDomainDefineXML (Dmitry Guryanov)
- parallels: create VMs and containers with sdk (Dmitry Guryanov)
- parallels: rewrite parallelsApplyConfig with SDK (Dmitry Guryanov)
- parallels: reimplement functions, which change domain state (Dmitry Guryanov)
- parallels: handle events from parallels server (Alexander Burluka)
- parallels: move parallelsDomNotFoundError to parallels_utils.h (Dmitry Guryanov)
- parallels: get domain info with SDK (Alexander Burluka)
- parallels: move IS_CT macro to parallels_utils.h (Dmitry Guryanov)
- build: Move check for XML::XPath into bootstrap (Martin Kletzander)
- maint: update to latest gnulib (Eric Blake)
- lxc: always use virDomainNetGetActualBridgeName to get interface's bridge (Laine Stump)
- qemu: always use virDomainNetGetActualBridgeName to get interface's bridge (Laine Stump)
- qemu: setup tap devices for macTableManager='libvirt' (Laine Stump)
- network: setup bridge devices for macTableManager='libvirt' (Laine Stump)
- network: store network macTableManager setting in NetDef actual object (Laine Stump)
- network: save bridge name in ActualNetDef when actualType==network too (Laine Stump)
- conf: new network bridge device attribute macTableManager (Laine Stump)
- util: functions to manage bridge fdb (forwarding database) (Laine Stump)
- util: new functions for setting bridge and bridge port attributes (Laine Stump)
- getstats: add block.n.path stat (Eric Blake)
- getstats: start giving offline block stats (Eric Blake)
- rpc: Report proper close reason (Martin Kletzander)
- virsh: Don't reconnect after the command when disconnected (Martin Kletzander)
- storage: Fix printing/casting of uid_t/gid_t (Peter Krempa)
- virsh: Add adapter options for pool-{create|define}-as (John Ferlan)
- virsh: Add auth options for pool-{create|define}-as (John Ferlan)
- Report original error when QMP probing fails with new QEMU (Daniel P. Berrange)
- storage: backend: Log uid/gid when initializing storage file backend (Peter Krempa)
- qemu: process: Refactor reconnecting to qemu processes (Peter Krempa)
- drvbhyve: Automatically tear down guest domains on shutdown (Conrad Meyer)
- qemu: driver: Reload snapshots and managedsaves prior to reconnecting (Peter Krempa)
- leaseshelper: Fix incorrect alignment of a switch case (Peter Krempa)
- network: dnsmasq: Don't format lease file path (Peter Krempa)
- leaseshelper: Refactor control flow (Peter Krempa)
- leaseshelper: improvements to support all events (Nehal J Wani)
- cpu-driver: Fix the cross driver function call (Daniel Hansel)
- qemu_migration: Precreate missing storage (Michal Privoznik)
- qemu_migration: Send disk sizes to the other side (Michal Privoznik)
- qemuMonitorJSONBlockStatsUpdateCapacity: Don't skip disks (Michal Privoznik)
- storage: Introduce storagePoolLookupByTargetPath (Michal Privoznik)
- Replace virDomainSnapshotFree with virObjectUnref (John Ferlan)
- Replace virInterfaceFree with virObjectUnref (John Ferlan)
- Replace virNWFilterFree with virObjectUnref (John Ferlan)
- Replace virSecretFree with virObjectUnref (John Ferlan)
- Replace virStreamFree with virObjectUnref (John Ferlan)
- Replace virStoragePoolFree with virObjectUnref (John Ferlan)
- Replace virStorageVolFree with virObjectUnref (John Ferlan)
- Replace virNodeDeviceFree with virObjectUnref (John Ferlan)
- Replace virNetworkFree with virObjectUnref (John Ferlan)
- Replace virDomainFree with virObjectUnref (John Ferlan)
- rpc: Replace virXXXFree with virObjectUnref (John Ferlan)
- libvirt.c: Move virDomainGetFSInfo to libvirt-domain.c (Michal Privoznik)
- conf: replace call to virNetworkFree() with virObjectUnref() (Laine Stump)
- build, docs: Let make see the dependencies for html/*.html (Martin Kletzander)
- storage: Move and rename getVhbaSCSIHostParent (John Ferlan)
- conf: Don't redefine virDomainTPMDefPtr (Martin Kletzander)
- qemu: Make pid available for security managers in qemuProcessAttach (Luyao Huang)
- qemu: set jobinfo type to FAILED if job is failed in qemuMigrationRun (Wang Rui)
- qemu: set jobinfo type to CANCELLED if migration is cancelled in all conditions (Wang Rui)
- util: Avoid calling closedir(NULL) (Jiri Denemark)
- dbus: fix arrays of bools (Eric Blake)
- qemu: add the missing jobinfo type in qemuDomainGetJobInfo (Wang Rui)
- lxc: be more patient while resolving symlinks (Cédric Bosdonnat)
- virt-aa-helper: /etc/libvirt-sandbox/services isn't restricted (Cédric Bosdonnat)
- qemu-command: introduce new vgamem attribute for QXL video device (Pavel Hrdina)
- qemu-command: use vram attribute for all video devices (Pavel Hrdina)
- caps: introduce new QEMU capability for vgamem_mb device property (Pavel Hrdina)
- QXL: fix setting ram and vram values for QEMU QXL device (Pavel Hrdina)
- video: cleanup usage of vram attribute and update documentation (Pavel Hrdina)
- internal: add macro to round value to the next closest power of 2 (Pavel Hrdina)
- virsh: expose virDomainGetFSInfo (Tomoki Sekiyama)
- qemu: add test for qemuAgentGetFSInfo (Tomoki Sekiyama)
- qemu: Implement the qemu driver for virDomainGetFSInfo (Tomoki Sekiyama)
- remote: Implement the remote protocol for virDomainGetFSInfo (Tomoki Sekiyama)
- qemu: Emit the guest agent lifecycle event (Peter Krempa)
- examples: Add support for the guest agent lifecycle event (Peter Krempa)
- event: Add guest agent lifecycle event (Peter Krempa)
- spec: Automatically apply all patches with git (Jiri Denemark)
- qemu: process: Refresh virtio channel guest state when connecting to mon (Peter Krempa)
- qemu: chardev: Extract more information about character devices (Peter Krempa)
- libxl: destroy domain in migration finish phase on failure (Jim Fehlig)
- libxl: start domain paused on migration dst (Jim Fehlig)
- libxl: acquire job in migration finish phase (Jim Fehlig)
- libxl: Receive migration data in a thread (Jim Fehlig)
- storage: rbd: Implement support for passing config file option (Peter Krempa)
- storage: rbd: qemu: Add support for specifying internal RBD snapshots (Peter Krempa)
- storage: Allow parsing of RBD backing strings when building backing chain (Peter Krempa)
- util: storagefile: Split out parsing of NBD string into a separate func (Peter Krempa)
- util: split out qemuParseRBDString into a common helper (Peter Krempa)
- tests: Reflow the expected output from RBD disk test (Peter Krempa)
- qemu: Refactor qemuBuildNetworkDriveURI to take a virStorageSourcePtr (Peter Krempa)
- util: storage: Copy hosts of a storage file only if they exist (Peter Krempa)
- util: storage: Add notice for extension of struct virStorageSource (Peter Krempa)
- util: buffer: Clarify scope of the escape operation in virBufferEscape (Peter Krempa)
- test: virstoragetest: Add testing of network disk details (Peter Krempa)
- qemu: Add handling for VSERPORT_CHANGE event (Peter Krempa)
- conf: Add channel state for virtio channels to the XML (Peter Krempa)
- qemu: monitor: Rename and improve qemuMonitorGetPtyPaths (Peter Krempa)
- test: xml2xml: Print full filenames if xml2xml test fails (Peter Krempa)
- conf: Annotate source enums for character device struct members (Peter Krempa)
- qemu: process: report useful error if alias formatting fails (Peter Krempa)
- qemu: Drop OVMF whitelist (Michal Privoznik)
- qemu: Support OVMF on armv7l aarch64 guests (Michal Privoznik)
- maint: forbid 'int foo = true' (Eric Blake)
- virdbus: don't force users to pass int for bool values (Eric Blake)
- storage: wrap storage_driver.c to 80 columns (Chen Hanxiao)
- network: Add network bandwidth support to ethernet interfaces (Anirban Chakraborty)
- qemu: Add tests for new blkdeviotune arguments (John Ferlan)
- qemu: Add checks for blkdeviotune 'size_iops_sec' and adjust error (John Ferlan)
- bracket-spacing: Add syntax-check for unnecessary curly brackets (Martin Kletzander)
- bracket-spacing-check: Print out more specific error message (Martin Kletzander)
- bracket-spacing: Remove pointless cycles (Martin Kletzander)
- bracket-spacing: Don't modify current line (Martin Kletzander)
- Remove unnecessary curly brackets in tests/ (Martin Kletzander)
- Remove unnecessary curly brackets in tools/ (Martin Kletzander)
- Remove unnecessary curly brackets in rest of src/ (Martin Kletzander)
- Remove unnecessary curly brackets in rest of src/[o-u]*/ (Martin Kletzander)
- Remove unnecessary curly brackets in rest of src/[a-n]*/ (Martin Kletzander)
- Remove unnecessary curly brackets in src/vbox/ (Martin Kletzander)
- Remove unnecessary curly brackets in src/util/ (Martin Kletzander)
- Remove unnecessary curly brackets in src/test/test_driver.c (Martin Kletzander)
- Remove unnecessary curly brackets in src/storage/ (Martin Kletzander)
- Remove unnecessary curly brackets in src/qemu/ (Martin Kletzander)
- Remove unnecessary curly brackets in src/node_device/ (Martin Kletzander)
- Remove unnecessary curly brackets in src/hyperv/ (Martin Kletzander)
- Remove unnecessary curly brackets in src/conf/ (Martin Kletzander)
- Remove unnecessary curly brackets in src/vmx/vmx.c (Martin Kletzander)
- Remove unnecessary curly brackets in rest of src/esx/ (Martin Kletzander)
- Remove unnecessary curly brackets in src/esx/esx_driver.c (Martin Kletzander)
- Remove unnecessary curly brackets in daemon/ and examples/ (Martin Kletzander)
- virsh: Convert EDIT_NOT_CHANGED macro to do-while block. (Martin Kletzander)
- virt-aa-helper: Trick invalid syntax-check (Martin Kletzander)
- virsh: Error out if VSH_OT_STRING option has VSH_OFLAG_REQ flag (Martin Kletzander)
- virsh: Enforce proper ordering of options (Martin Kletzander)
- virsh: Reorder some options (Martin Kletzander)
- drvbhyve: Use boot-order for grub-bhyve boot device (Conrad Meyer)
- drvbhyve: Clean-up some used ATTRIBUTE_UNUSEDs. (Conrad Meyer)
- storage: Introduce virStoragePoolSaveConfig (John Ferlan)
- storage: Don't use a stack copy of the adapter (John Ferlan)
- bhyvexml2argv: Add test for grub console support (Conrad Meyer)
- bhyve: Add console support for grub-bhyve bootloader (Conrad Meyer)
- bhyve: Probe grub-bhyve for --cons-dev capability (Conrad Meyer)
- bhyvexml2argv: Add tests for domain-configured bootloader, args (Conrad Meyer)
- domaincommon.rng: Add 'bootloader' to os=hvm schema for Bhyve (Conrad Meyer)
- bhyvexml2argv: Add loader argv tests. (Conrad Meyer)
- bhyve: Support /domain/bootloader configuration for non-FreeBSD guests. (Conrad Meyer)
- Display nicer error message for unsupported chardev hotplug (Ján Tomko)
- virsh: Add bps_max and friends to virsh (Matthias Gatto)
- qemu: Add bps_max and friends to qemu command generation (Matthias Gatto)
- qemu: Add bps_max and friends QMP suport (Matthias Gatto)
- qemu: Add bps_max and friends qemu driver (Matthias Gatto)
- qemu: Add Qemu capability for bps_max and friends (Matthias Gatto)
- qemu: Modify the structure _virDomainBlockIoTuneInfo. (Matthias Gatto)
- cpu_conf: Allow specification of 'units' for @memory on numa nodes. (Prerna Saxena)
- conf: Expose virDomainParseMemory for use outside domain_conf (Prerna Saxena)
- esx: Simplify VI (vSphere) API and VMware product version handling (Matthias Bolte)
- domain_conf: Use virDomainParseMemory more widely (Michal Privoznik)
- Transform VIR_ERROR into VIR_WARN in detect_scsi_host_caps (Cédric Bosdonnat)
- vbox: Remove useless condition branches (Martin Kletzander)
- Remove use of networkPrivateData from netcf driver (Daniel P. Berrange)
- Remove use of networkPrivateData from network driver (Daniel P. Berrange)
- Remove use of storagePrivateData from storage driver (Daniel P. Berrange)
- Update Test driver to always use privateData (Daniel P. Berrange)
- Update Parallels driver to always use privateData (Daniel P. Berrange)
- Remove abuse of networkPrivateData in phyp driver (Daniel P. Berrange)
- Move phyp internal info out of the header file (Daniel P. Berrange)
- Update Hyper-V driver to always use privateData (Daniel P. Berrange)
- Update ESX driver to always use privateData (Daniel P. Berrange)
- Update remote driver to always use privateData (Daniel P. Berrange)
- Clean up remote driver connection open code (Daniel P. Berrange)
- Test: Add a testcase for PowerPC compat mode cpu specification. (Prerna Saxena)
- PowerPC:Improve PVR handling to fall back to cpu generation. (Prerna Saxena)
- PowerPC : Add support for launching VM in 'compat' mode. (Prerna Saxena)
- Cpu: Add support for Power LE Architecture. (Prerna Saxena)
- gitignore: use wildcard for configure's temporary files (Martin Kletzander)
- virnetdevbandwidth: Include virutil.h (Michal Privoznik)
- qemu: Allow use of iothreads for virtio ccw disk definitions (Boris Fiuczynski)
- qemu: Correct disk type checking logic for iothreads (Boris Fiuczynski)
- virsh: fix net-dhcp-leases no output in quiet mode (Luyao Huang)
- numa: split util/ and conf/ and support non-contiguous nodesets (Martin Kletzander)
- add temporary compilation files into .gitignore (Martin Kletzander)
- Iface: disallow network tuning in session mode globally (Erik Skultety)
- qemu: revert patch - bandwidth tuning in session mode (Erik Skultety)
- private.syms: Export virDomainNumatuneSpecifiedMaxNode (Michal Privoznik)
- virnuma: Add some more comments (Michal Privoznik)
- Memory: Use consistent type for all memory elements. (Prerna Saxena)
- virnuma: use virNumaNodesetIsAvailable checking nodeset in virNumaSetupMemoryPolicy (Chen Fan)
- numatune: add check for numatune nodeset range (Chen Fan)
- bitmap: add virBitmapLastSetBit for finding the last bit position of bitmap (Chen Fan)
- virsh: don't list unknown domains (Martin Kletzander)
- lxc: improve error message for invalid blkiotune settings (Martin Kletzander)
- qemu: improve error message for invalid blkiotune settings (Martin Kletzander)
- util: Introduce virPidFileForceCleanupPath (Martin Kletzander)
Cleanup:
- Remove left over debug in hvsupport.pl script (Daniel P. Berrange)
Thanks everybody for your contributions for this release, be it with
reports, patches, dicussions, documentation fixes, etc. !
Daniel
--
Daniel Veillard | Open Source and Standards, Red Hat
veillard(a)redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | virtualization library http://libvirt.org/
9 years, 11 months
[libvirt] [PATCH v3] network: Bring netdevs online later
by Matthew Rosato
Currently, MAC registration occurs during device creation, which is
early enough that, during live migration, you end up with duplicate
MAC addresses on still-running source and target devices, even though
the target device isn't actually being used yet.
This patch proposes to defer MAC registration until right before
the guest can actually use the device -- In other words, right
before starting guest CPUs.
Signed-off-by: Matthew Rosato <mjrosato(a)linux.vnet.ibm.com>
---
Associated BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1081461
Changes for v3:
* Some minor formatting fixes.
* in qemuNetworkIfaceConnect, set VIR_NETDEV_TAP_CREATE_IFUP
unconditionally.
* in qemuDomainAttachNetDevice, call qemuInterfaceStartDevice only for
VIR_DOMAIN_NET_TYPE_DIRECT, _BRIDGE and _NETWORK.
* in qemuProcessStartCPUs, use 'reason' to determine whether or not
qemuInterfaceStartDevices needs to be called. Basically, it needs
to be called for any reason that the system would be initializing
(or re-initializing).
src/Makefile.am | 3 +-
src/conf/domain_conf.h | 2 ++
src/lxc/lxc_process.c | 4 ++-
src/qemu/qemu_command.c | 3 ++
src/qemu/qemu_hotplug.c | 8 +++++
src/qemu/qemu_interface.c | 78 +++++++++++++++++++++++++++++++++++++++++++
src/qemu/qemu_interface.h | 32 ++++++++++++++++++
src/qemu/qemu_process.c | 7 ++++
src/util/virnetdevmacvlan.c | 8 +++--
src/util/virnetdevmacvlan.h | 2 ++
10 files changed, 142 insertions(+), 5 deletions(-)
create mode 100644 src/qemu/qemu_interface.c
create mode 100644 src/qemu/qemu_interface.h
diff --git a/src/Makefile.am b/src/Makefile.am
index fa741a8..035120e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -703,7 +703,8 @@ QEMU_DRIVER_SOURCES = \
qemu/qemu_monitor_text.h \
qemu/qemu_monitor_json.c \
qemu/qemu_monitor_json.h \
- qemu/qemu_driver.c qemu/qemu_driver.h
+ qemu/qemu_driver.c qemu/qemu_driver.h \
+ qemu/qemu_interface.c qemu/qemu_interface.h
XENAPI_DRIVER_SOURCES = \
xenapi/xenapi_driver.c xenapi/xenapi_driver.h \
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 0862bd7..5f328cf 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -951,6 +951,8 @@ struct _virDomainNetDef {
virNetDevBandwidthPtr bandwidth;
virNetDevVlan vlan;
int linkstate;
+ /* vmOp value saved if deferring interface start */
+ virNetDevVPortProfileOp vmOp;
};
/* Used for prefix of ifname of any network name generated dynamically
diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
index ed30c37..b2256c0 100644
--- a/src/lxc/lxc_process.c
+++ b/src/lxc/lxc_process.c
@@ -300,6 +300,7 @@ char *virLXCProcessSetupInterfaceDirect(virConnectPtr conn,
virNetDevBandwidthPtr bw;
virNetDevVPortProfilePtr prof;
virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver);
+ unsigned int macvlan_create_flags = VIR_NETDEV_MACVLAN_CREATE_IFUP;
/* XXX how todo bandwidth controls ?
* Since the 'net-ifname' is about to be moved to a different
@@ -336,7 +337,8 @@ char *virLXCProcessSetupInterfaceDirect(virConnectPtr conn,
&res_ifname,
VIR_NETDEV_VPORT_PROFILE_OP_CREATE,
cfg->stateDir,
- virDomainNetGetActualBandwidth(net), 0) < 0)
+ virDomainNetGetActualBandwidth(net),
+ macvlan_create_flags) < 0)
goto cleanup;
ret = res_ifname;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index e5270bd..229dff4 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -199,6 +199,9 @@ qemuPhysIfaceConnect(virDomainDefPtr def,
net->ifname = res_ifname;
}
+ /* Save vport profile op for later */
+ net->vmOp = vmop;
+
virObjectUnref(cfg);
return rc;
}
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 7bc19cd..530e6da 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -30,6 +30,7 @@
#include "qemu_domain.h"
#include "qemu_command.h"
#include "qemu_hostdev.h"
+#include "qemu_interface.h"
#include "domain_audit.h"
#include "domain_nwfilter.h"
#include "virlog.h"
@@ -922,6 +923,8 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
priv->qemuCaps, tapfd, &tapfdSize) < 0)
goto cleanup;
iface_connected = true;
+ /* Set device online immediately */
+ qemuInterfaceStartDevice(net);
if (qemuOpenVhostNet(vm->def, net, priv->qemuCaps, vhostfd, &vhostfdSize) < 0)
goto cleanup;
} else if (actualType == VIR_DOMAIN_NET_TYPE_DIRECT) {
@@ -937,6 +940,8 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
VIR_NETDEV_VPORT_PROFILE_OP_CREATE)) < 0)
goto cleanup;
iface_connected = true;
+ /* Set device online immediately */
+ qemuInterfaceStartDevice(net);
if (qemuOpenVhostNet(vm->def, net, priv->qemuCaps, vhostfd, &vhostfdSize) < 0)
goto cleanup;
} else if (actualType == VIR_DOMAIN_NET_TYPE_ETHERNET) {
@@ -2070,6 +2075,9 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
goto cleanup;
}
+ /* Set device online immediately */
+ qemuInterfaceStartDevice(newdev);
+
newType = virDomainNetGetActualType(newdev);
if (newType == VIR_DOMAIN_NET_TYPE_HOSTDEV) {
diff --git a/src/qemu/qemu_interface.c b/src/qemu/qemu_interface.c
new file mode 100644
index 0000000..dccfcc4
--- /dev/null
+++ b/src/qemu/qemu_interface.c
@@ -0,0 +1,78 @@
+/*
+ * qemu_interface.c: QEMU interface management
+ *
+ * Copyright IBM Corp. 2014
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Authors:
+ * Matthew J. Rosato <mjrosato(a)linux.vnet.ibm.com>
+ */
+
+#include <config.h>
+
+#include "qemu_interface.h"
+#include "virnetdev.h"
+#include "virnetdevtap.h"
+#include "virnetdevmacvlan.h"
+#include "virnetdevvportprofile.h"
+
+/**
+ * qemuInterfaceStartDevice:
+ * @net: net device to start
+ *
+ * Based upon the type of device provided, perform the appropriate
+ * work to set the device online.
+ */
+void
+qemuInterfaceStartDevice(virDomainNetDefPtr net)
+{
+ switch (virDomainNetGetActualType(net)) {
+ case VIR_DOMAIN_NET_TYPE_BRIDGE:
+ case VIR_DOMAIN_NET_TYPE_NETWORK:
+ if (virNetDevSetOnline(net->ifname, true) < 0) {
+ ignore_value(virNetDevTapDelete(net->ifname));
+ }
+ break;
+ case VIR_DOMAIN_NET_TYPE_DIRECT:
+ if (virNetDevSetOnline(net->ifname, true) < 0) {
+ ignore_value(virNetDevVPortProfileDisassociate(net->ifname,
+ virDomainNetGetActualVirtPortProfile(net),
+ &net->mac,
+ virDomainNetGetActualDirectDev(net),
+ -1,
+ net->vmOp));
+ }
+ break;
+ }
+}
+
+/**
+ * qemuInterfaceStartDevices:
+ * @def: domain definition
+ *
+ * Set all ifaces associated with this domain to the online state.
+ */
+void
+qemuInterfaceStartDevices(virDomainDefPtr def)
+{
+ size_t i;
+
+ for (i = 0; i < def->nnets; i++) {
+ qemuInterfaceStartDevice(def->nets[i]);
+ }
+
+ return;
+}
diff --git a/src/qemu/qemu_interface.h b/src/qemu/qemu_interface.h
new file mode 100644
index 0000000..5810cda
--- /dev/null
+++ b/src/qemu/qemu_interface.h
@@ -0,0 +1,32 @@
+/*
+ * qemu_interface.h: QEMU interface management
+ *
+ * Copyright IBM Corp. 2014
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Authors:
+ * Matthew J. Rosato <mjrosato(a)linux.vnet.ibm.com>
+ */
+
+#ifndef __QEMU_INTERFACE_H__
+# define __QEMU_INTERFACE_H__
+
+# include "domain_conf.h"
+
+void qemuInterfaceStartDevice(virDomainNetDefPtr net);
+void qemuInterfaceStartDevices(virDomainDefPtr def);
+
+#endif /* __QEMU_INTERFACE_H__ */
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index f391743..3fc50a0 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -42,6 +42,7 @@
#include "qemu_hostdev.h"
#include "qemu_hotplug.h"
#include "qemu_migration.h"
+#include "qemu_interface.h"
#include "cpu/cpu.h"
#include "datatypes.h"
@@ -2947,6 +2948,12 @@ qemuProcessStartCPUs(virQEMUDriverPtr driver, virDomainObjPtr vm,
qemuDomainObjPrivatePtr priv = vm->privateData;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
+ /* Bring up netdevs before starting CPUs */
+ if (reason != VIR_DOMAIN_RUNNING_UNPAUSED &&
+ reason != VIR_DOMAIN_RUNNING_SAVE_CANCELED) {
+ qemuInterfaceStartDevices(vm->def);
+ }
+
VIR_DEBUG("Using lock state '%s'", NULLSTR(priv->lockState));
if (virDomainLockProcessResume(driver->lockManager, cfg->uri,
vm, priv->lockState) < 0) {
diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c
index c83341c..1edf3ae 100644
--- a/src/util/virnetdevmacvlan.c
+++ b/src/util/virnetdevmacvlan.c
@@ -902,9 +902,11 @@ int virNetDevMacVLanCreateWithVPortProfile(const char *tgifname,
goto link_del_exit;
}
- if (virNetDevSetOnline(cr_ifname, true) < 0) {
- rc = -1;
- goto disassociate_exit;
+ if (flags & VIR_NETDEV_MACVLAN_CREATE_IFUP) {
+ if (virNetDevSetOnline(cr_ifname, true) < 0) {
+ rc = -1;
+ goto disassociate_exit;
+ }
}
if (flags & VIR_NETDEV_MACVLAN_CREATE_WITH_TAP) {
diff --git a/src/util/virnetdevmacvlan.h b/src/util/virnetdevmacvlan.h
index 41aa4e2..41b4014 100644
--- a/src/util/virnetdevmacvlan.h
+++ b/src/util/virnetdevmacvlan.h
@@ -44,6 +44,8 @@ typedef enum {
VIR_NETDEV_MACVLAN_CREATE_NONE = 0,
/* Create with a tap device */
VIR_NETDEV_MACVLAN_CREATE_WITH_TAP = 1 << 0,
+ /* Bring the interface up */
+ VIR_NETDEV_MACVLAN_CREATE_IFUP = 1 << 1,
} virNetDevMacVLanCreateFlags;
int virNetDevMacVLanCreate(const char *ifname,
--
1.7.9.5
9 years, 11 months
[libvirt] [PATCH] Avoid getting '-1:-1' in devices cgroup list
by Cédric Bosdonnat
When calling virCgroupAllowAllDevices we get these invalid entries
in the device cgroup config.
b -1:-1 rw
c -1:-1 rw
Check for positive values before outputting the major and minor to
avoid that.
---
src/util/vircgroup.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index 166f4dc..3995477 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -2767,11 +2767,11 @@ virCgroupAllowDevice(virCgroupPtr group, char type, int major, int minor,
char *minorstr = NULL;
if ((major < 0 && VIR_STRDUP(majorstr, "*") < 0) ||
- virAsprintf(&majorstr, "%i", major) < 0)
+ (major >= 0 && virAsprintf(&majorstr, "%i", major) < 0))
goto cleanup;
if ((minor < 0 && VIR_STRDUP(minorstr, "*") < 0) ||
- virAsprintf(&minorstr, "%i", minor) < 0)
+ (minor >= 0 && virAsprintf(&minorstr, "%i", minor) < 0))
goto cleanup;
if (virAsprintf(&devstr, "%c %s:%s %s", type, majorstr, minorstr,
--
2.1.2
9 years, 11 months
[libvirt] [PATCH libvirt-python] Add c_pointer method to classes.
by Richard W.M. Jones
This returns the raw C pointer to the underlying object, eg:
conn = libvirt.open(None)
print "0x%x" % conn.c_pointer() # returns virConnectPtr of the connection
dom = conn.lookupByName("test")
print "0x%x" % dom.c_pointer() # returns virDomainPtr of the domain
The reason behind this is to allow us to transparently pass Python dom
objects through the libguestfs Python API.
https://bugzilla.redhat.com/show_bug.cgi?id=1075164
---
generator.py | 32 ++++++++++++++++++++++++++++++++
sanitytest.py | 2 ++
2 files changed, 34 insertions(+)
diff --git a/generator.py b/generator.py
index 20df54f..cf044c9 100755
--- a/generator.py
+++ b/generator.py
@@ -821,6 +821,27 @@ def print_function_wrapper(module, name, output, export, include):
return 0
return 1
+def print_c_pointer(classname, output, export, include):
+ output.write("PyObject *\n")
+ output.write("libvirt_%s_pointer(PyObject *self ATTRIBUTE_UNUSED, PyObject *args)\n" % classname)
+ output.write("{\n")
+ output.write(" %sPtr ptr;\n" % classname)
+ output.write(" PyObject *pyptr;\n")
+ output.write(" PyObject *pylong;\n")
+ output.write("\n")
+ output.write(" if (!PyArg_ParseTuple(args, (char *) \"O\", &pyptr))\n")
+ output.write(" return NULL;\n")
+ output.write(" ptr = (%sPtr) Py%s_Get(pyptr);\n" % (classname, classname))
+ output.write(" pylong = PyLong_FromVoidPtr(ptr);\n")
+ output.write(" return pylong;\n")
+ output.write("}\n")
+ output.write("\n")
+
+ include.write("PyObject *libvirt_%s_pointer(PyObject *self, PyObject *args);\n" % classname)
+
+ export.write(" { (char *)\"%s_pointer\", libvirt_%s_pointer, METH_VARARGS, NULL },\n" %
+ (classname, classname))
+
def buildStubs(module, api_xml):
global py_types
global py_return_types
@@ -917,6 +938,12 @@ def buildStubs(module, api_xml):
del funcs[function]
if ret == 1:
nb_wrap = nb_wrap + 1
+
+ if module == "libvirt":
+ # Write C pointer conversion functions.
+ for classname in primary_classes:
+ print_c_pointer(classname, wrapper, export, include)
+
include.close()
export.close()
wrapper.close()
@@ -1496,6 +1523,11 @@ def buildWrappers(module):
classes.write(" def domain(self):\n")
classes.write(" return self._dom\n\n")
+ classes.write(" def c_pointer(self):\n")
+ classes.write(" \"\"\"Get C pointer to underlying object\"\"\"\n")
+ classes.write(" return libvirtmod.%s_pointer(self._o)\n\n" %
+ classname)
+
flist = function_classes[classname]
flist.sort(key=functionSortKey)
oldfile = ""
diff --git a/sanitytest.py b/sanitytest.py
index f5337fc..9907f3d 100644
--- a/sanitytest.py
+++ b/sanitytest.py
@@ -109,6 +109,8 @@ for klassname in gottypes:
for name in dir(klassobj):
if name[0] == '_':
continue
+ if name == 'c_pointer':
+ continue
thing = getattr(klassobj, name)
if callable(thing):
gotfunctions[klassname].append(name)
--
2.1.0
9 years, 11 months
[libvirt] Waiting for review of [PATCH v2 2/21] hyperv: implementation of virConnectGetVersion
by Yves Vinter
Hi All,
As I described the 27th of October in the following thread:
https://www.redhat.com/archives/libvir-list/2014-October/msg00840.html
[libvirt] [PATCH v2 0/21] hyperv: hyperv: set of new functionalities
new functionalities has been implemented in the libvirt hyperv driver as a set of 21 patches.
PATCH 01/21: hyperv: avoid query memleaks on failure
PATCH 02/21: hyperv: implementation of virConnectGetVersion
PATCH 03/21: hyperv: implementation of virConnectGetCapabilities
PATCH 04/21: hyperv: implementation of virDomainGetVcpus and virConnectGetMaxVcpus
PATCH 05/21: hyperv: implementation of virNodeGetFreeMemory
PATCH 06/21: hyperv: implementation of virDomainShutdown and virDomainShutdownFlags
PATCH 07/21: hyperv: implementation of virDomainGetSchedulerType and virDomainGetSchedulerParameters
PATCH 08/21: hyperv: implementation of virNetworkLookupByName
PATCH 09/21: hyperv: implementation of virNetworkGetXMLDesc
PATCH 10/21: hyperv: implementation of virConnectNumOfNetworks and virConnectListNetworks
PATCH 11/21: hyperv: implementation of virConnectNumOfDefinedNetworks and virConnectListDefinedNetworks
PATCH 12/21: hyperv: implementation of hypervInvokeMethod to handle complex parameters
PATCH 13/21: hyperv: implementation of virDomainSetAutostart and virDomainGetAutostart
PATCH 14/21: hyperv: implementation of virDomainSetMaxMemory
PATCH 15/21: hyperv: implementation of virDomainSetMemory and virDomainSetMemoryFlags
PATCH 16/21: hyperv: implementation of virDomainSetVcpus and virDomainSetVcpusFlags
PATCH 17/21: hyperv: implementation of virDomainUndefine and virDomainUndefineFlags
PATCH 18/21: hyperv: implementation of internal function hypervDomainAttachDisk
PATCH 19/21: hyperv: implementation of internal function hypervDomainAttachNetwork
PATCH 20/21: hyperv: implementation of virDomainAttachDevice and virDomainAttachDeviceFlags
PATCH 21/21: hyperv: implementation of virDomainDefineXML and virDomainCreateXML
A first version of this set has been submitted the 8th of October.
The first 3 patches have been already reviewed by Eric and the first patch has been pushed in the main stream.
Based on the remarks after this 3 reviews, I will produce a V2 for the whole set of patches.
It will be more convenient for me to submit V2 versions patch after patch, only after the previous one has been approved and pushed in the main branch.
The V2 of patch 02/21 has been submitted the 27th of October here:
https://www.redhat.com/archives/libvir-list/2014-October/msg00824.html
[libvirt] [PATCH v2 2/21] hyperv: implementation of virConnectGetVersion
I've not received any feedback since, and it has not been pushed in the main stream.
Is there any issue?
I'm still waiting for its approval before submitting the next patch...
Thanks for you answer,
Yves.
9 years, 11 months
[libvirt] [PATCH] capabilities: Format <domain/> properly
by Michal Privoznik
The <domain/> element under /capabilities/guest/arch/ can have no
child elements. If that's the case we format:
<domain type='xen'>
</domain>
instead of simpler:
<domain type='xen'/>
This commit fixes that.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/conf/capabilities.c | 9 ++++++-
tests/capabilityschemadata/caps-qemu-kvm.xml | 36 ++++++++++------------------
tests/capabilityschemadata/caps-test.xml | 6 ++---
tests/capabilityschemadata/caps-test2.xml | 6 ++---
tests/xencapsdata/xen-i686-pae-hvm.xml | 6 ++---
tests/xencapsdata/xen-i686-pae.xml | 3 +--
tests/xencapsdata/xen-i686.xml | 3 +--
tests/xencapsdata/xen-ia64-be-hvm.xml | 6 ++---
tests/xencapsdata/xen-ia64-be.xml | 3 +--
tests/xencapsdata/xen-ia64-hvm.xml | 6 ++---
tests/xencapsdata/xen-ia64.xml | 3 +--
tests/xencapsdata/xen-ppc64.xml | 3 +--
tests/xencapsdata/xen-x86_64-hvm.xml | 9 +++----
tests/xencapsdata/xen-x86_64.xml | 3 +--
14 files changed, 39 insertions(+), 63 deletions(-)
diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c
index 37d19c1..6c11a7f 100644
--- a/src/conf/capabilities.c
+++ b/src/conf/capabilities.c
@@ -969,8 +969,15 @@ virCapabilitiesFormatXML(virCapsPtr caps)
}
for (j = 0; j < caps->guests[i]->arch.ndomains; j++) {
- virBufferAsprintf(&buf, "<domain type='%s'>\n",
+ virBufferAsprintf(&buf, "<domain type='%s'",
caps->guests[i]->arch.domains[j]->type);
+ if (!caps->guests[i]->arch.domains[j]->info.emulator &&
+ !caps->guests[i]->arch.domains[j]->info.loader &&
+ !caps->guests[i]->arch.domains[j]->info.nmachines) {
+ virBufferAddLit(&buf, "/>\n");
+ continue;
+ }
+ virBufferAddLit(&buf, ">\n");
virBufferAdjustIndent(&buf, 2);
if (caps->guests[i]->arch.domains[j]->info.emulator)
virBufferAsprintf(&buf, "<emulator>%s</emulator>\n",
diff --git a/tests/capabilityschemadata/caps-qemu-kvm.xml b/tests/capabilityschemadata/caps-qemu-kvm.xml
index 55faa16..7055c7a 100644
--- a/tests/capabilityschemadata/caps-qemu-kvm.xml
+++ b/tests/capabilityschemadata/caps-qemu-kvm.xml
@@ -39,8 +39,7 @@
<machine canonical='pc-0.11' maxCpus='255'>pc</machine>
<machine maxCpus='255'>pc-0.10</machine>
<machine maxCpus='1'>isapc</machine>
- <domain type='qemu'>
- </domain>
+ <domain type='qemu'/>
<domain type='kvm'>
<emulator>/usr/bin/qemu-kvm</emulator>
<machine maxCpus='255'>pc-0.11</machine>
@@ -66,8 +65,7 @@
<machine canonical='pc-0.11'>pc</machine>
<machine>pc-0.10</machine>
<machine>isapc</machine>
- <domain type='qemu'>
- </domain>
+ <domain type='qemu'/>
<domain type='kvm'>
<emulator>/usr/bin/qemu-kvm</emulator>
<machine>pc-0.11</machine>
@@ -108,8 +106,7 @@
<machine>realview</machine>
<machine>versatilepb</machine>
<machine>versatileab</machine>
- <domain type='qemu'>
- </domain>
+ <domain type='qemu'/>
</arch>
</guest>
@@ -119,8 +116,7 @@
<wordsize>64</wordsize>
<emulator>/usr/bin/qemu-system-aarch64</emulator>
<machine>machvirt</machine>
- <domain type='qemu'>
- </domain>
+ <domain type='qemu'/>
</arch>
</guest>
@@ -131,8 +127,7 @@
<emulator>/usr/bin/qemu-system-microblaze</emulator>
<machine>petalogix-s3adsp1800</machine>
<machine>microblaze-fdt</machine>
- <domain type='qemu'>
- </domain>
+ <domain type='qemu'/>
</arch>
</guest>
@@ -143,8 +138,7 @@
<emulator>/usr/bin/qemu-system-microblazeel</emulator>
<machine>petalogix-s3adsp1800</machine>
<machine>microblaze-fdt</machine>
- <domain type='qemu'>
- </domain>
+ <domain type='qemu'/>
</arch>
</guest>
@@ -158,8 +152,7 @@
<machine>magnum</machine>
<machine>pica61</machine>
<machine>mips</machine>
- <domain type='qemu'>
- </domain>
+ <domain type='qemu'/>
</arch>
</guest>
@@ -173,8 +166,7 @@
<machine>magnum</machine>
<machine>pica61</machine>
<machine>mips</machine>
- <domain type='qemu'>
- </domain>
+ <domain type='qemu'/>
</arch>
</guest>
@@ -195,8 +187,7 @@
<machine>SS-1000</machine>
<machine>SS-2000</machine>
<machine>SS-2</machine>
- <domain type='qemu'>
- </domain>
+ <domain type='qemu'/>
</arch>
</guest>
@@ -212,8 +203,7 @@
<machine>taihu</machine>
<machine>mac99</machine>
<machine>prep</machine>
- <domain type='qemu'>
- </domain>
+ <domain type='qemu'/>
</arch>
</guest>
@@ -223,8 +213,7 @@
<wordsize>32</wordsize>
<emulator>/usr/bin/xenner</emulator>
<machine>xenner</machine>
- <domain type='kvm'>
- </domain>
+ <domain type='kvm'/>
</arch>
<features>
<pae/>
@@ -240,8 +229,7 @@
<wordsize>64</wordsize>
<emulator>/usr/bin/xenner</emulator>
<machine>xenner</machine>
- <domain type='kvm'>
- </domain>
+ <domain type='kvm'/>
</arch>
<features>
<acpi default='on' toggle='yes'/>
diff --git a/tests/capabilityschemadata/caps-test.xml b/tests/capabilityschemadata/caps-test.xml
index 64f9bb6..da19961 100644
--- a/tests/capabilityschemadata/caps-test.xml
+++ b/tests/capabilityschemadata/caps-test.xml
@@ -43,8 +43,7 @@
<arch name='i686'>
<wordsize>32</wordsize>
<emulator>/usr/bin/test-hv</emulator>
- <domain type='test'>
- </domain>
+ <domain type='test'/>
</arch>
<features>
<pae/>
@@ -57,8 +56,7 @@
<arch name='i686'>
<wordsize>32</wordsize>
<emulator>/usr/bin/test-hv</emulator>
- <domain type='test'>
- </domain>
+ <domain type='test'/>
</arch>
<features>
<pae/>
diff --git a/tests/capabilityschemadata/caps-test2.xml b/tests/capabilityschemadata/caps-test2.xml
index a99c1b8..e676395 100644
--- a/tests/capabilityschemadata/caps-test2.xml
+++ b/tests/capabilityschemadata/caps-test2.xml
@@ -51,8 +51,7 @@
<machine>pc-0.11</machine>
<machine>pc-0.10</machine>
<machine>isapc</machine>
- <domain type='qemu'>
- </domain>
+ <domain type='qemu'/>
<domain type='kvm'>
<emulator>/usr/libexec/qemu-kvm</emulator>
<machine>pc-1.2</machine>
@@ -94,8 +93,7 @@
<machine>pc-0.11</machine>
<machine>pc-0.10</machine>
<machine>isapc</machine>
- <domain type='qemu'>
- </domain>
+ <domain type='qemu'/>
<domain type='kvm'>
<emulator>/usr/libexec/qemu-kvm</emulator>
<machine>pc-1.2</machine>
diff --git a/tests/xencapsdata/xen-i686-pae-hvm.xml b/tests/xencapsdata/xen-i686-pae-hvm.xml
index 872e5f6..cf6a1de 100644
--- a/tests/xencapsdata/xen-i686-pae-hvm.xml
+++ b/tests/xencapsdata/xen-i686-pae-hvm.xml
@@ -22,8 +22,7 @@
<wordsize>32</wordsize>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<machine>xenpv</machine>
- <domain type='xen'>
- </domain>
+ <domain type='xen'/>
</arch>
<features>
<pae/>
@@ -37,8 +36,7 @@
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<machine>xenfv</machine>
- <domain type='xen'>
- </domain>
+ <domain type='xen'/>
</arch>
<features>
<pae/>
diff --git a/tests/xencapsdata/xen-i686-pae.xml b/tests/xencapsdata/xen-i686-pae.xml
index 3dba6eb..c917fbe 100644
--- a/tests/xencapsdata/xen-i686-pae.xml
+++ b/tests/xencapsdata/xen-i686-pae.xml
@@ -22,8 +22,7 @@
<wordsize>32</wordsize>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<machine>xenpv</machine>
- <domain type='xen'>
- </domain>
+ <domain type='xen'/>
</arch>
<features>
<pae/>
diff --git a/tests/xencapsdata/xen-i686.xml b/tests/xencapsdata/xen-i686.xml
index 22d7685..5771e2b 100644
--- a/tests/xencapsdata/xen-i686.xml
+++ b/tests/xencapsdata/xen-i686.xml
@@ -19,8 +19,7 @@
<wordsize>32</wordsize>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<machine>xenpv</machine>
- <domain type='xen'>
- </domain>
+ <domain type='xen'/>
</arch>
<features>
<nonpae/>
diff --git a/tests/xencapsdata/xen-ia64-be-hvm.xml b/tests/xencapsdata/xen-ia64-be-hvm.xml
index 222de1d..19d23e9 100644
--- a/tests/xencapsdata/xen-ia64-be-hvm.xml
+++ b/tests/xencapsdata/xen-ia64-be-hvm.xml
@@ -19,8 +19,7 @@
<wordsize>64</wordsize>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<machine>xenpv</machine>
- <domain type='xen'>
- </domain>
+ <domain type='xen'/>
</arch>
<features>
<ia64_be/>
@@ -34,8 +33,7 @@
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<machine>xenfv</machine>
- <domain type='xen'>
- </domain>
+ <domain type='xen'/>
</arch>
<features>
<ia64_be/>
diff --git a/tests/xencapsdata/xen-ia64-be.xml b/tests/xencapsdata/xen-ia64-be.xml
index 017816c..78fa77e 100644
--- a/tests/xencapsdata/xen-ia64-be.xml
+++ b/tests/xencapsdata/xen-ia64-be.xml
@@ -19,8 +19,7 @@
<wordsize>64</wordsize>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<machine>xenpv</machine>
- <domain type='xen'>
- </domain>
+ <domain type='xen'/>
</arch>
<features>
<ia64_be/>
diff --git a/tests/xencapsdata/xen-ia64-hvm.xml b/tests/xencapsdata/xen-ia64-hvm.xml
index 33c4946..6e22372 100644
--- a/tests/xencapsdata/xen-ia64-hvm.xml
+++ b/tests/xencapsdata/xen-ia64-hvm.xml
@@ -19,8 +19,7 @@
<wordsize>64</wordsize>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<machine>xenpv</machine>
- <domain type='xen'>
- </domain>
+ <domain type='xen'/>
</arch>
</guest>
@@ -31,8 +30,7 @@
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<machine>xenfv</machine>
- <domain type='xen'>
- </domain>
+ <domain type='xen'/>
</arch>
<features>
<acpi default='on' toggle='yes'/>
diff --git a/tests/xencapsdata/xen-ia64.xml b/tests/xencapsdata/xen-ia64.xml
index 82ce965..9e3eaf4 100644
--- a/tests/xencapsdata/xen-ia64.xml
+++ b/tests/xencapsdata/xen-ia64.xml
@@ -19,8 +19,7 @@
<wordsize>64</wordsize>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<machine>xenpv</machine>
- <domain type='xen'>
- </domain>
+ <domain type='xen'/>
</arch>
</guest>
diff --git a/tests/xencapsdata/xen-ppc64.xml b/tests/xencapsdata/xen-ppc64.xml
index 91401b9..0132c45 100644
--- a/tests/xencapsdata/xen-ppc64.xml
+++ b/tests/xencapsdata/xen-ppc64.xml
@@ -19,8 +19,7 @@
<wordsize>64</wordsize>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<machine>xenpv</machine>
- <domain type='xen'>
- </domain>
+ <domain type='xen'/>
</arch>
</guest>
diff --git a/tests/xencapsdata/xen-x86_64-hvm.xml b/tests/xencapsdata/xen-x86_64-hvm.xml
index 8de8cf4..7458f0b 100644
--- a/tests/xencapsdata/xen-x86_64-hvm.xml
+++ b/tests/xencapsdata/xen-x86_64-hvm.xml
@@ -22,8 +22,7 @@
<wordsize>64</wordsize>
<emulator>/usr/lib64/xen/bin/qemu-dm</emulator>
<machine>xenpv</machine>
- <domain type='xen'>
- </domain>
+ <domain type='xen'/>
</arch>
</guest>
@@ -34,8 +33,7 @@
<emulator>/usr/lib64/xen/bin/qemu-dm</emulator>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<machine>xenfv</machine>
- <domain type='xen'>
- </domain>
+ <domain type='xen'/>
</arch>
<features>
<pae/>
@@ -52,8 +50,7 @@
<emulator>/usr/lib64/xen/bin/qemu-dm</emulator>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<machine>xenfv</machine>
- <domain type='xen'>
- </domain>
+ <domain type='xen'/>
</arch>
<features>
<acpi default='on' toggle='yes'/>
diff --git a/tests/xencapsdata/xen-x86_64.xml b/tests/xencapsdata/xen-x86_64.xml
index 0c3279b..b686432 100644
--- a/tests/xencapsdata/xen-x86_64.xml
+++ b/tests/xencapsdata/xen-x86_64.xml
@@ -22,8 +22,7 @@
<wordsize>64</wordsize>
<emulator>/usr/lib64/xen/bin/qemu-dm</emulator>
<machine>xenpv</machine>
- <domain type='xen'>
- </domain>
+ <domain type='xen'/>
</arch>
</guest>
--
2.0.4
9 years, 11 months
[libvirt] [PATCH 0/3] parallels: a set of fixes for nova
by Dmitry Guryanov
Hello,
This 3 patches fix different things, used by nova.
Dmitry Guryanov (3):
parallels: support NULL virDomainVideoAccelDefPtr
parallels: set format for real disk devices
parallels: use disk name to set disk index
src/parallels/parallels_sdk.c | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
--
1.9.3
9 years, 11 months
[libvirt] [PATCH v3] qemu: avoid rare race when undefining domain
by Martin Kletzander
When one domain is being undefined and at the same time started, for
example, there is a possibility of a rare problem occuring.
- Thread 1 does virDomainUndefine(), has the lock, checks that the
domain is active and because it's not, calls
virDomainObjListRemove().
- Thread 2 does virDomainCreate() and tries to lock the domain.
- Thread 1 needs to lock domain list in order to remove the domain from
it, but must unlock domain first (proper order is to lock domain list
first and the domain itself second).
- Thread 2 grabs the lock, starts the domain and releases the lock.
- Thread 1 grabs the lock and removes the domain from list.
With this patch:
- The undefining domain gets marked as "to undefine" before it is
unlocked.
- If domain is found in any of the search APIs, it's returned only if
it is not marked as "to undefine". The check is done while the
domain is locked.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1150505
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
Notes:
I marked this as v3, but it is basically a resend of v1 [1] with
s/undefining/removing/ change. I'm sending this even though the second
version of the patch got in again because the v2 that we pushed didn't
help. I got convinced [2] that doing this with a job fixes it, but it
doesn't, it just serializes the Create API after the Undefine API. The
only difference that the commit b629c64e [3] does is that it waits on
obtaining job, but not on locking the domain. That previous commit can
be reverted if anyone wants, I see almost no point in it being there
now.
[1] http://www.redhat.com/archives/libvir-list/2014-October/msg01055.html
[2] http://www.redhat.com/archives/libvir-list/2014-October/msg01115.html
[3] http://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=b629c64e
src/conf/domain_conf.c | 22 +++++++++++++++++++---
src/conf/domain_conf.h | 1 +
2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index ec45b8c..8e08407 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1062,8 +1062,13 @@ virDomainObjPtr virDomainObjListFindByID(virDomainObjListPtr doms,
virDomainObjPtr obj;
virObjectLock(doms);
obj = virHashSearch(doms->objs, virDomainObjListSearchID, &id);
- if (obj)
+ if (obj) {
virObjectLock(obj);
+ if (obj->removing) {
+ virObjectUnlock(obj);
+ obj = NULL;
+ }
+ }
virObjectUnlock(doms);
return obj;
}
@@ -1079,8 +1084,13 @@ virDomainObjPtr virDomainObjListFindByUUID(virDomainObjListPtr doms,
virUUIDFormat(uuid, uuidstr);
obj = virHashLookup(doms->objs, uuidstr);
- if (obj)
+ if (obj) {
virObjectLock(obj);
+ if (obj->removing) {
+ virObjectUnlock(obj);
+ obj = NULL;
+ }
+ }
virObjectUnlock(doms);
return obj;
}
@@ -1105,8 +1115,13 @@ virDomainObjPtr virDomainObjListFindByName(virDomainObjListPtr doms,
virDomainObjPtr obj;
virObjectLock(doms);
obj = virHashSearch(doms->objs, virDomainObjListSearchName, name);
- if (obj)
+ if (obj) {
virObjectLock(obj);
+ if (obj->removing) {
+ virObjectUnlock(obj);
+ obj = NULL;
+ }
+ }
virObjectUnlock(doms);
return obj;
}
@@ -2551,6 +2566,7 @@ void virDomainObjListRemove(virDomainObjListPtr doms,
{
char uuidstr[VIR_UUID_STRING_BUFLEN];
+ dom->removing = true;
virUUIDFormat(dom->def->uuid, uuidstr);
virObjectRef(dom);
virObjectUnlock(dom);
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index e10b3c5..75e3d2a 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2187,6 +2187,7 @@ struct _virDomainObj {
unsigned int autostart : 1;
unsigned int persistent : 1;
unsigned int updated : 1;
+ unsigned int removing : 1;
virDomainDefPtr def; /* The current definition */
virDomainDefPtr newDef; /* New definition to activate at shutdown */
--
2.2.0
9 years, 11 months
[libvirt] [PATCH] qemu: Allow system pages to <memoryBacking/>
by Michal Privoznik
It occurred to me that OpenStack uses the following XML when not using
regular huge pages:
<memoryBacking>
<hugepages>
<page size='4' unit='KiB'/>
</hugepages>
</memoryBacking>
However, since we are expecting to see huge pages only, we fail to
startup the domain with following error:
libvirtError: internal error: Unable to find any usable hugetlbfs
mount for 4 KiB
While regular system pages are not huge pages technically, our code is
prepared for that and if it helps OpenStack (or other management
applications) we should cope with that.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_command.c | 84 +++++++++++++---------
.../qemuxml2argv-hugepages-pages6.args | 4 ++
.../qemuxml2argv-hugepages-pages6.xml | 32 +++++++++
tests/qemuxml2argvtest.c | 1 +
4 files changed, 87 insertions(+), 34 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages6.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages6.xml
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 48bdf4e..c44560f 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -6616,6 +6616,7 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg,
char *nodemask = NULL;
char *mem_path = NULL;
int ret = -1;
+ const long system_page_size = sysconf(_SC_PAGESIZE);
if (virDomainNumatuneHasPerNodeBinding(def->numatune) &&
!(virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_RAM) ||
@@ -6626,7 +6627,8 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg,
goto cleanup;
}
- if (def->mem.nhugepages && def->mem.hugepages[0].size &&
+ if (def->mem.nhugepages &&
+ def->mem.hugepages[0].size != system_page_size &&
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_FILE)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("huge pages per NUMA node are not "
@@ -6720,6 +6722,13 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg,
hugepage = master_hugepage;
}
+ if (hugepage && hugepage->size == system_page_size) {
+ /* However, if user specified to use "huge" page
+ * of regular system page size, it's as if they
+ * hasn't specified any huge pages at all. */
+ hugepage = NULL;
+ }
+
if (hugepage) {
/* Now lets see, if the huge page we want to use is even mounted
* and ready to use */
@@ -7882,44 +7891,51 @@ qemuBuildCommandLine(virConnectPtr conn,
def->mem.max_balloon = VIR_DIV_UP(def->mem.max_balloon, 1024) * 1024;
virCommandAddArgFormat(cmd, "%llu", def->mem.max_balloon / 1024);
if (def->mem.nhugepages && (!def->cpu || !def->cpu->ncells)) {
- char *mem_path;
+ const long system_page_size = sysconf(_SC_PAGESIZE) / 1024;
+ char *mem_path = NULL;
- if (!cfg->nhugetlbfs) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("hugetlbfs filesystem is not mounted "
- "or disabled by administrator config"));
- goto error;
- }
- if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MEM_PATH)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("hugepage backing not supported by '%s'"),
- def->emulator);
- goto error;
- }
-
- if (def->mem.hugepages[0].size) {
- for (j = 0; j < cfg->nhugetlbfs; j++) {
- if (cfg->hugetlbfs[j].size == def->mem.hugepages[0].size)
- break;
- }
-
- if (j == cfg->nhugetlbfs) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to find any usable hugetlbfs mount for %llu KiB"),
- def->mem.hugepages[0].size);
- goto error;
- }
-
- if (!(mem_path = qemuGetHugepagePath(&cfg->hugetlbfs[j])))
- goto error;
+ if (def->mem.hugepages[0].size == system_page_size) {
+ /* There is one special case: if user specified "huge"
+ * pages of regular system pages size. */
} else {
- if (!(mem_path = qemuGetDefaultHugepath(cfg->hugetlbfs,
- cfg->nhugetlbfs)))
+ if (!cfg->nhugetlbfs) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("hugetlbfs filesystem is not mounted "
+ "or disabled by administrator config"));
goto error;
+ }
+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MEM_PATH)) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("hugepage backing not supported by '%s'"),
+ def->emulator);
+ goto error;
+ }
+
+ if (def->mem.hugepages[0].size) {
+ for (j = 0; j < cfg->nhugetlbfs; j++) {
+ if (cfg->hugetlbfs[j].size == def->mem.hugepages[0].size)
+ break;
+ }
+
+ if (j == cfg->nhugetlbfs) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to find any usable hugetlbfs mount for %llu KiB"),
+ def->mem.hugepages[0].size);
+ goto error;
+ }
+
+ if (!(mem_path = qemuGetHugepagePath(&cfg->hugetlbfs[j])))
+ goto error;
+ } else {
+ if (!(mem_path = qemuGetDefaultHugepath(cfg->hugetlbfs,
+ cfg->nhugetlbfs)))
+ goto error;
+ }
}
- virCommandAddArgList(cmd, "-mem-prealloc", "-mem-path",
- mem_path, NULL);
+ virCommandAddArg(cmd, "-mem-prealloc");
+ if (mem_path)
+ virCommandAddArgList(cmd, "-mem-path", mem_path, NULL);
VIR_FREE(mem_path);
}
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages6.args b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages6.args
new file mode 100644
index 0000000..4eccb86
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages6.args
@@ -0,0 +1,4 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
+/usr/bin/qemu -S -M pc -m 1024 -mem-prealloc -smp 2 -nographic \
+-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \
+-hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages6.xml b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages6.xml
new file mode 100644
index 0000000..4f318fd
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages6.xml
@@ -0,0 +1,32 @@
+<domain type='qemu'>
+ <name>SomeDummyHugepagesGuest</name>
+ <uuid>ef1bdff4-27f3-4e85-a807-5fb4d58463cc</uuid>
+ <memory unit='KiB'>1048576</memory>
+ <currentMemory unit='KiB'>1048576</currentMemory>
+ <memoryBacking>
+ <hugepages>
+ <page size='4' unit='KiB'/>
+ </hugepages>
+ </memoryBacking>
+ <vcpu placement='static'>2</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0'/>
+ <controller type='ide' index='0'/>
+ <controller type='pci' index='0' model='pci-root'/>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 9e39068..bce88a8 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -713,6 +713,7 @@ mymain(void)
DO_TEST_FAILURE("hugepages-pages4", QEMU_CAPS_MEM_PATH,
QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_MEMORY_FILE);
DO_TEST("hugepages-pages5", QEMU_CAPS_MEM_PATH);
+ DO_TEST("hugepages-pages6", NONE);
DO_TEST("nosharepages", QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MEM_MERGE);
DO_TEST("disk-cdrom", NONE);
DO_TEST("disk-cdrom-network-http", QEMU_CAPS_KVM, QEMU_CAPS_DEVICE,
--
2.0.4
9 years, 11 months