[libvirt] clone "img" on iscsi storage
by Jason
Hi:
I need to clone a vm, the source is "vm1.img",i need to clone the "vm1.img" to a iscsi storage volume, it's said that i can't create volume on a iscsi.
I use virStorageVolCreateXMLFrom to do this, can you do me a favor? thank you.
the virt-manager can clone the "vm1.img" to overwrite the iscsi "lun",what can i do to do the same thing, i do not understand the python.
10 years, 11 months
[libvirt] [PATCH 1/3] vbox: fix incorrect loop condition in vboxHostDeviceGetXMLDesc
by Ryota Ozaki
The fixed loop used logical OR to combine two conditions, however,
it is apparently incorrect and logical AND is correct.
We can fix it by replacing OR with AND, but this patch instead
fixes the problem by getting rid of the first conditional
statement: USBFilterCount < def->nhostdevs. It isn't needed
because USBFilterCount will never be greater than or equal to
def->nhostdevs.
def->nhostdevs is calculated in the following code
above the loop in question like this:
for (i = 0; i < deviceFilters.count; i++) {
PRBool active = PR_FALSE;
IUSBDeviceFilter *deviceFilter = deviceFilters.items[i];
deviceFilter->vtbl->GetActive(deviceFilter, &active);
if (active) {
def->nhostdevs++;
}
}
And the loop is constructed as like this:
for (i = 0; (USBFilterCount < def->nhostdevs) || (i < deviceFilters.count); i++) {
PRBool active = PR_FALSE;
(snip)
deviceFilter->vtbl->GetActive(deviceFilter, &active);
if (!active)
continue;
(snip)
USBFilterCount++;
}
So def->nhostdevs is the number of active device filters and
USBFilterCount is counted up only when a device filter is active.
Thus, we can remove USBFilterCount < def->nhostdevs safely.
Reported-by: Laine Stump <laine(a)laine.org>
Signed-off-by: Ryota Ozaki <ozaki.ryota(a)gmail.com>
---
src/vbox/vbox_tmpl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index 983a595..cc5f275 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -2269,7 +2269,7 @@ static void vboxHostDeviceGetXMLDesc(vboxGlobalData *data, virDomainDefPtr def,
if (VIR_ALLOC_N(def->hostdevs, def->nhostdevs) < 0)
goto release_filters;
- for (i = 0; (USBFilterCount < def->nhostdevs) || (i < deviceFilters.count); i++) {
+ for (i = 0; i < deviceFilters.count; i++) {
PRBool active = PR_FALSE;
IUSBDeviceFilter *deviceFilter = deviceFilters.items[i];
PRUnichar *vendorIdUtf16 = NULL;
--
1.8.4
10 years, 11 months
[libvirt] [PATCH] tests: Fix comment for fake storage pool driver
by Peter Krempa
Commit bae124e40ff2b9d4de75d44510619db2c08d548a was accidentaly pushed
without review feedback worked in. Fix it up.
---
tests/qemuxml2argvtest.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 17d4554..e9a32fb 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -227,17 +227,16 @@ fakeStoragePoolIsActive(virStoragePoolPtr pool)
/* Test storage pool implementation
*
* These functions aid testing of storage pool related stuff when creating a
- * qemu command .
+ * qemu command line.
*
* There are a few "magic" values to pass to these functions:
*
- * 1) "inactive" as
- * a pool name for pool lookup creates a inactive pool. All other names are
- * interpreted as file names for files of storagepooltest and are used as the
+ * 1) "inactive" as a pool name to create an inactive pool. All other names are
+ * interpreted as file names in storagepoolxml2xmlout/ and are used as the
* definition for the pool. If the file doesn't exist the pool doesn't exist.
*
* 2) "nonexistent" returns an error while looking up a volume. Otherwise
- * pattern VOLUME_TYPE+VOLUME_PATH can be used to simulate a volume in an pool.
+ * pattern VOLUME_TYPE+VOLUME_PATH can be used to simulate a volume in a pool.
* This creates a fake path for this volume. If the '+' sign is omitted, block
* type is assumed.
*/
--
1.8.4.3
10 years, 11 months
[libvirt] [PATCHv2 0/4] Refactor pool source formatting
by Peter Krempa
A subset of the big gluster snapshot series. I accidentaly squashed two patches
together so I'm reposting the subset that was broken for re-review.
Peter Krempa (4):
test: Implement fake storage pool driver in qemuxml2argv test
qemuxml2argv: Add test to verify correct usage of disk type="volume"
qemuxml2argv: Add test for disk type='volume' with iSCSI pools
qemu: Refactor qemuTranslatePool source
src/conf/domain_conf.h | 1 +
src/libvirt_private.syms | 1 +
src/qemu/qemu_command.c | 76 +--------
src/qemu/qemu_conf.c | 129 +++++++++-----
src/qemu/qemu_conf.h | 2 +
.../qemuxml2argv-disk-source-pool-mode.args | 10 ++
.../qemuxml2argv-disk-source-pool-mode.xml | 4 +-
.../qemuxml2argv-disk-source-pool.args | 8 +
.../qemuxml2argv-disk-source-pool.xml | 2 +-
tests/qemuxml2argvtest.c | 187 +++++++++++++++++++++
10 files changed, 306 insertions(+), 114 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool-mode.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.args
--
1.8.4.3
10 years, 11 months
[libvirt] [PATCH] Fix pid ouput of libvirt.rpc.socket_new probe
by Jincheng Miao
Pass the pid value when invoking virNetSocketNew(). This will make
libvirt.rpc.socket_new stap probe return the right pid.
Signed-off-by: Jincheng Miao <jmiao(a)redhat.com>
---
src/rpc/virnetsocket.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
index 04bf25a..4c98fa9 100644
--- a/src/rpc/virnetsocket.c
+++ b/src/rpc/virnetsocket.c
@@ -300,7 +300,8 @@ int virNetSocketNewListenTCP(const char *nodename,
if (VIR_EXPAND_N(socks, nsocks, 1) < 0)
goto error;
- if (!(socks[nsocks-1] = virNetSocketNew(&addr, NULL, false, fd, -1, 0)))
+ if (!(socks[nsocks-1] = virNetSocketNew(&addr, NULL, false, fd, -1,
+ getpid())))
goto error;
runp = runp->ai_next;
fd = -1;
@@ -382,7 +383,7 @@ int virNetSocketNewListenUNIX(const char *path,
goto error;
}
- if (!(*retsock = virNetSocketNew(&addr, NULL, false, fd, -1, 0)))
+ if (!(*retsock = virNetSocketNew(&addr, NULL, false, fd, -1, getpid())))
goto error;
return 0;
@@ -420,7 +421,7 @@ int virNetSocketNewListenFD(int fd,
return -1;
}
- if (!(*retsock = virNetSocketNew(&addr, NULL, false, fd, -1, 0)))
+ if (!(*retsock = virNetSocketNew(&addr, NULL, false, fd, -1, getpid())))
return -1;
return 0;
@@ -497,7 +498,8 @@ int virNetSocketNewConnectTCP(const char *nodename,
goto error;
}
- if (!(*retsock = virNetSocketNew(&localAddr, &remoteAddr, true, fd, -1, 0)))
+ if (!(*retsock = virNetSocketNew(&localAddr, &remoteAddr, true, fd, -1,
+ getpid())))
goto error;
freeaddrinfo(ai);
@@ -574,7 +576,8 @@ retry:
goto error;
}
- if (!(*retsock = virNetSocketNew(&localAddr, &remoteAddr, true, fd, -1, 0)))
+ if (!(*retsock = virNetSocketNew(&localAddr, &remoteAddr, true, fd, -1,
+ getpid())))
goto error;
return 0;
@@ -1741,7 +1744,8 @@ int virNetSocketAccept(virNetSocketPtr sock, virNetSocketPtr *clientsock)
if (!(*clientsock = virNetSocketNew(&localAddr,
&remoteAddr,
true,
- fd, -1, 0)))
+ fd, -1,
+ getpid())))
goto cleanup;
fd = -1;
--
1.8.3.1
10 years, 11 months
[libvirt] Release of libvirt-1.2.0
by Daniel Veillard
Technically this is also the first release of libvirt-python
as this is the major change leading to the bump in middle version
number.
The libvirt tarballs and rpms are available at the usual place:
ftp://libvirt.org/libvirt/
while libvirt-python-1.2.0 tarball and rpms are in the new location:
ftp://libvirt.org/libvirts
of course both git trees are now tagged and development can resume.
The other 2 major user visible features are support for gluster pools
at the storage level and support for VBox 4.3 .
This is otherwise a relatively small release with less than 200 commits
with a balanced ratio of bug fixes and improvements:
Features:
- Add support for gluster pool (Eric Blake)
- Remove python binding (Daniel P. Berrange)
- vbox: add support for 4.3 APIs (Ryota Ozaki)
Documentation:
- fix typos in libvirt.h.in (Chen Hanxiao)
- Link libvirt-sandbox from apps page (Daniel P. Berrange)
- Add docs about audit subsystem logging (Daniel P. Berrange)
- virsh: fix doc typos (Nehal J Wani)
- Fix typos in various docs (Nehal J Wani)
- LXC: add securetty related note in Device nodes (Gao feng)
- Fix three minor typos (Yuri Chornoivan)
- storage: fix typo in previous patch (Eric Blake)
- storage: document gluster pool (Eric Blake)
- virDomainReboot: Document that migration might be unsafe (Michal Privoznik)
- delete extra character (Wangyufei (A))
- maint: fix comment typos. (Eric Blake)
- improve job info details (Eric Blake)
- fix a typo in formatnwfilter.html.in (Chen Hanxiao)
- Improve cgroups docs to cover systemd integration (Daniel P. Berrange)
- fix typos in libvirt.h.in (Chen Hanxiao)
- fix virDomainRestoreFlags description bug (Wang Yufei)
- grammar fixes (Eric Blake)
- add SystemTap to apps using libvirt (Jonathan Lebon)
- fix a typo in formatnwfilter (Chen Hanxiao)
- caps: Fix function docs for virCapabilitiesAddHostNUMACell (Peter Krempa)
Portability:
- tests: fix virpcitest with read-only srcdir (Eric Blake)
- tests: guarantee abs_srcdir in all C tests (Eric Blake)
- look for numad in /usr/sbin (Jim Fehlig)
- build: Don't fail on '<' or '>' with old xmllint (Martin Kletzander)
- spec: fix libvirt-docs subpackage on RHEL-6 (Michael Chapman)
- Don't depend on syslog.service (Guido Günther)
- qemuMonitorJSONGetCPUx86Data: Don't fail on ancient qemus (Michal Privoznik)
- build: work around super-old readline.h (Ryota Ozaki)
- Fix migration with QEMU 1.6 (Michael Avdienko)
- nodeinfo: fix build on non-Linux (Eric Blake)
Bug Fixes:
- vbox: handle errors of virDomainHostdevDefAlloc correctly (Ryota Ozaki)
- vbox: fix incorrect loop condition in vboxHostDeviceGetXMLDesc (Ryota Ozaki)
- Fix memory leak in virNWFilterDefParseXML() (Nehal J Wani)
- Fix memory leak in virDomainDefParseXML() (Nehal J Wani)
- LXC: Ensure security context is set when mounting images (Daniel P. Berrange)
- network: properly update iptables rules during net-update (Laine Stump)
- Fix bug in identifying sub-mounts (Daniel P. Berrange)
- storage: skip selinux cleanup when fd not available (Eric Blake)
- qemu: preserve netdev MAC address during 'domxml-to-native' (Bing Bu Cao)
- storage: don't read storage volumes in nonblock mode (Eric Blake)
- LXC: don't unmount mounts for shared root (Gao feng)
- LXC: fix the problem that libvirt lxc fail to start on latest kernel (Gao feng)
- sasl: Fix authentication when using PLAIN mechanism (Christophe Fergeau)
- Fix invalid read in virNetSASLSessionClientStep debug log (Christophe Fergeau)
- Tie SASL callbacks lifecycle to virNetSessionSASLContext (Christophe Fergeau)
- remote: Don't leak priv->tls object on connection failure (Christophe Fergeau)
- spec: Don't save/restore running VMs on libvirt-client update (Jiri Denemark)
- virsh domxml-from-native to treat SCSI as the bus type for pseries by default (Shivaprasad G Bhat)
- Don't start a nested job in qemuMigrationPrepareAny (Ján Tomko)
- spec: Don't save/restore running VMs on libvirt-client update (Cole Robinson)
- spec: Restrict virt-login-shell usage (Jiri Denemark)
- storage: use valid XML for awkward volume names (Eric Blake)
- storage: Returns earlier if source adapter of the scsi pool is a HBA (Osier Yang)
- libvirt-guests: Run only after libvirtd (Cole Robinson)
- Fix off-by-1 in default SELinux MCS range (Daniel P. Berrange)
- vbox: fix segfault on virsh dumpxml with the existence of USB filters (Ryota Ozaki)
- Add missing 'return 0;' in stub lxcStartFuse() method impl. (Daniel P. Berrange)
- Avoid async signal safety problem in glibc's setxid (Daniel P. Berrange)
- Don't release spice port twice when no TLS port is available (Ján Tomko)
- Properly unref a connection with a close callback (Ján Tomko)
- qemu: Call qemuSetupHostdevCGroup later during hotplug (Jiri Denemark)
- qemuMonitorIO: Don't use @mon after it's unrefed (Michal Privoznik)
- qemuProcessReconnectHelper: Don't create joinable thread (Michal Privoznik)
- virDomainEventCallbackListFree: Don't leak @list->callbacks (Michal Privoznik)
- networkBuildDhcpDaemonCommandLine: Don't leak @configstr and @configfile (Michal Privoznik)
- Disable nwfilter driver when running unprivileged (Ján Tomko)
- libxl: Fix Xen 4.4 libxlVmStart logic (Jason Andryuk)
- qemu: Check for presence of device and properities when getting CPUID (Peter Krempa)
- Fix busy wait loop in LXC container I/O handling (Daniel P. Berrange)
- Don't expose 'none' machine type to capabilities (Daniel P. Berrange)
- Fix mem leak in virQEMUCapsProbeQMPMachineTypes on OOM (Daniel P. Berrange)
- virSecurityLabelDefParseXML: Don't parse label on model='none' (Michal Privoznik)
- virsh-domain: Mark --live and --config mutually exclusive in vcpucount (Peter Krempa)
- qemu: Fix SCSI hotplug on pseries guests (Vitor de Lima)
- pci: properly handle out-of-order SRIOV virtual functions (Laine Stump)
- util: use -w flag when calling iptables (Serge Hallyn)
- storage: Fix a vol-clone bug on ppc64 (Li Zhang)
- qemu: Don't access vm->priv on unlocked domain (Michal Privoznik)
- qemu: Avoid double free of VM (Michal Privoznik)
- Allow root directory in filesystem source dir schema (Ján Tomko)
- qemuMigrationBeginPhase: Check for 'drive-mirror' for NBD (Michal Privoznik)
- conf: fix incorrect error log in virCPUDefIsEqual (Chen Hanxiao)
- qemuMonitorDispose: Reset lastError (Michal Privoznik)
- qemu: clean up migration ports when migration cancelled (Zeng Junliang)
- network: fix connections count in case of allocate failure (Laine Stump)
- virpcitest: Fix variable arguments using in pci_driver_new (Michal Privoznik)
- virpci: Don't error on unbinded devices (Michal Privoznik)
Improvements:
- Pull lxcContainerGetSubtree out into shared virfile module (Daniel P. Berrange)
- Introduce standard methods for sorting strings with qsort (Daniel P. Berrange)
- conf: Export virStorageVolType enum helper functions (Peter Krempa)
- sasl: Replace 'restep' label with 'continue' (Christophe Fergeau)
- storage: probe qcow2 volumes in gluster pool (Eric Blake)
- storage: improve handling of symlinks in gluster (Eric Blake)
- storage: improve allocation stats reported on gluster files (Eric Blake)
- storage: improve directory support in gluster pool (Eric Blake)
- storage: add network-dir as new storage volume type (Eric Blake)
- storage: implement rudimentary glusterfs pool refresh (Eric Blake)
- storage: initial support for linking with libgfapi (Eric Blake)
- storage: expose volume meta-type in XML (Eric Blake)
- storage: allow interleave in volume XML (Eric Blake)
- maint: next release is 1.2.0 (Eric Blake)
- vbox: import vbox_CAPI_v4_3.h from SDK (Ryota Ozaki)
- vbox: pull vboxHostDeviceGetXMLDesc out from vboxDomainGetXMLDesc (Ryota Ozaki)
- vbox: cleanup vboxAttachUSB (Ryota Ozaki)
- lxc: don't do duplicate work when getting pagesize (Chen Hanxiao)
- maint: update to latest gnulib (Eric Blake)
- python: remove virConnectGetCPUModelNames from globals (Doug Goldstein)
- python: remove virConnectGetCPUModelNames from globals (Doug Goldstein)
- qemu: Auto-generate controller for hotplugged hostdev (Eric Farman)
- qemu: Separate calls based on controller bus type (Eric Farman)
- qemu: Rename controller hotplug functions to not be PCI-specific (Eric Farman)
- qemu: Add support for virt machine type with virtio-mmio devices on armv7 (Clark Laughlin)
- maint: enforce comma style usage (Eric Blake)
- maint: fix comma style issues: remaining code (Eric Blake)
- maint: fix comma style issues: remaining drivers (Eric Blake)
- maint: fix comma style issues: vbox (Eric Blake)
- maint: fix comma style issues: python (Eric Blake)
- maint: fix comma style issues: util (Eric Blake)
- maint: fix comma style issues: tests, tools (Eric Blake)
- maint: fix comma style issues: qemu (Eric Blake)
- maint: fix comma style issues: xen (Eric Blake)
- maint: fix comma style issues: conf (Eric Blake)
- maint: fix comma style issues: nwfilter (Eric Blake)
- Error out on unterminated arrays and objects in JSON parser (Ján Tomko)
- Test if JSON parser fails on invalid input (Ján Tomko)
- maint: ship .pl scripts as executables (Eric Blake)
- Fix virsh net-info output for consistency (Hao Liu)
- Add missing break to switch-case block (Doug Goldstein)
- qemumonitorjsontest: Introduce GetNonExistingCPUData test (Michal Privoznik)
- Macro for testing the version you are compiling with (Doug Goldstein)
- Return -1 in virPortAllocatorAcquire if all ports are used (Ján Tomko)
- Add a name to virPortAllocator (Ján Tomko)
- storage: fix RNG validation of gluster via netfs (Eric Blake)
- virsh-secret: Unify list column alignment (Peter Krempa)
- virsh-interface: Unify list column alignment (Peter Krempa)
- virsh-nwfilter: Unify list command column alignment (Peter Krempa)
- virsh-pool: Unify spacing of listing function (Peter Krempa)
- qemu: Change return type of qemuMonitorGetGuestCPU() (Peter Krempa)
- virsh-volume: Unify strigification of volume type (Peter Krempa)
- virsh-volume: Unify alignment of vol-list output columns (Peter Krempa)
- conf: Refactor virDomainDiskSourceDefParse (Peter Krempa)
- conf: Rename virDomainDiskHostDefFree to virDomainDiskHostDefClear (Peter Krempa)
- conf: Split out code to parse the source of a disk definition (Peter Krempa)
- qemuDomainObjStart: Warn on corrupted image (Michal Privoznik)
- util: use size_t instead of unsigned int for num_virtual_functions (Laine Stump)
- qemu: assign PCI address to primary video card (Vitor de Lima)
- qemu: process: Validate specific CPUID flags of a guest (Peter Krempa)
- qemu: Add support for paravirtual spinlocks in the guest (Peter Krempa)
- conf: Refactor storing and usage of feature flags (Peter Krempa)
- cpu: x86: Add internal CPUID features support and KVM feature bits (Peter Krempa)
- qemu: Add monitor APIs to fetch CPUID data from QEMU (Jiri Denemark)
- cpu_x86: Refactor storage of CPUID data to add support for KVM features (Peter Krempa)
- tests: Distribute virpcitestdata (Michal Privoznik)
- tests: Fix virtpcitest in VPATH (Jiri Denemark)
- conf: Refactor virDomainDiskSourcePoolDefParse (Peter Krempa)
- storage: always probe type with buffer (Eric Blake)
- storage: refactor backing chain division of labor (Eric Blake)
- storage: reduce number of stat calls (Eric Blake)
- storage: avoid short reads while chasing backing chain (Eric Blake)
- storage: use simpler 'char *' (Eric Blake)
- test driver: add support for .connectBaselineCPU (Giuseppe Scrivano)
- virpcitest: Introduce testVirPCIDeviceReset (Michal Privoznik)
- virt-login-shell: also build virAtomic.h (Guido Günther)
- storage: recognize gluster as networked file (Eric Blake)
- qemu: don't use deprecated -no-kvm-pit-reinjection (Ján Tomko)
- Resolve Coverity issue regarding not checking return value (John Ferlan)
- Skip any files which are not mounted on the host (Daniel P. Berrange)
- Add flag to lxcBasicMounts to control use in user namespaces (Daniel P. Berrange)
- Remove duplicate entries in lxcBasicMounts array (Daniel P. Berrange)
- Remove pointless 'srcpath' variable in lxcContainerMountBasicFS (Daniel P. Berrange)
- Remove unused 'opts' field from LXC basic mounts struct (Daniel P. Berrange)
- Add virFileIsMountPoint function (Daniel P. Berrange)
- virpcitest: Introduce check for unbinded devices (Michal Privoznik)
- virpcitest: Introduce testVirPCIDeviceReattach (Michal Privoznik)
- virpcitest: Test virPCIDeviceDetach (Michal Privoznik)
- tests: Introduce virpcitest (Michal Privoznik)
- cpu: x86: Parse the CPU feature map only once (Peter Krempa)
- cpu: Export few x86-specific APIs (Jiri Denemark)
- nodeinfo: Remove libnuma include (Peter Krempa)
- numa: Add wrapper of numa_node_to_cpus and use it (Peter Krempa)
- numa: Replace NUMA_MAX_N_CPUS macro with virNumaGetMaxCPUs() (Peter Krempa)
- nodeinfo: Get rid of nodeGetCellMemory (Peter Krempa)
- numa: Introduce virNumaGetNodeMemory and use it instead of numa_node_size64 (Peter Krempa)
- numa: Introduce virNumaGetMaxNode and use it instead of numa_max_node (Peter Krempa)
- nodeinfo: Avoid forward declarations of static functions (Peter Krempa)
- numa: Introduce virNumaIsAvailable and use it instead of numa_available (Peter Krempa)
Cleanups:
- Remove obsolete 'tests' makefile target (Daniel P. Berrange)
- Mostly revert "python: remove virConnectGetCPUModelNames from globals" (Daniel P. Berrange)
- Remove redundant braces (Ján Tomko)
- virPCIDeviceBindToStub: Remove unused @oldDriverPath and @oldDriverName (Michal Privoznik)
Thanks to everybody who have helped on this release, with bug reports,
fixes, features or documentation updates !
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/
10 years, 11 months
[libvirt] [PATCH] Link libvirt-sandbox from apps page
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
Add a link to the http://sandbox.libvirt.org sub-site from the
list of libraries related to libvirt. Also fix formatting for
the ruby libvirt binding.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
docs/apps.html.in | 27 ++++++++++++++++-----------
1 file changed, 16 insertions(+), 11 deletions(-)
diff --git a/docs/apps.html.in b/docs/apps.html.in
index 3598062..79e46fd 100644
--- a/docs/apps.html.in
+++ b/docs/apps.html.in
@@ -277,19 +277,24 @@
host, and there is a subproject to allow merging changes into the
Windows Registry in Windows guests.
</dd>
+
+ <dt><a href="http://sandbox.libvirt.org">libvirt-sandbox</a></dd>
+ <dd>
+ A library and command line tools for simplifying the creation of
+ application sandboxes using virtualization technology. It currently
+ supports either KVM, QEMU or LXC as backends. Integration with
+ systemd facilitates sandboxing of system services like apache.
+ </dd>
+ <dt><a href="https://github.com/ohadlevy/virt#readme">Ruby
+ Libvirt Object bindings</a></dt>
+ <dd>
+ Allows using simple ruby objects to manipulate
+ hypervisors, guests, storage, network etc. It is
+ based on top of
+ the <a href="http://libvirt.org/ruby">native ruby bindings</a>.
+ </dd>
</dl>
- <dl>
- <dt><a href="https://github.com/ohadlevy/virt#readme">Ruby
- Libvirt Object bindings</a></dt>
- <dd>
- Allows using simple ruby objects to manipulate
- hypervisors, guests, storage, network etc. It is
- based on top of
- the <a href="http://libvirt.org/ruby">native ruby
- bindings</a>.
- </dd>
- </dl>
<h2><a name="livecd">LiveCD / Appliances</a></h2>
<dl>
--
1.8.3.1
10 years, 11 months
[libvirt] [PATCH v2] Fix memory leak in virNWFilterDefParseXML()
by Nehal J Wani
While running nwfilterxml2xmltest, it was found that valgrind pointed out the
following error...
==7466== 16 bytes in 1 blocks are definitely lost in loss record 26 of 90
==7466== at 0x4A06B6F: calloc (vg_replace_malloc.c:593)
==7466== by 0x4C651AD: virAlloc (viralloc.c:142)
==7466== by 0x4D0450D: virNWFilterDefParseNode (nwfilter_conf.c:2575)
==7466== by 0x4D05D84: virNWFilterDefParse (nwfilter_conf.c:2647)
==7466== by 0x401FDE: testCompareXMLToXMLHelper (nwfilterxml2xmltest.c:39)
==7466== by 0x402DE1: virtTestRun (testutils.c:138)
==7466== by 0x4018E9: mymain (nwfilterxml2xmltest.c:111)
==7466== by 0x403482: virtTestMain (testutils.c:593)
==7466== by 0x341F421A04: (below main) (libc-start.c:225)
...21 times, which are related to 21 tests in nwfilterxml2xmltest.c which sent
EXPECT_WARN = false. There were two scenarios in virNWFilterDefParseXML(),
when the variable 'entry' was malloc'ed, but not freed.
---
src/conf/nwfilter_conf.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/conf/nwfilter_conf.c b/src/conf/nwfilter_conf.c
index 793cb0e..d280df5 100644
--- a/src/conf/nwfilter_conf.c
+++ b/src/conf/nwfilter_conf.c
@@ -2576,21 +2576,25 @@ virNWFilterDefParseXML(xmlXPathContextPtr ctxt) {
goto cleanup;
if (xmlStrEqual(curr->name, BAD_CAST "rule")) {
- if (!(entry->rule = virNWFilterRuleParse(curr)))
+ if (!(entry->rule = virNWFilterRuleParse(curr))) {
+ virNWFilterEntryFree(entry);
goto cleanup;
+ }
} else if (xmlStrEqual(curr->name, BAD_CAST "filterref")) {
- if (!(entry->include = virNWFilterIncludeParse(curr)))
+ if (!(entry->include = virNWFilterIncludeParse(curr))) {
+ virNWFilterEntryFree(entry);
goto cleanup;
+ }
}
if (entry->rule || entry->include) {
if (VIR_REALLOC_N(ret->filterEntries, ret->nentries+1) < 0) {
- VIR_FREE(entry);
+ virNWFilterEntryFree(entry);
goto cleanup;
}
ret->filterEntries[ret->nentries++] = entry;
} else
- VIR_FREE(entry);
+ virNWFilterEntryFree(entry);
}
curr = curr->next;
}
--
1.8.1.4
10 years, 11 months
[libvirt] [PATCH] Fix memory leak in virDomainDefParseXML()
by Nehal J Wani
This patch fixes the memory leaks found while running qemuxml2argvtest
==8260== 3 bytes in 1 blocks are definitely lost in loss record 1 of 129
==8260== at 0x4A0887C: malloc (vg_replace_malloc.c:270)
==8260== by 0x341F485E21: strdup (strdup.c:42)
==8260== by 0x4CADCFF: virStrdup (virstring.c:554)
==8260== by 0x4CBB839: virXPathString (virxml.c:90)
==8260== by 0x4CE753A: virDomainDefParseXML (domain_conf.c:11478)
==8260== by 0x4CEB4FE: virDomainDefParseNode (domain_conf.c:12742)
==8260== by 0x4CEB675: virDomainDefParse (domain_conf.c:12684)
==8260== by 0x425958: testCompareXMLToArgvHelper (qemuxml2argvtest.c:107)
==8260== by 0x427111: virtTestRun (testutils.c:138)
==8260== by 0x41D3FE: mymain (qemuxml2argvtest.c:452)
==8260== by 0x4277B2: virtTestMain (testutils.c:593)
==8260== by 0x341F421A04: (below main) (libc-start.c:225)
==8260==
==8260== 4 bytes in 1 blocks are definitely lost in loss record 5 of 129
==8260== at 0x4A0887C: malloc (vg_replace_malloc.c:270)
==8260== by 0x341F485E21: strdup (strdup.c:42)
==8260== by 0x4CADCFF: virStrdup (virstring.c:554)
==8260== by 0x4CBB839: virXPathString (virxml.c:90)
==8260== by 0x4CE753A: virDomainDefParseXML (domain_conf.c:11478)
==8260== by 0x4CEB4FE: virDomainDefParseNode (domain_conf.c:12742)
==8260== by 0x4CEB675: virDomainDefParse (domain_conf.c:12684)
==8260== by 0x425958: testCompareXMLToArgvHelper (qemuxml2argvtest.c:107)
==8260== by 0x427111: virtTestRun (testutils.c:138)
==8260== by 0x41D39A: mymain (qemuxml2argvtest.c:451)
==8260== by 0x4277B2: virtTestMain (testutils.c:593)
==8260== by 0x341F421A04: (below main) (libc-start.c:225)
==8260==
---
src/conf/domain_conf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 140eb80..5449bd7 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -11486,6 +11486,7 @@ virDomainDefParseXML(xmlDocPtr xml,
def->features[val] = VIR_DOMAIN_FEATURE_STATE_ON;
}
ctxt->node = node;
+ VIR_FREE(tmp);
break;
case VIR_DOMAIN_FEATURE_LAST:
--
1.8.1.4
10 years, 11 months
[libvirt] [PATCH] virsh: fix doc typos
by Nehal J Wani
Fix 6 minor spelling errors in virsh doc
---
tools/virsh.pod | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tools/virsh.pod b/tools/virsh.pod
index dac9a08..f51060f 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -560,7 +560,7 @@ exits.
If I<--pass-fds> is specified, the argument is a comma separated list
of open file descriptors which should be pass on into the guest. The
-file descriptors will be re-numered in the guest, starting from 3. This
+file descriptors will be re-numbered in the guest, starting from 3. This
is only supported with container based virtualization.
B<Example>
@@ -889,7 +889,7 @@ also B<domblklist> for listing these names).
If I<--abort> is specified, the active job on the specified disk will
be aborted. If I<--async> is also specified, this command will return
-immediately, rather than waiting for the cancelation to complete. If
+immediately, rather than waiting for the cancellation to complete. If
I<--pivot> is specified, this requests that an active copy job
be pivoted over to the new copy.
If I<--info> is specified, the active job information on the specified
@@ -1158,7 +1158,7 @@ hostname which will not resolve to match one of its public IP addresses, then
libvirt will generate an incorrect URI. In this case I<migrateuri> should be
explicitly specified, using an IP address, or a correct hostname.
-=item * The host has multiple network interaces. If a host has multiple network
+=item * The host has multiple network interfaces. If a host has multiple network
interfaces, it might be desirable for the migration data stream to be sent over
a specific interface for either security or performance reasons. In this case
I<migrateuri> should be explicitly specified, using an IP address associated
@@ -1739,8 +1739,8 @@ hypervisor.
Suspend a running domain into one of these states (possible I<target>
values):
- mem equivallent of S3 ACPI state
- disk equivallent of S4 ACPI state
+ mem equivalent of S3 ACPI state
+ disk equivalent of S4 ACPI state
hybrid RAM is saved to disk but not powered off
The I<--duration> argument specifies number of seconds before the domain is
@@ -2740,7 +2740,7 @@ B<Supported algorithms>
sanitizing removable and non-removable hard disks:
random x2, 0x00, verify.
dod - 4-pass DoD 5220.22-M section 8-306 procedure for
- sanitizing removeable and non-removeable rigid
+ sanitizing removable and non-removable rigid
disks: random, 0x00, 0xff, verify.
bsi - 9-pass method recommended by the German Center of
Security in Information Technologies
--
1.8.1.4
10 years, 11 months