[libvirt] [PATCH] remote: Fill remote parameters in remoteDomainListAllSnapshots()
by Peter Krempa
This patch fills the domain argument that is sent to the remote side.
This caused a client segfault as the argument was NULL.
---
src/remote/remote_driver.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 6f53264..eac50e6 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -4888,6 +4888,7 @@ remoteDomainListAllSnapshots(virDomainPtr dom,
remoteDriverLock(priv);
+ make_nonnull_domain(&args.dom, dom);
args.need_results = !!snapshots;
args.flags = flags;
--
1.7.8.6
12 years, 5 months
[libvirt] Release of libvirt-0.9.13
by Daniel Veillard
Okay the new release is out and available as uauls at
ftp://libvirt.org/libvirt/
along with rpms generated on Fedora16, the git tree is tagged too.
As suggested earlier it seems that the rate of commits is slowing
down a bit, for example it took one month an a half to accumulate the
300+ commits of this release, considering that there is uauslly a
slowdown during the summer months I plan to push the next release at
the end of August, well unless there is a lot of activities or something
urgent to push in the meantime.
This release is rather rich, quite a few features and a lot of
improvements:
Features:
- S390: support for s390(x) (Thang Pham and Viktor Mihajlovski)
- snapshot: implement new APIs for esx and vbox (Eric Blake)
- list: add virDomainListAllSnapshots API (Eric Blake)
- snapshot: new query APIs (Eric Blake)
- virsh: Allow users to reedit rejected XML (Michal Privoznik)
- nwfilter: add DHCP snooping (Stefan Berger)
- Enable driver modules in libvirt RPM (Daniel P. Berrange)
- Default to enable driver modules for libvirtd (Daniel P. Berrange)
- storage backend: Add RBD (RADOS Block Device) support (Wido den Hollander)
- sVirt support for LXC domains (Daniel P. Berrange)
Documentation:
- virsh: Cleanup virsh -V output (Doug Goldstein)
- configure: show correct default argument in help (Marc-André Lureau)
- fix typo in virDomainDestroy API doc (Christophe Fergeau)
- virsh: fix few typos on desc command (Martin Kletzander)
- virsh: Update vol-create-as manpage (Michal Privoznik)
- virsh: Tweak attach-* documentation (Michal Privoznik)
- small typo in formatdomain.html (Laine Stump)
- client rpc: Improve debug messages in virNetClientIO (Jiri Denemark)
- minor fixes to domain interface documentation (Laine Stump)
- link to FLOSS Weekly podcast, virt blogs (Eric Blake)
- examples: add consolecallback example python script (Dave Allan)
- Fix typo in comment start (Daniel P. Berrange)
- typo in acceleration element (Martin Kletzander)
- Improve docs about compiling libvirt from GIT (Daniel P. Berrange)
Portability:
- Fix compilation on older sanlock (Daniel Veillard)
- Fix unused parameters / functions in virsh on Win32 (Daniel P. Berrange)
- Update to latest GNULIB to fix compat with Mingw64 toolchain (Daniel P. Berrange)
- winsock2.h must always be included before windows.h (Daniel P. Berrange)
- Switch automated builds to use Mingw64 toolchain instead of Mingw32 (Daniel P. Berrange)
- openvz: Fix wordsize on 64 bit architectures (Guido Günther)
- Fixes for check and rpm builds without sanlock (and qemu) (Martin Kletzander)
- Fix Win32 build by linking to ole32 (Daniel P. Berrange)
- Add impl of APIs to get user directories on Win32 (Daniel P. Berrange)
- fix building error on non fedora system (Wen Congyang)
- Add stub impl of virNetlinkEventServiceLocalPid for Win32 (Daniel P. Berrange)
- Fix build when configuring with polkit0 (Jim Fehlig)
- build: fix virnetlink on glibc 2.11 (Eric Blake)
- Fix build compat with older libselinux for LXC (Daniel P. Berrange)
- build: really silence the 32-bit warning (Eric Blake)
Bug Fixes:
- build: use correct limit for unsigned long long (Eric Blake)
- nwfilter: Fix memory leak (Stefan Berger)
- network_conf: Don't free uninitialized pointers while parsing DNS SRV (Peter Krempa)
- storage: Error out if the target is already mounted for netfs pool (Osier Yang)
- events: Don't fail on registering events for two different domains (Michal Privoznik)
- Don't install systemd service files executable (Guido Günther)
- fix a bug of ref count in virnetserver.c (Hu Tao)
- Fix deadlock on libvirtd shutdown (Jim Fehlig)
- openvz: check pointer size instead of int (Guido Günther)
- domain_conf: fix possible memory leak (Martin Kletzander)
- error: Fix typos in argument checking macros (Peter Krempa)
- LXC: fix incorrect DEBUG info (Gao feng)
- LXC: fix memory leak in lxcContainerSetupExtraMounts (Gao feng)
- LXC: fix memory leak in lxcContainerGetSubtree (Gao feng)
- LXC: fix memory leak in lxcContainerMountFSBlockHelper (Gao feng)
- qemu_agent: Wait for events instead of agent response (Michal Privoznik)
- Fix launch of libvirtd when DHCP snooping support is not available. (Daniel P. Berrange)
- qemu: fix potential dead lock (Wen Congyang)
- virsh: Null terminated the string memcpy from buffer explicitly (Osier Yang)
- qemu: Fix off-by-one error while unescaping monitor strings (Peter Krempa)
- virsh: Don't generate invalid XML in attach-disk command (Peter Krempa)
- client rpc: Fix error checking after poll() (Daniel P. Berrange)
- client rpc: Send keepalive requests from IO event loop (Jiri Denemark)
- Fix typo in RPM specfile (Daniel P. Berrange)
- python: fix snapshot listing bugs (Eric Blake)
- qemu: Don't overwrite security labels (Michal Privoznik)
- rpc: Fix memleak in virNetMessageEncodeHeader (Michal Privoznik)
- Fix privileges on /var/run/libvirt directory (Daniel P. Berrange)
- Only migrate profile in non-privileged libvirtd instance (Daniel P. Berrange)
- snapshot: avoid virsh crash with older servers (Eric Blake)
- LXC: fix memory leak in lxcContainerMountFSBlockAuto (Gao feng)
- LXC: fix incorrect parameter of mount in lxcContainerMountFSBind (Gao feng)
- util: Fix deadlock in virLogReset (Jiri Denemark)
- Assign correct address type to spapr-vlan and spapr-vty. (Li Zhang)
- command: avoid potential deadlock on handshake (Eric Blake)
- qemu: better detection of crashed domains (Martin Kletzander)
- command: avoid deadlock on EPIPE situation (Eric Blake)
- Fix sync issue in virNetClientStreamEventRemoveCallback (Radu Caragea)
- qemu: avoid closing fd more than once (Wen Congyang)
- command: check for fork error before closing fd (Wen Congyang)
- fdstream: avoid double close bug (Eric Blake)
- command: avoid double close bugs (Eric Blake)
- avoid fd leak (Wen Congyang)
- avoid closing uninitialized fd (Wen Congyang)
- lxc: return correct number of CPUs (Martin Kletzander)
- leak_fix.diff (Stefan Berger)
- Fix typos in RPM dependencies (Daniel P. Berrange)
- Remove more bogus systemd service dependencies (Daniel P. Berrange)
- qemu_hotplug: Don't free the PCI device structure after hot-unplug (Peter Krempa)
- Fix potential events deadlock when unref'ing virConnectPtr (Daniel P. Berrange)
- qemu: Don't delete USB device on failed qemuPrepareHostdevUSBDevices (Michal Privoznik)
- nodeinfo: Get the correct CPU number on AMD Magny Cours platform (Osier Yang)
- nodeinfo: avoid probing host filesystem during test (Eric Blake)
Improvements:
- Remove sub-mounts under /dev when starting an LXC container (Daniel P. Berrange)
- Fix vm's outbound traffic control problem (Eiichi Tsukata)
- conf: Don't shadow error from virGetDomain() (Peter Krempa)
- maint: include ignore-value in internal.h (Peter Krempa)
- vbox: Add support for virConnectListAllDomains() (Peter Krempa)
- virsh: Add domdisplay cmd for VNC, SPICE and RDP (Doug Goldstein)
- AUTHORS: Update (Michal Privoznik)
- S390: Added sysinfo for host on s390(x). (Thang Pham)
- S390: Fixed core identification for s390 (Viktor Mihajlovski)
- S390: Fixed Parser for /proc/cpuinfo needs to be adapted for your architecture (Thang Pham)
- S390: Override QEMU_CAPS_NO_ACPI for s390x (Viktor Mihajlovski)
- storage backend rbd: Do not prefix rbd: on volume names. (Wido den Hollander)
- qemu: Improve error if setmem fails for lacking of balloon support (Osier Yang)
- Include the default listen address in the live guest XML (Daniel P. Berrange)
- storage: Introduce --inactive for pool-dumpxml (Michal Privoznik)
- storage: Switch to new def on pool-destroy (Michal Privoznik)
- Support bind mounting host files, as well as directories in LXC (Daniel J Walsh)
- Allow NOCONFIGURE=1 to make autogen.sh skip ./configure (Daniel P. Berrange)
- virsh: Use virXPath wrappers for vncdisplay cmd (Doug Goldstein)
- Add support for shared sanlock leases (Daniel P. Berrange)
- Add support for guest bind mounts with LXC (Daniel P. Berrange)
- Add support for RAM filesystems for LXC (Daniel P. Berrange)
- virsh: Improve error when trying to change vm's cpu count 0 (Peter Krempa)
- qemu: Add xhci support (Gerd Hoffmann)
- virsh: add support for virConnectListAllDomains and clean up cmdList (Peter Krempa)
- virsh: Rename namesorter to vshNameSorter and clean up indentation (Peter Krempa)
- Initialize random generator in lxc controller (Jim Fehlig)
- storage: Set the perms if the pool target already exists for fs pools (Osier Yang)
- snapshot: require existence before returning success (Eric Blake)
- drivers: Implement virListAllDomains for drivers using virDomainObj (Peter Krempa)
- Fix default USB controller for ppc64 (Dipankar Sarma)
- list: add qemu snapshot list support (Eric Blake)
- list: new helper function to collect snapshots (Eric Blake)
- list: provide RPC call for snapshots (Eric Blake)
- list: provide python bindings for snapshots (Eric Blake)
- list: use the new snapshot API in virsh when possible (Eric Blake)
- snapshot: expose new flags in virsh (Eric Blake)
- snapshot: add additional filters when getting lists (Eric Blake)
- virsh: make domiftune interface help string consistent (Martin Kletzander)
- snapshot: merge count and name collection (Eric Blake)
- snapshot: merge domain and snapshot computation (Eric Blake)
- snapshot: use metaroot node to simplify management (Eric Blake)
- conf: Add helper for listing domains on drivers supporting virDomainObj (Peter Krempa)
- conf: Store managed save image existence in virDomainObj (Peter Krempa)
- remote: implement remote protocol for virConnectListAllDomains() (Peter Krempa)
- python: add API exports for virConnectListAllDomains() (Peter Krempa)
- lib: Add public api to enable atomic listing of guest (Peter Krempa)
- Add a custom 404 error page for the website (Daniel P. Berrange)
- qemu_agent: Add some more debug prints (Michal Privoznik)
- snapshot: use new virsh function for snapshot-list (Eric Blake)
- snapshot: new virsh function factored from snapshot-list (Eric Blake)
- autogen: Always abide --system (Cole Robinson)
- Check for errors when parsing bridge interface XML (Jim Fehlig)
- Add more debug logging for libvirtd startup (Daniel P. Berrange)
- schema: Update domain XML schema (Osier Yang)
- virsh: allow the user to specify vmcore's format (Wen Congyang)
- qemu: allow the client to choose the vmcore's format (Wen Congyang)
- qemu: implement qemu's dump-guest-memory (Wen Congyang)
- Always pivot_root event if the new root source is '/' (Daniel P. Berrange)
- Improve error message diagnosing incorrect XML CPU mode (Daniel P. Berrange)
- qemu: Enable disconnecting SPICE clients without changing password (Peter Krempa)
- virsh: Report name from edited object (Michal Privoznik)
- virsh: Honor reedit opts printing to a function (Michal Privoznik)
- network: fully support/use VIR_NETWORK_XML_INACTIVE flag (Laine Stump)
- Add some missing hook functions (Daniel P. Berrange)
- server rpc: Remove APIs for manipulating filters on locked client (Jiri Denemark)
- rpc: Remove unused parameter in virKeepAliveStopInternal (Jiri Denemark)
- rpc: Do not use timer for sending keepalive responses (Jiri Denemark)
- client rpc: Separate call creation from running IO loop (Jiri Denemark)
- rpc: Add APIs for direct triggering of keepalive timer (Jiri Denemark)
- rpc: Refactor keepalive timer code (Jiri Denemark)
- client rpc: Drop unused return value of virNetClientSendNonBlock (Jiri Denemark)
- client rpc: Just queue non-blocking call if another thread has the buck (Jiri Denemark)
- client rpc: Don't drop non-blocking calls (Jiri Denemark)
- client rpc: Use event loop for writing (Jiri Denemark)
- build: fix 'make dist' on virgin checkout (Eric Blake)
- build: silence gettext warning (Eric Blake)
- openvz: wire up domainUpdateDeviceFlags (Guido Günther)
- openvz: add persist parameter to openvzSetDiskQuota (Guido Günther)
- Introduce virDomainFSIndexByName (Guido Günther)
- python: use simpler methods (Eric Blake)
- qemuProcessStop: Switch to flags (Michal Privoznik)
- snapshot: implement new APIs for qemu (Eric Blake)
- snapshot: RPC for new query APIs (Eric Blake)
- snapshot: add 'virsh snapshot-info' (Eric Blake)
- Two RPM conditional fixes for RHEL-7 (Daniel P. Berrange)
- snapshot: virsh indentation cleanup (Eric Blake)
- virsh: make tree listing more flexible (Eric Blake)
- virsh: remove limits on tree listing (Eric Blake)
- buf: support peeking at string contents (Eric Blake)
- Update AUTHORS (Osier Yang)
- LXC: Delete unused variable src in lxcContainerMountBasicFS (Gao feng)
- msg_buf_size is unsigned long not size_t (Guido Günther)
- Only check for cluster fs if we're using a filesystem (Guido Günther)
- snapshot: add virDomainSnapshotRef API (Eric Blake)
- Fix missing ) in 2 strings (Cole Robinson)
- maint: make it easier to copy FORTIFY_SOURCE snippet (Eric Blake)
- build: fix build without i18n (Eric Blake)
- spec: Build against systemd for udev (Cole Robinson)
- build: fix build of fresh checkout (Eric Blake)
- build: ensure storage driver is used (Eric Blake)
- rpc: Size up RPC limits (Michal Privoznik)
- rpc: Switch to dynamically allocated message buffer (Michal Privoznik)
- build: fix 'make distcheck' issues (Eric Blake)
- tests: Refresh qemu-1.1.0 data (Jiri Denemark)
- virsh: Back out if the argument for vol-create-as is malformed (Osier Yang)
- virsh: Accept UUID as an argument for net-info and net-start (Osier Yang)
- virsh: Accept UUID as an argument for storage commands (Osier Yang)
- Fix for parallel port passthrough for QEMU (Beat Jörg)
- util: fix "make rpm" when viratomic.h is used (Laine Stump)
- build: allow building with newer glibc-headers and -O0 (Eric Blake)
- fix make syntax-check failed (Wen Congyang)
- build: fix sc_prohibit_readlink (Eric Blake)
- file: Log closing filedescriptors (Jiri Denemark)
- command: Fix debug message during handshake (Jiri Denemark)
- virsh: Switch from generated cmd*Edit commands to nongenerated (Michal Privoznik)
- nwfilter: Add multiple IP address support to DHCP snooping (Stefan Berger)
- nwfilter: move code for IP address map into separate file (Stefan Berger)
- qemu: move -name arg to be 1st in "ps x" output (Marti Raudsepp)
- qemu: fix netdev alias name assignment wrt type='hostdev' (Laine Stump)
- tools: make virt-pki-validate work with acls and xattrs (Martin Kletzander)
- build: include augeas-gentest.pl into dist file (Wen Congyang)
- build: use same perl binary throughout build (Eric Blake)
- build: fix testing of augeas files in VPATH builds (Eric Blake)
- build: silence warning from autoconf (Eric Blake)
- virCommand: Extend debug message for handshake (Michal Privoznik)
- build: Fixed generating of libvirt_qemu_probes.h (Martin Kletzander)
- build: don't lose probes.o files (Eric Blake)
- build: fix missing dependencies for libvirt-qemu.so (Eric Blake)
- build: don't clean a file that belongs in the tarball (Eric Blake)
- virsh: avoid strncpy (Eric Blake)
- build: update to latest gnulib (Eric Blake)
- Introduce virMacAddr typedef (Stefan Berger)
- Santize the reporting of VIR_ERR_INVALID_ERROR (Daniel P. Berrange)
- build: silence libtool during tests (Eric Blake)
- Fix linking to DTrace probes file (Daniel P. Berrange)
- Autogenerate augeas test case from default config files (Daniel P. Berrange)
- Re-order config options in qemu driver augeas lens (Daniel P. Berrange)
- Fix mistakes in augeas lens (Daniel P. Berrange)
- Standardize whitespace used in example config files (Daniel P. Berrange)
- Remove uid param from directory lookup APIs (Daniel P. Berrange)
- Fix check for socket existance / daemon spawn (Daniel P. Berrange)
- Remove last usage of PATH_MAX and ban its future use (Daniel P. Berrange)
- maint: avoid new automake warning about AM_PROG_CC_STDC (Jim Meyering)
- build: silence libtool warning on probes.o (Eric Blake)
- tests: run valgrind on real executables, not libtool wrappers (Eric Blake)
- qemu augeas: Add spice_tls/spice_tls_x509_cert_dir (Douglas Schilling Landgraf)
- tests: back to short test names (Eric Blake)
- maint: ignore more files from version control (Eric Blake)
- Add sentinel for virErrorDomain enum (Daniel P. Berrange)
- Add parsing for VIR_ENUM_IMPL & VIR_ENUM_DECL in apibuild.py (Daniel P. Berrange)
- security: Switch to C99-style struct initialization (Michal Privoznik)
- Add test case for loading driver modules (Daniel P. Berrange)
- Override default driver dir when running from GIT (Daniel P. Berrange)
- Split QEMU dtrace probes into separate file (Daniel P. Berrange)
- Replace RTLD_LOCAL with RTLD_GLOBAL (Daniel P. Berrange)
- Ensure LXC driver links against libblkid explicitly. (Daniel P. Berrange)
- Remove libvirt_test.la library (Daniel P. Berrange)
- Fix broken linkage of libvirt_driver_nodedev.la (Daniel P. Berrange)
- Only build server side drivers as modules (Daniel P. Berrange)
- Fix dep from libvirt-lock-sanlock RPM (Daniel P. Berrange)
- openvz: add quota argument when creating container (Guido Günther)
- openvz: support file system quota reporting (Guido Günther)
- Introduce filesystem limits to virDomainFSDef (Guido Günther)
- Introduce virDomainParseScaledValue (Guido Günther)
- util: export virBufferTrim (Laine Stump)
- virBuffer: add way to trim back extra text (Eric Blake)
- build: fix unused variable after last patch (Eric Blake)
- nwfilter: Add support for ipset (Stefan Berger)
- Adds support to param 'vcpu_time' in qemu_driver. (Hu Tao)
- Add a new param 'vcpu_time' to virDomainGetCPUStats (Hu Tao)
- tests: add ich6 codec type test to qemuxml2argv-sound-device (Marc-André Lureau)
- qemu: honour sound <codec> sub-elements (Marc-André Lureau)
- domain: add <codec> sound sub-element (Marc-André Lureau)
- qemu: test CAPS_HDA_MICRO (Marc-André Lureau)
- nodeinfo: test more details (Eric Blake)
- Add a virLogMessage alternative taking va_list args (Daniel P. Berrange)
- build: fix recent syntax-check breakage (Eric Blake)
- qemu: Rollback on used USB devices (Michal Privoznik)
- Reject any non-option command line arguments (Daniel P. Berrange)
- Remount cgroups controllers after setting up new /sys in LXC (Daniel P. Berrange)
- Trim /proc & /sys subtrees before mounting new instances (Daniel P. Berrange)
- Avoid LXC pivot root in the root source is still / (Daniel P. Berrange)
- Mount fresh instance of sysfs/selinux in LXC (Daniel P. Berrange)
- Convert the LXC driver to use the security driver API for mount options (Daniel Walsh)
- Add security driver APIs for getting mount options (Daniel Walsh)
- Add support for LXC specific SELinux configuration (Daniel Walsh)
- Use private data struct in SELinux driver (Daniel Walsh)
- Don't enable the AppArmour security driver with LXC (Daniel Walsh)
- Pass the virt driver name into security drivers (Daniel Walsh)
- Remove bogus udev.target dep from libvirtd unit (Daniel P. Berrange)
- qemu: Add support for -no-user-config (Jiri Denemark)
- Set a sensible default master start port for ehci companion controllers (Daniel P. Berrange)
- Fix logic for assigning PCI addresses to USB2 companion controllers (Daniel P. Berrange)
- Fix virDomainDeviceInfoIsSet() to check all struct fields (Daniel P. Berrange)
- Remove redundant trailing slash in user dir paths (Daniel P. Berrange)
- Allow stack traces to be included with log messages (Daniel P. Berrange)
- Move user libvirtd socket out of abstract namespace (Daniel P. Berrange)
- Add openvz_util.c to POTFILES (Daniel P. Berrange)
- Add bundled(gnulib) to RPM specfile (Daniel P. Berrange)
- openvz: determine kb/pages only once (Guido Günther)
- libvirt-guests: Remove LISTFILE if it's empty when stopping service (Osier Yang)
- qemu: Set memory policy using cgroup if placement is auto (Osier Yang)
- qemu: Use the CPU index in capabilities to map NUMA node to cpu list. (Osier Yang)
- Assign spapr-vio bus address to ibmvscsi controller (Li Zhang)
- sanlock: fix locking for readonly devices (David Weber)
- nodeinfo: add some more tests (Eric Blake)
- nodeinfo: drop static variable (Eric Blake)
- maint: fix AUTHORS (Eric Blake)
- Use XDG Base Directories instead of storing in home directory (William Jon McCann)
Cleanups:
- Remove accidentally added Patch: lines from mingw-libvirt.spec.in (Daniel P. Berrange)
- Add /tools/libvirt-guests.service to .gitignore (Guido Günther)
- sanlock: Properly indent (Michal Privoznik)
- Remove stray debug fprintf in XML parser (Daniel P. Berrange)
- util: Fix the indention (Osier Yang)
- LXC: avoid useless duplicate memory free (Gao feng)
- driver: Clean up driver header to space indentation (Peter Krempa)
- build: fix whitespace damage (Eric Blake)
- build: hoist qemu dependence on yajl to configure (Eric Blake)
- maint: command.c whitespace cleanups (Eric Blake)
- Revert "rpc: Discard non-blocking calls only when necessary" (Jiri Denemark)
thanks everybody for the contributions, be it bug reports,
documentation fixes, patches, etc. !
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
12 years, 5 months
[libvirt] [PATCH] Added the attribute vendor_id to the cpu model
by Hendrik Schwartke
Introducing the attribute vendor_id to force the CPUID instruction
in a kvm guest to return the specified vendor.
---
docs/schemas/domaincommon.rng | 7 +++++
src/conf/cpu_conf.c | 61 ++++++++++++++++++++++++++++++++---------
src/conf/cpu_conf.h | 3 ++
src/qemu/qemu_command.c | 6 +++-
tests/testutilsqemu.c | 1 +
5 files changed, 64 insertions(+), 14 deletions(-)
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 46e539d..a246e8b 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -2820,6 +2820,13 @@
</choice>
</attribute>
</optional>
+ <optional>
+ <attribute name="vendor_id">
+ <data type="string">
+ <param name='pattern'>.{12}</param>
+ </data>
+ </attribute>
+ </optional>
<choice>
<text/>
<empty/>
diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
index b520f7c..b8ca7a5 100644
--- a/src/conf/cpu_conf.c
+++ b/src/conf/cpu_conf.c
@@ -22,6 +22,7 @@
*/
#include <config.h>
+#include <ctype.h>
#include "virterror_internal.h"
#include "memory.h"
@@ -68,6 +69,7 @@ virCPUDefFreeModel(virCPUDefPtr def)
VIR_FREE(def->model);
VIR_FREE(def->vendor);
+ VIR_FREE(def->vendor_id);
for (i = 0; i < def->nfeatures; i++)
VIR_FREE(def->features[i].name);
@@ -104,6 +106,7 @@ virCPUDefCopyModel(virCPUDefPtr dst,
if ((src->model && !(dst->model = strdup(src->model)))
|| (src->vendor && !(dst->vendor = strdup(src->vendor)))
+ || (src->vendor_id && !(dst->vendor_id = strdup(src->vendor_id)))
|| VIR_ALLOC_N(dst->features, src->nfeatures) < 0)
goto no_memory;
dst->nfeatures_max = dst->nfeatures = src->nfeatures;
@@ -288,19 +291,42 @@ virCPUDefParseXML(const xmlNodePtr node,
}
if (def->type == VIR_CPU_TYPE_GUEST &&
- def->mode != VIR_CPU_MODE_HOST_PASSTHROUGH &&
- virXPathBoolean("boolean(./model[1]/@fallback)", ctxt)) {
- const char *fallback;
-
- fallback = virXPathString("string(./model[1]/@fallback)", ctxt);
- if (fallback) {
- def->fallback = virCPUFallbackTypeFromString(fallback);
- VIR_FREE(fallback);
- if (def->fallback < 0) {
- virCPUReportError(VIR_ERR_XML_ERROR, "%s",
- _("Invalid fallback attribute"));
- goto error;
- }
+ def->mode != VIR_CPU_MODE_HOST_PASSTHROUGH) {
+
+ if(virXPathBoolean("boolean(./model[1]/@fallback)", ctxt)) {
+ const char *fallback;
+
+ fallback = virXPathString("string(./model[1]/@fallback)", ctxt);
+ if (fallback) {
+ def->fallback = virCPUFallbackTypeFromString(fallback);
+ VIR_FREE(fallback);
+ if (def->fallback < 0) {
+ virCPUReportError(VIR_ERR_XML_ERROR, "%s",
+ _("Invalid fallback attribute"));
+ goto error;
+ }
+ }
+
+ if(virXPathBoolean("boolean(./model[1]/@vendor_id)", ctxt)) {
+ char *vendor_id;
+
+ vendor_id = virXPathString("string(./model[1]/@vendor_id)", ctxt);
+ if(!vendor_id || strlen(vendor_id)!=VIR_CPU_VENDOR_ID_LENGTH) {
+ virCPUReportError(VIR_ERR_XML_ERROR, "%s",
+ _("vendor id must be 12 characters long"));
+ VIR_FREE(vendor_id);
+ goto error;
+ }
+ for(i=0; i<strlen(vendor_id); i++) {
+ if(!isprint(vendor_id[i]) || isspace(vendor_id[i])) {
+ virCPUReportError(VIR_ERR_XML_ERROR, "%s",
+ _("vendor id is invalid"));
+ VIR_FREE(vendor_id);
+ goto error;
+ }
+ }
+ def->vendor_id = vendor_id;
+ }
}
}
@@ -588,6 +614,8 @@ virCPUDefFormatBuf(virBufferPtr buf,
return -1;
}
virBufferAsprintf(buf, " fallback='%s'", fallback);
+ if(def->vendor_id)
+ virBufferAsprintf(buf, " vendor_id='%s'", def->vendor_id);
}
if (formatModel && def->model) {
virBufferAsprintf(buf, ">%s</model>\n", def->model);
@@ -738,6 +766,13 @@ virCPUDefIsEqual(virCPUDefPtr src,
goto cleanup;
}
+ if (STRNEQ_NULLABLE(src->vendor_id, dst->vendor_id)) {
+ virCPUReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Target CPU model %s does not match source %s"),
+ NULLSTR(dst->vendor_id), NULLSTR(src->vendor_id));
+ goto cleanup;
+ }
+
if (src->sockets != dst->sockets) {
virCPUReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Target CPU sockets %d does not match source %d"),
diff --git a/src/conf/cpu_conf.h b/src/conf/cpu_conf.h
index f8b7bf9..3daadbd 100644
--- a/src/conf/cpu_conf.h
+++ b/src/conf/cpu_conf.h
@@ -28,6 +28,8 @@
# include "buf.h"
# include "xml.h"
+#define VIR_CPU_VENDOR_ID_LENGTH 12
+
enum virCPUType {
VIR_CPU_TYPE_HOST,
VIR_CPU_TYPE_GUEST,
@@ -103,6 +105,7 @@ struct _virCPUDef {
int match; /* enum virCPUMatch */
char *arch;
char *model;
+ char *vendor_id; /* vendor id returned by CPUID in the guest */
int fallback; /* enum virCPUFallback */
char *vendor;
unsigned int sockets;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index bd4f96a..56ecefb 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3910,7 +3910,9 @@ qemuBuildCpuArgStr(const struct qemud_driver *driver,
}
virBufferAddLit(&buf, "host");
} else {
- if (VIR_ALLOC(guest) < 0 || !(guest->arch = strdup(host->arch)))
+ if (VIR_ALLOC(guest) < 0
+ || !(guest->arch = strdup(host->arch))
+ || (cpu->vendor_id && !(guest->vendor_id = strdup(cpu->vendor_id))))
goto no_memory;
if (cpu->match == VIR_CPU_MATCH_MINIMUM)
@@ -3924,6 +3926,8 @@ qemuBuildCpuArgStr(const struct qemud_driver *driver,
goto cleanup;
virBufferAdd(&buf, guest->model, -1);
+ if(guest->vendor_id)
+ virBufferAsprintf(&buf, ",vendor=%s", guest->vendor_id);
for (i = 0; i < guest->nfeatures; i++) {
char sign;
if (guest->features[i].policy == VIR_CPU_FEATURE_DISABLE)
diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c
index 8d5a3bf..8b7cb33 100644
--- a/tests/testutilsqemu.c
+++ b/tests/testutilsqemu.c
@@ -116,6 +116,7 @@ virCapsPtr testQemuCapsInit(void) {
0, /* match */
(char *) "x86_64", /* arch */
(char *) "core2duo", /* model */
+ NULL, /* vendor_id */
0, /* fallback */
(char *) "Intel", /* vendor */
1, /* sockets */
--
1.7.9.5
12 years, 5 months
[libvirt] [PATCH] qemu: add rbd to whitelist of migration-safe formats
by Josh Durgin
QEMU (and librbd) flush the cache on the source before the
destination starts, and the destination does not read any
changeable data before that, so live migration with rbd caching
is safe.
This makes 'virsh migrate' work with rbd and caching without the
--unsafe flag.
Reported-by: Vladimir Bashkirtsev <vladimir(a)bashkirtsev.com>
Signed-off-by: Josh Durgin <josh.durgin(a)inktank.com>
---
src/qemu/qemu_migration.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 48369d6..f51c99a 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -847,6 +847,9 @@ qemuMigrationIsSafe(virDomainDefPtr def)
continue;
else if (cfs < 0)
return false;
+ } else if (disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK &&
+ disk->protocol == VIR_DOMAIN_DISK_PROTOCOL_RBD) {
+ continue;
}
qemuReportError(VIR_ERR_MIGRATE_UNSAFE, "%s",
--
1.7.9.5
12 years, 6 months
[libvirt] [libvirt-php PATCH] Add ability to managed save libvirt domains
by Y@billing.fastvps.ru
From: Pavel Odintsov <pavel.odintsov(a)gmail.com>
---
src/libvirt-php.c | 22 ++++++++++++++++++++++
src/libvirt-php.h | 1 +
2 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/src/libvirt-php.c b/src/libvirt-php.c
index 20e5d27..9cdfd0e 100644
--- a/src/libvirt-php.c
+++ b/src/libvirt-php.c
@@ -99,6 +99,7 @@ static zend_function_entry libvirt_functions[] = {
PHP_FE(libvirt_domain_core_dump, NULL)
PHP_FE(libvirt_domain_shutdown, NULL)
PHP_FE(libvirt_domain_suspend, NULL)
+ PHP_FE(libvirt_domain_managedsave, NULL)
PHP_FE(libvirt_domain_undefine, NULL)
PHP_FE(libvirt_domain_reboot, NULL)
PHP_FE(libvirt_domain_define_xml, NULL)
@@ -4470,6 +4471,27 @@ PHP_FUNCTION(libvirt_domain_shutdown)
}
/*
+ Function name: libvirt_domain_managedsave
+ Since version: 0.4.1(-1)
+ Description: Function is used to managed save the domain (domain was unloaded from memory and it state saved to disk) identified by it's resource
+ Arguments: @res [resource]: libvirt domain resource, e.g. from libvirt_domain_lookup_by_*()
+ Returns: TRUE for success, FALSE on error
+*/
+
+PHP_FUNCTION(libvirt_domain_managedsave)
+{
+ php_libvirt_domain *domain=NULL;
+ zval *zdomain;
+ int retval;
+
+ GET_DOMAIN_FROM_ARGS("r",&zdomain);
+ retval=virDomainManagedSave(domain->domain, 0);
+ DPRINTF("%s: virDomainManagedSave(%p) returned %d\n", PHPFUNC, domain->domain, retval);
+ if (retval != 0) RETURN_FALSE;
+ RETURN_TRUE;
+}
+
+/*
Function name: libvirt_domain_suspend
Since version: 0.4.1(-1)
Description: Function is used to suspend the domain identified by it's resource
diff --git a/src/libvirt-php.h b/src/libvirt-php.h
index 3c7f254..b06836c 100644
--- a/src/libvirt-php.h
+++ b/src/libvirt-php.h
@@ -307,6 +307,7 @@ PHP_FUNCTION(libvirt_domain_resume);
PHP_FUNCTION(libvirt_domain_core_dump);
PHP_FUNCTION(libvirt_domain_shutdown);
PHP_FUNCTION(libvirt_domain_suspend);
+PHP_FUNCTION(libvirt_domain_managedsave);
PHP_FUNCTION(libvirt_domain_undefine);
PHP_FUNCTION(libvirt_domain_reboot);
PHP_FUNCTION(libvirt_domain_define_xml);
--
1.7.2.5
12 years, 6 months
[libvirt] [PATCH] fix key error for qemuMonitorGetBlockStatsInfo
by lvroyce@linux.vnet.ibm.com
From: lvroyce <lvroyce(a)linux.vnet.ibm.com>
virDomainBlockStatsFlags can't collect total_time_ns for read/write/flush
because of key typo when retriveing from qemu cmd result
Signed-off-by: lvroyce <lvroyce(a)linux.vnet.ibm.com>
---
src/qemu/qemu_monitor_json.c | 24 ++++++++++++------------
src/qemu/qemu_monitor_text.c | 18 +++++++++---------
2 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 7d2da21..7eb9529 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -1710,12 +1710,12 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon,
goto cleanup;
}
if (rd_total_times &&
- virJSONValueObjectHasKey(stats, "rd_total_times_ns") &&
- (virJSONValueObjectGetNumberLong(stats, "rd_total_times_ns",
+ virJSONValueObjectHasKey(stats, "rd_total_time_ns") &&
+ (virJSONValueObjectGetNumberLong(stats, "rd_total_time_ns",
rd_total_times) < 0)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot read %s statistic"),
- "rd_total_times_ns");
+ "rd_total_time_ns");
goto cleanup;
}
if (virJSONValueObjectGetNumberLong(stats, "wr_bytes", wr_bytes) < 0) {
@@ -1731,12 +1731,12 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon,
goto cleanup;
}
if (wr_total_times &&
- virJSONValueObjectHasKey(stats, "wr_total_times_ns") &&
- (virJSONValueObjectGetNumberLong(stats, "wr_total_times_ns",
+ virJSONValueObjectHasKey(stats, "wr_total_time_ns") &&
+ (virJSONValueObjectGetNumberLong(stats, "wr_total_time_ns",
wr_total_times) < 0)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot read %s statistic"),
- "wr_total_times_ns");
+ "wr_total_time_ns");
goto cleanup;
}
if (flush_req &&
@@ -1749,12 +1749,12 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon,
goto cleanup;
}
if (flush_total_times &&
- virJSONValueObjectHasKey(stats, "flush_total_times_ns") &&
- (virJSONValueObjectGetNumberLong(stats, "flush_total_times_ns",
+ virJSONValueObjectHasKey(stats, "flush_total_time_ns") &&
+ (virJSONValueObjectGetNumberLong(stats, "flush_total_time_ns",
flush_total_times) < 0)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot read %s statistic"),
- "flush_total_times_ns");
+ "flush_total_time_ns");
goto cleanup;
}
}
@@ -1822,12 +1822,12 @@ int qemuMonitorJSONGetBlockStatsParamsNumber(qemuMonitorPtr mon,
if (STREQ(key, "rd_bytes") ||
STREQ(key, "rd_operations") ||
- STREQ(key, "rd_total_times_ns") ||
+ STREQ(key, "rd_total_time_ns") ||
STREQ(key, "wr_bytes") ||
STREQ(key, "wr_operations") ||
- STREQ(key, "wr_total_times_ns") ||
+ STREQ(key, "wr_total_time_ns") ||
STREQ(key, "flush_operations") ||
- STREQ(key, "flush_total_times_ns")) {
+ STREQ(key, "flush_total_time_ns")) {
num++;
} else {
/* wr_highest_offset is parsed by qemuMonitorJSONGetBlockExtent. */
diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
index edb5dfd..086b06b 100644
--- a/src/qemu/qemu_monitor_text.c
+++ b/src/qemu/qemu_monitor_text.c
@@ -977,13 +977,13 @@ int qemuMonitorTextGetBlockStatsInfo(qemuMonitorPtr mon,
if (virStrToLong_ll (p, &dummy, 10, wr_req) == -1)
VIR_DEBUG ("error reading wr_req: %s", p);
} else if (rd_total_times &&
- STRPREFIX (p, "rd_total_times_ns=")) {
- p += strlen("rd_total_times_ns=");
+ STRPREFIX (p, "rd_total_time_ns=")) {
+ p += strlen("rd_total_time_ns=");
if (virStrToLong_ll (p, &dummy, 10, rd_total_times) == -1)
VIR_DEBUG ("error reading rd_total_times: %s", p);
} else if (wr_total_times &&
- STRPREFIX (p, "wr_total_times_ns=")) {
- p += strlen("wr_total_times_ns=");
+ STRPREFIX (p, "wr_total_time_ns=")) {
+ p += strlen("wr_total_time_ns=");
if (virStrToLong_ll (p, &dummy, 10, wr_total_times) == -1)
VIR_DEBUG ("error reading wr_total_times: %s", p);
} else if (flush_req &&
@@ -992,8 +992,8 @@ int qemuMonitorTextGetBlockStatsInfo(qemuMonitorPtr mon,
if (virStrToLong_ll (p, &dummy, 10, flush_req) == -1)
VIR_DEBUG ("error reading flush_req: %s", p);
} else if (flush_total_times &&
- STRPREFIX (p, "flush_total_times_ns=")) {
- p += strlen("flush_total_times_ns=");
+ STRPREFIX (p, "flush_total_time_ns=")) {
+ p += strlen("flush_total_time_ns=");
if (virStrToLong_ll (p, &dummy, 10, flush_total_times) == -1)
VIR_DEBUG ("error reading flush_total_times: %s", p);
} else {
@@ -1071,10 +1071,10 @@ int qemuMonitorTextGetBlockStatsParamsNumber(qemuMonitorPtr mon,
STRPREFIX (p, " wr_bytes=") ||
STRPREFIX (p, " rd_operations=") ||
STRPREFIX (p, " wr_operations=") ||
- STRPREFIX (p, " rd_total_times_ns=") ||
- STRPREFIX (p, " wr_total_times_ns=") ||
+ STRPREFIX (p, " rd_total_time_ns=") ||
+ STRPREFIX (p, " wr_total_time_ns=") ||
STRPREFIX (p, " flush_operations=") ||
- STRPREFIX (p, " flush_total_times_ns=")) {
+ STRPREFIX (p, " flush_total_time_ns=")) {
num++;
} else {
VIR_DEBUG ("unknown block stat near %s", p);
--
1.7.7.6
12 years, 6 months
[libvirt] sanlock on F17
by Dave Allan
I just tried to set up sanlock on F17 using the instructions at
http://libvirt.org/locking.html, but libvirtd refuses to start with
the sanlock error in the logs:
Jun 29 19:56:20 nienna sanlock[8423]: 19846 open error -13
/var/lib/libvirt/sanlock/__LIBVIRT__DISKS__
I confirmed that user sanlock can create, read and write files in
/var/lib/libvirt/sanlock
The only thing I can think of that's slightly odd about my setup is
that I'm only concerned with the local machine, so that directory is
not an NFS mount. Anybody have any thoughts on what's going wrong
here?
TIA,
Dave
12 years, 6 months
[libvirt] compile option: --without-gnutls
by Chris Van Heuveln
Hi libvirt-list,
Full disclosure: this is the first open source project I've tried to contribute to and I'm still learning the process and tools.
In any case, Mikhail Gusarov started a thread on this a while back and I've tried to take it to conclusion. I needed to remove tls for 0.8.4 so I coded up a --without-gnutls configure option using Mikhail's partial code as a template. Then I pulled down 0.9.12 and came up with a patch that I'd like to push out to the commununity.
I'm not adding any "new" functionality other than the configure option. The tls calls/structs are just #ifdef'd for the most part. In a couple of places I had to flip the logic for "if (!tls_struct) else", and also had to modify a few function calls to pass void * instead of tls pointers.
I built --with-gnutls, --without-gnutls, and no option specified (defaults to --with-gnutls).
make check is clean except for:
TEST: libvirtdconftest
.....!!!!!!...!!!!!!!!!!!!!!!!!!!!!!!!! 39 FAIL
...which consists mostly of this sasl failure:
39) Test corruption ... libvir: Config File error : unsupported configuration: remoteReadConfigFile: /home/ubu/git/libvirt/tests/../daemon/libvirtd.conf: auth_tcp: unsupported auth sasl
FAILED
...so I'm trying to track that down, and also need to run syntax-check and valgrind tests.
Once I get the tests passing what's my next step?
Are you okay with this approach?
Do you want a preview of my diffs?
Do I need to write additional tests for this new option or update any documentation?
Thanks,
Chris Van Heuveln
12 years, 6 months