[libvirt] [PATCH v3 0/7] migration: add multithread compression
by Nikolay Shirokovskiy
Add options to turn multithread compression on during migration and to configure
its parameters.
Changes from v2:
1. Multiple field parameter is used to specify compression methods that should
be used during migration. VIR_MIGRATE_COMPRESSED option flag now specifies
that default compression methods should be used so we keep backward
compatibility. This method is lxbzrle for qemu.
2. Patch that adds monitor commands to configure multithread compression
parameters and patch that adds compression options to migrate command are
reworked.
This series has not patches to configure compression parameters before
migration. Do we need it? Also it has not patch to introspect compression
methods supported by driver as Jiri suggested because I want to publish this
series ealier to check that I'm going in right direction.
Eli Qiao (1):
qemumonitorjsontest: add test for getting multithread compress params
Nikolay Shirokovskiy (4):
qemu migration: factor out setting migration option
migration: add compress method option
qemu migration: add multithread compression options
qemu migration: add xbzrle compression options
ShaoHe Feng (2):
qemu monitor: add multithread compress parameters accessors
virsh: add compression options for migration
include/libvirt/libvirt-domain.h | 44 ++++++-
src/qemu/qemu_domain.c | 4 +
src/qemu/qemu_domain.h | 2 +
src/qemu/qemu_driver.c | 116 +++++++++++++++++-
src/qemu/qemu_migration.c | 256 +++++++++++++++++++--------------------
src/qemu/qemu_migration.h | 24 ++++
src/qemu/qemu_monitor.c | 31 ++++-
src/qemu/qemu_monitor.h | 17 +++
src/qemu/qemu_monitor_json.c | 87 +++++++++++++
src/qemu/qemu_monitor_json.h | 5 +
src/qemu/qemu_monitor_text.c | 100 +++++++++++++++
src/qemu/qemu_monitor_text.h | 5 +
tests/qemumonitorjsontest.c | 53 ++++++++
tools/virsh-domain.c | 84 +++++++++++++
tools/virsh.pod | 25 +++-
15 files changed, 711 insertions(+), 142 deletions(-)
--
1.8.3.1
8 years, 9 months
[libvirt] [PATCH V2 0/4] libxl: support qemu's network-based block backends
by Jim Fehlig
xl/libxl already supports qemu's network-based block backends
such as nbd and rbd. libvirt has supported configuring network
disks for long time too. This series marries the two in the
libxl driver and in the xl<->xml converter. Only rbd supported
is added in this series. Support for other backends such as nbd
and iscsi can be added as a follow-up improvement.
Patch 1 is super trivial and contains no functional changes.
Patch 2 changes the xl disk configuration produced by the
xml->xl converter to use the formal key=value syntax described
in xl-disk-configuration.txt.
Patch 3 adds support for converting rbd info between xl and xml
config formats.
Patch 4 adds support for rbd disks in the libxl driver.
In V2:
Change commit msg, test, and code in patch3 to escape literal
backslashes with a backslash.
Jim Fehlig (4):
xenconfig: replace text 'xm' with 'xl' in xlconfigtest
xenconfig: produce key=value disk config syntax in xl formatter
xenconfig: support xl<->xml conversion of rbd disk devices
libxl: add support for rbd qdisk
src/libxl/libxl_conf.c | 192 ++++++++++++++++++++-
src/xenconfig/xen_xl.c | 176 +++++++++++++++++--
.../test-disk-positional-parms-full.cfg | 26 +++
.../test-disk-positional-parms-full.xml | 54 ++++++
.../test-disk-positional-parms-partial.cfg | 26 +++
.../test-disk-positional-parms-partial.xml | 54 ++++++
.../test-fullvirt-direct-kernel-boot.cfg | 2 +-
tests/xlconfigdata/test-fullvirt-multiusb.cfg | 2 +-
tests/xlconfigdata/test-new-disk.cfg | 2 +-
tests/xlconfigdata/test-paravirt-cmdline.cfg | 2 +-
tests/xlconfigdata/test-paravirt-maxvcpus.cfg | 2 +-
tests/xlconfigdata/test-rbd-multihost-noauth.cfg | 26 +++
tests/xlconfigdata/test-rbd-multihost-noauth.xml | 51 ++++++
tests/xlconfigdata/test-spice-features.cfg | 2 +-
tests/xlconfigdata/test-spice.cfg | 2 +-
tests/xlconfigdata/test-vif-rate.cfg | 2 +-
tests/xlconfigtest.c | 37 ++--
17 files changed, 618 insertions(+), 40 deletions(-)
create mode 100644 tests/xlconfigdata/test-disk-positional-parms-full.cfg
create mode 100644 tests/xlconfigdata/test-disk-positional-parms-full.xml
create mode 100644 tests/xlconfigdata/test-disk-positional-parms-partial.cfg
create mode 100644 tests/xlconfigdata/test-disk-positional-parms-partial.xml
create mode 100644 tests/xlconfigdata/test-rbd-multihost-noauth.cfg
create mode 100644 tests/xlconfigdata/test-rbd-multihost-noauth.xml
--
2.1.4
8 years, 9 months
[libvirt] [PATCH] rbd: fix 32-bit build
by Eric Blake
%zu is not always synonymous with uint64_t; on 32-bit machines,
size_t is only 32 bits. Prefer "%llu"/'unsigned long long' when
the variable is under our control, and "%"PRIu64 when we are
stuck with 'uint64_t' from RBD.
Fixes errors such as:
../../src/storage/storage_backend_rbd.c: In function 'virStorageBackendRBDVolWipe':
../../src/storage/storage_backend_rbd.c:1281:15: error: format '%zu' expects argument of type 'size_t', but argument 8 has type 'uint64_t {aka long long unsigned int}' [-Werror=format=]
VIR_DEBUG("Need to wipe %zu bytes from RBD image %s/%s",
^
../../src/util/virlog.h:90:73: note: in definition of macro 'VIR_DEBUG_INT'
virLogMessage(src, VIR_LOG_DEBUG, filename, linenr, funcname, NULL, __VA_ARGS__)
^
../../src/storage/storage_backend_rbd.c:1281:5: note: in expansion of macro 'VIR_DEBUG'
VIR_DEBUG("Need to wipe %zu bytes from RBD image %s/%s",
^
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Pushing under the build-breaker rule
src/storage/storage_backend_rbd.c | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c
index 0591eec..7d04b39 100644
--- a/src/storage/storage_backend_rbd.c
+++ b/src/storage/storage_backend_rbd.c
@@ -23,6 +23,7 @@
#include <config.h>
+#include <inttypes.h>
#include "datatypes.h"
#include "virerror.h"
#include "storage_backend_rbd.h"
@@ -403,7 +404,7 @@ volStorageBackendRBDRefreshVolInfo(virStorageVolDefPtr vol,
}
VIR_DEBUG("Refreshed RBD image %s/%s (capacity: %llu allocation: %llu "
- "obj_size: %zu num_objs: %zu)",
+ "obj_size: %"PRIu64" num_objs: %"PRIu64")",
pool->def->source.name, vol->name, vol->target.capacity,
vol->target.allocation, info.obj_size, info.num_objs);
@@ -463,7 +464,8 @@ virStorageBackendRBDRefreshPool(virConnectPtr conn,
pool->def->available = clusterstat.kb_avail * 1024;
pool->def->allocation = poolstat.num_bytes;
- VIR_DEBUG("Utilization of RBD pool %s: (kb: %zu kb_avail: %zu num_bytes: %zu)",
+ VIR_DEBUG("Utilization of RBD pool %s: (kb: %"PRIu64" kb_avail: %"PRIu64
+ " num_bytes: %"PRIu64")",
pool->def->source.name, clusterstat.kb, clusterstat.kb_avail,
poolstat.num_bytes);
@@ -1168,8 +1170,8 @@ virStorageBackendRBDVolWipeZero(rbd_image_t image,
{
int r = -1;
int ret = -1;
- uint64_t offset = 0;
- uint64_t length;
+ unsigned long long offset = 0;
+ unsigned long long length;
char *writebuf;
if (VIR_ALLOC_N(writebuf, info->obj_size * stripe_count) < 0)
@@ -1179,13 +1181,13 @@ virStorageBackendRBDVolWipeZero(rbd_image_t image,
length = MIN((info->size - offset), (info->obj_size * stripe_count));
if ((r = rbd_write(image, offset, length, writebuf)) < 0) {
- virReportSystemError(-r, _("writing %zu bytes failed on "
- "RBD image %s at offset %zu"),
+ virReportSystemError(-r, _("writing %llu bytes failed on "
+ "RBD image %s at offset %llu"),
length, imgname, offset);
goto cleanup;
}
- VIR_DEBUG("Wrote %zu bytes to RBD image %s at offset %zu",
+ VIR_DEBUG("Wrote %llu bytes to RBD image %s at offset %llu",
length, imgname, offset);
offset += length;
@@ -1207,8 +1209,8 @@ virStorageBackendRBDVolWipeDiscard(rbd_image_t image,
{
int r = -1;
int ret = -1;
- uint64_t offset = 0;
- uint64_t length;
+ unsigned long long offset = 0;
+ unsigned long long length;
VIR_DEBUG("Wiping RBD %s volume using discard)", imgname);
@@ -1216,13 +1218,13 @@ virStorageBackendRBDVolWipeDiscard(rbd_image_t image,
length = MIN((info->size - offset), (info->obj_size * stripe_count));
if ((r = rbd_discard(image, offset, length)) < 0) {
- virReportSystemError(-r, _("discarding %zu bytes failed on "
- "RBD image %s at offset %zu"),
+ virReportSystemError(-r, _("discarding %llu bytes failed on "
+ "RBD image %s at offset %llu"),
length, imgname, offset);
goto cleanup;
}
- VIR_DEBUG("Discarded %zu bytes of RBD image %s at offset %zu",
+ VIR_DEBUG("Discarded %llu bytes of RBD image %s at offset %llu",
length, imgname, offset);
offset += length;
@@ -1278,7 +1280,7 @@ virStorageBackendRBDVolWipe(virConnectPtr conn,
goto cleanup;
}
- VIR_DEBUG("Need to wipe %zu bytes from RBD image %s/%s",
+ VIR_DEBUG("Need to wipe %"PRIu64" bytes from RBD image %s/%s",
info.size, pool->def->source.name, vol->name);
switch ((virStorageVolWipeAlgorithm) algorithm) {
--
2.5.0
8 years, 9 months
[libvirt] Storage backend and RBD improvements
by Wido den Hollander
This series of patches is mainly focussed on improving the RBD
storage pool backend.
In the series it fixes a bug in the storage pool driver regarding
volume wiping and it also adds the new flag to instruct storage
pools to use TRIM for wiping volumes.
Afterwards it adds this functionality to the RBD storage pool
and in addition it also adds to ability to clone RBD volumes.
The original series of patches were reviewed by John Ferlan and
this series are revised based on his great feedback.
Wido
8 years, 9 months
[libvirt] [PATCH] libxl: fix bogus indentation from commit fb2bd208
by Jim Fehlig
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
Found by Ján Tomko while reviewing fb2bd208.
Pushing under the trivial rule.
src/libxl/libxl_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 5133299..a109bb5 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -1095,7 +1095,7 @@ libxlMakeNetworkDiskSrc(virStorageSourcePtr src, char **srcstr)
}
if (!(*srcstr = libxlMakeNetworkDiskSrcStr(src, username, secret)))
- goto cleanup;
+ goto cleanup;
ret = 0;
--
2.6.1
8 years, 9 months
[libvirt] [PATCH v7 00/13] qemu: Add quorum support to libvirt
by Matthias Gatto
The purpose of these patches is to introduce quorum for libvirt
I've try to follow this proposal:
http://www.redhat.com/archives/libvir-list/2014-May/msg00533.html
This feature ask for 5 task:
1) Allow a _virStorageSource to contain more than one backing store.
Because all the actual libvirt code use the backingStore field
as a pointer and we needs want to change that, I've decide to encapsulate
the backingStore field to simplifie the array manipulation.
2) Add the missing field a quorum need in _virStorageSource and
the VIR_STORAGE_TYPE_QUORUM and VIR_STORAGE_FILE_QUORUM in
their respectives enums.
3) Parse and format the xml
Because a quorum allows to have more than one backing store at the same level
we need to change virDomainDiskDefFormat and virDomainDiskDefParseXML
to call virDomainDiskBackingStoreFormat and virDomainDiskBackingStoreParse
in a loop.
virDomainDiskBackingStoreFormat and virDomainDiskBackingStoreParse can
call themself recursively in a loop because a quorum can contain another
quorum
4) Build qemu string
As for the xml, we have to call the function which create quorum recursively.
But this task have the problem explained here:
http://www.redhat.com/archives/libvir-list/2014-October/msg00529.html
The _virStorageSource missing some informations that can be passed to
a child, and therefore this version of quorum is incomplet.
5) Allow to hotplug/change a disk in a quorum
This part is not present in these patches because for this task
we have to use blockdev-add, and currently libvirt use
device_add for hotpluging that doesn't allow to hotplug quorum childs.
V2:
-Rebase on master
-Add Documentation
V3:
-Transforme the backingStore field in virStorageSource into
an array of pointer instead of a pointer
-Modify virStorageSourceSetBackingStore to allow it to expand
the backingStore size.
V4:
-Rebase on master
V5:
-Rebase on master
-patch 1-4/9: use patchs from John Ferlan
-patch 4/9: check return of virStorageSourceSetBackingStore
-patch 5/9: report type of error on virStorageSourceSetBackingStore
v6:
-Rebase on master
-Remove node-name patch
-patch 06/13: Add virStorageSourceIsRAID
-patch 10/13: Add virDomainDefHasRAID
-patch 11-13/13: Block all unsupported operations
v7:
-Rebase on master.
-Parse unconditionally backing store.
-fold qemuBuildRAIDFileSourceStr into qemuBuildRAIDStr.
-use 0/-1 return values when failing instead of bool.
-virStorageSourceSetBackingStore now free backing store when they are
already set.
Matthias Gatto (13):
virstoragefile: Add virStorageSourceGetBackingStore
virstoragefile: Always use virStorageSourceGetBackingStore to get
backing store
virstoragefile: Add virStorageSourceSetBackingStore
virstoragefile: Always use virStorageSourceSetBackingStore to set
backing store
virstoragefile: change backingStore to backingStores.
virstoragefile: Add virStorageSourceIsRAID
virstoragefile: Add quorum in virstoragefile
domain_conf: Read and Write quorum config
qemu: Add quorum support in qemuBuildDriveDevStr
domain: Add virDomainDefHasRAID
qemu: Forbid blocks operations with quorum
qemu: qemuDomainGetBlockInfo quorum support
qemu: qemuDiskPathToAlias quorum support
docs/formatdomain.html.in | 23 ++++-
docs/schemas/domaincommon.rng | 21 +++-
docs/schemas/storagecommon.rng | 1 +
docs/schemas/storagevol.rng | 1 +
src/conf/domain_conf.c | 174 ++++++++++++++++++++++++----------
src/conf/domain_conf.h | 1 +
src/conf/storage_conf.c | 23 +++--
src/libvirt_private.syms | 4 +
src/qemu/qemu_cgroup.c | 4 +-
src/qemu/qemu_command.c | 78 +++++++++++++++
src/qemu/qemu_domain.c | 2 +-
src/qemu/qemu_driver.c | 72 ++++++++++----
src/qemu/qemu_migration.c | 1 +
src/qemu/qemu_monitor_json.c | 4 +-
src/security/security_dac.c | 2 +-
src/security/security_selinux.c | 4 +-
src/security/virt-aa-helper.c | 2 +-
src/storage/storage_backend.c | 24 +++--
src/storage/storage_backend_fs.c | 45 +++++----
src/storage/storage_backend_gluster.c | 11 ++-
src/storage/storage_backend_logical.c | 15 ++-
src/storage/storage_driver.c | 3 +-
src/util/virstoragefile.c | 121 ++++++++++++++++++++---
src/util/virstoragefile.h | 15 ++-
tests/virstoragetest.c | 18 ++--
25 files changed, 518 insertions(+), 151 deletions(-)
--
2.6.2
8 years, 9 months
[libvirt] [PATCH] Miscellaneous for-loop syntax clean-ups
by Martin Kletzander
Checking whether x > 0 before looping over [0..x] items doesn't make
sense and multi-line body must have curly brackets around it.
Best viewed with '-w'.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/conf/domain_conf.c | 24 +++++++++++++-------
src/qemu/qemu_capabilities.c | 30 ++++++++++++------------
src/storage/storage_backend_rbd.c | 48 +++++++++++++++++++--------------------
src/vbox/vbox_common.c | 14 ++++--------
4 files changed, 58 insertions(+), 58 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 56bd1aa99042..3b15cb46d9ec 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -22363,17 +22363,20 @@ virDomainDefFormatInternal(virDomainDefPtr def,
goto error;
}
- for (n = 0; n < def->ngraphics; n++)
+ for (n = 0; n < def->ngraphics; n++) {
if (virDomainGraphicsDefFormat(buf, def->graphics[n], flags) < 0)
goto error;
+ }
- for (n = 0; n < def->nsounds; n++)
+ for (n = 0; n < def->nsounds; n++) {
if (virDomainSoundDefFormat(buf, def->sounds[n], flags) < 0)
goto error;
+ }
- for (n = 0; n < def->nvideos; n++)
+ for (n = 0; n < def->nvideos; n++) {
if (virDomainVideoDefFormat(buf, def->videos[n], flags) < 0)
goto error;
+ }
for (n = 0; n < def->nhostdevs; n++) {
/* If parent.type != NONE, this is just a pointer to the
@@ -22386,16 +22389,18 @@ virDomainDefFormatInternal(virDomainDefPtr def,
}
}
- for (n = 0; n < def->nredirdevs; n++)
+ for (n = 0; n < def->nredirdevs; n++) {
if (virDomainRedirdevDefFormat(buf, def->redirdevs[n], flags) < 0)
goto error;
+ }
if (def->redirfilter)
virDomainRedirFilterDefFormat(buf, def->redirfilter);
- for (n = 0; n < def->nhubs; n++)
+ for (n = 0; n < def->nhubs; n++) {
if (virDomainHubDefFormat(buf, def->hubs[n], flags) < 0)
goto error;
+ }
if (def->watchdog)
virDomainWatchdogDefFormat(buf, def->watchdog, flags);
@@ -22411,17 +22416,20 @@ virDomainDefFormatInternal(virDomainDefPtr def,
if (def->nvram)
virDomainNVRAMDefFormat(buf, def->nvram, flags);
- for (n = 0; n < def->npanics; n++)
+ for (n = 0; n < def->npanics; n++) {
if (virDomainPanicDefFormat(buf, def->panics[n]) < 0)
goto error;
+ }
- for (n = 0; n < def->nshmems; n++)
+ for (n = 0; n < def->nshmems; n++) {
if (virDomainShmemDefFormat(buf, def->shmems[n], flags) < 0)
goto error;
+ }
- for (n = 0; n < def->nmems; n++)
+ for (n = 0; n < def->nmems; n++) {
if (virDomainMemoryDefFormat(buf, def->mems[n], flags) < 0)
goto error;
+ }
virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</devices>\n");
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 3099e344b095..a165ab4be291 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -2772,23 +2772,21 @@ virQEMUCapsLoadCache(virQEMUCapsPtr qemuCaps, const char *filename,
goto cleanup;
}
VIR_DEBUG("Got flags %d", n);
- if (n > 0) {
- for (i = 0; i < n; i++) {
- int flag;
- if (!(str = virXMLPropString(nodes[i], "name"))) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("missing flag name in QEMU capabilities cache"));
- goto cleanup;
- }
- flag = virQEMUCapsTypeFromString(str);
- if (flag < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unknown qemu capabilities flag %s"), str);
- goto cleanup;
- }
- VIR_FREE(str);
- virQEMUCapsSet(qemuCaps, flag);
+ for (i = 0; i < n; i++) {
+ int flag;
+ if (!(str = virXMLPropString(nodes[i], "name"))) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("missing flag name in QEMU capabilities cache"));
+ goto cleanup;
+ }
+ flag = virQEMUCapsTypeFromString(str);
+ if (flag < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unknown qemu capabilities flag %s"), str);
+ goto cleanup;
}
+ VIR_FREE(str);
+ virQEMUCapsSet(qemuCaps, flag);
}
VIR_FREE(nodes);
diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c
index 098b7dc5f0d0..0591eecde26d 100644
--- a/src/storage/storage_backend_rbd.c
+++ b/src/storage/storage_backend_rbd.c
@@ -566,38 +566,36 @@ virStorageBackendRBDCleanupSnapshots(rados_ioctx_t ioctx,
VIR_DEBUG("Found %d snapshots for volume %s/%s", snap_count,
source->name, vol->name);
- if (snap_count > 0) {
- for (i = 0; i < snap_count; i++) {
- if ((r = rbd_snap_is_protected(image, snaps[i].name, &protected)) < 0) {
- virReportSystemError(-r, _("failed to verify if snapshot '%s/%s@%s' is protected"),
- source->name, vol->name,
- snaps[i].name);
- goto cleanup;
- }
-
- if (protected == 1) {
- VIR_DEBUG("Snapshot %s/%s@%s is protected needs to be "
- "unprotected", source->name, vol->name,
- snaps[i].name);
-
- if ((r = rbd_snap_unprotect(image, snaps[i].name)) < 0) {
- virReportSystemError(-r, _("failed to unprotect snapshot '%s/%s@%s'"),
- source->name, vol->name,
- snaps[i].name);
- goto cleanup;
- }
- }
+ for (i = 0; i < snap_count; i++) {
+ if ((r = rbd_snap_is_protected(image, snaps[i].name, &protected)) < 0) {
+ virReportSystemError(-r, _("failed to verify if snapshot '%s/%s@%s' is protected"),
+ source->name, vol->name,
+ snaps[i].name);
+ goto cleanup;
+ }
- VIR_DEBUG("Removing snapshot %s/%s@%s", source->name,
- vol->name, snaps[i].name);
+ if (protected == 1) {
+ VIR_DEBUG("Snapshot %s/%s@%s is protected needs to be "
+ "unprotected", source->name, vol->name,
+ snaps[i].name);
- if ((r = rbd_snap_remove(image, snaps[i].name)) < 0) {
- virReportSystemError(-r, _("failed to remove snapshot '%s/%s@%s'"),
+ if ((r = rbd_snap_unprotect(image, snaps[i].name)) < 0) {
+ virReportSystemError(-r, _("failed to unprotect snapshot '%s/%s@%s'"),
source->name, vol->name,
snaps[i].name);
goto cleanup;
}
}
+
+ VIR_DEBUG("Removing snapshot %s/%s@%s", source->name,
+ vol->name, snaps[i].name);
+
+ if ((r = rbd_snap_remove(image, snaps[i].name)) < 0) {
+ virReportSystemError(-r, _("failed to remove snapshot '%s/%s@%s'"),
+ source->name, vol->name,
+ snaps[i].name);
+ goto cleanup;
+ }
}
ret = 0;
diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
index 067ed97cf1cb..5302d1ce80eb 100644
--- a/src/vbox/vbox_common.c
+++ b/src/vbox/vbox_common.c
@@ -5541,11 +5541,9 @@ vboxDomainSnapshotGet(vboxGlobalData *data,
}
cleanup:
- if (count > 0) {
- for (i = 0; i < count; i++) {
- if (snapshots[i] != snapshot)
- VBOX_RELEASE(snapshots[i]);
- }
+ for (i = 0; i < count; i++) {
+ if (snapshots[i] != snapshot)
+ VBOX_RELEASE(snapshots[i]);
}
VIR_FREE(snapshots);
return snapshot;
@@ -6255,10 +6253,8 @@ static int vboxDomainSnapshotListNames(virDomainPtr dom, char **names,
ret = nameslen;
cleanup:
- if (count > 0) {
- for (i = 0; i < count; i++)
- VBOX_RELEASE(snapshots[i]);
- }
+ for (i = 0; i < count; i++)
+ VBOX_RELEASE(snapshots[i]);
VIR_FREE(snapshots);
VBOX_RELEASE(machine);
vboxIIDUnalloc(&iid);
--
2.7.1
8 years, 9 months
[libvirt] [PATCH 0/2] Introduce safewrite_str
by Ján Tomko
Ján Tomko (2):
vsh: use virBufferTrim in vshOutputLogFile
Introduce safewrite_str
src/conf/virchrdev.c | 2 +-
src/libvirt_private.syms | 1 +
src/lxc/lxc_process.c | 4 ++--
src/network/leaseshelper.c | 2 +-
src/openvz/openvz_conf.c | 15 ++++++---------
src/qemu/qemu_domain.c | 2 +-
src/util/vircommand.c | 4 ++--
src/util/virfile.c | 9 ++++++++-
src/util/virfile.h | 1 +
src/util/virlog.c | 6 +++---
src/util/virpidfile.c | 4 ++--
src/util/virxml.c | 17 ++++++-----------
tools/vsh.c | 9 ++-------
13 files changed, 36 insertions(+), 40 deletions(-)
--
2.4.10
8 years, 9 months
[libvirt] [PATCH 0/3] Couple of coverity fixes
by Michal Privoznik
All of these were spotted by coverity tool.
Michal Privoznik (3):
vbox: Avoid signed and unsigned comparison
xen: Check return value of virStringReplace
qemuBuildCommandLine: Change the condition for -nographics
src/qemu/qemu_command.c | 2 +-
src/vbox/vbox_common.c | 8 +++-----
src/xenconfig/xen_xl.c | 7 ++++++-
3 files changed, 10 insertions(+), 7 deletions(-)
--
2.4.10
8 years, 9 months
[libvirt] [PATCH] docs: Try harder to uninstall
by Michal Privoznik
Imagine you have partially installed libvirt, or maybe you're
just running 'make uninstall' from a different version than 'make
install' has been ran. One way or another, we are doing plain
'rm' instead of 'rm -f' and thus not trying hard enough when
uninstalling. In the rest of our code we stick with -f switch. Do
that for docs too.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
docs/Makefile.am | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 02eca64..1b4353b 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -366,8 +366,8 @@ install-data-local:
$(INSTALL_DATA) $(srcdir)/libvirtLogo.png $(DESTDIR)$(pkgdatadir)
uninstall-local:
- for h in $(apihtml); do rm $(DESTDIR)$(HTML_DIR)/$$h; done
- for p in $(apipng); do rm $(DESTDIR)$(HTML_DIR)/$$p; done
+ for h in $(apihtml); do rm -f $(DESTDIR)$(HTML_DIR)/$$h; done
+ for p in $(apipng); do rm -f $(DESTDIR)$(HTML_DIR)/$$p; done
for f in $(devhelphtml) $(devhelppng) $(devhelpcss); do \
- rm $(DESTDIR)$(DEVHELP_DIR)/$$(basename $$f); \
+ rm -f $(DESTDIR)$(DEVHELP_DIR)/$$(basename $$f); \
done
--
2.4.10
8 years, 9 months