[libvirt] [PATCH] Introduce virFilePrintf() as a portable fprintf()
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
We can't use GNULIB's fprintf-posix due to licensing
incompatibilities. We do already have a portable
formatting via virAsprintf() which we got from GNULIB
though. We can use to create a virFilePrintf() function.
But really gnulib could just provide a 'fprintf'
module, that depended on just its 'asprintf' module.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/libvirt_private.syms | 1 +
src/util/virfile.c | 35 +++++++++++++++++++++++++++++++++++
src/util/virfile.h | 3 +++
tests/fdstreamtest.c | 38 +++++++++++++++++++-------------------
tests/virstringtest.c | 34 +++++++++++++++++-----------------
5 files changed, 75 insertions(+), 36 deletions(-)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 392357f..5365827 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1302,6 +1302,7 @@ virFileMatchesNameSuffix;
virFileNBDDeviceAssociate;
virFileOpenAs;
virFileOpenTty;
+virFilePrintf;
virFileReadAll;
virFileReadLimFD;
virFileResolveAllLinks;
diff --git a/src/util/virfile.c b/src/util/virfile.c
index 4637919..42607c7 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -2322,3 +2322,38 @@ virFileSanitizePath(const char *path)
return cleanpath;
}
+
+
+/**
+ * virFilePrintf:
+ *
+ * A replacement for fprintf() which uses virVasprintf to
+ * ensure that portable string format placeholders can be
+ * used, since gnulib's fprintf() replacement is not
+ * LGPLV2+ compatible
+ */
+int virFilePrintf(FILE *fp, const char *msg, ...)
+{
+ va_list vargs;
+ char *str;
+ int ret;
+
+ va_start(vargs, msg);
+
+ if ((ret = virVasprintf(&str, msg, vargs)) < 0)
+ goto cleanup;
+
+ if (fwrite(str, 1, ret, fp) != ret) {
+ virReportSystemError(errno, "%s",
+ _("Could not write to stream"));
+ ret = -1;
+ }
+
+ VIR_FREE(str);
+
+cleanup:
+ va_end(vargs);
+
+ return ret;
+}
+
diff --git a/src/util/virfile.h b/src/util/virfile.h
index beaad86..72d35ce 100644
--- a/src/util/virfile.h
+++ b/src/util/virfile.h
@@ -229,4 +229,7 @@ void virFileWaitForDevices(void);
virBuildPathInternal(path, __VA_ARGS__, NULL)
int virBuildPathInternal(char **path, ...) ATTRIBUTE_SENTINEL;
+int virFilePrintf(FILE *fp, const char *msg, ...)
+ ATTRIBUTE_FMT_PRINTF(2, 3);
+
#endif /* __VIR_FILE_H */
diff --git a/tests/fdstreamtest.c b/tests/fdstreamtest.c
index 9f780c9..edfda6a 100644
--- a/tests/fdstreamtest.c
+++ b/tests/fdstreamtest.c
@@ -105,16 +105,16 @@ static int testFDStreamReadCommon(const char *scratchdir, bool blocking)
usleep(20 * 1000);
goto reread;
}
- fprintf(stderr, "Failed to read stream: %s\n",
- virGetLastErrorMessage());
+ virFilePrintf(stderr, "Failed to read stream: %s\n",
+ virGetLastErrorMessage());
goto cleanup;
}
if (got == 0) {
/* Expect EOF 1/2 through last pattern */
if (i == 9 && want == (PATTERN_LEN / 2))
break;
- fprintf(stderr, "Unexpected EOF block %zu want %zu\n",
- i, want);
+ virFilePrintf(stderr, "Unexpected EOF block %zu want %zu\n",
+ i, want);
goto cleanup;
}
offset += got;
@@ -122,25 +122,25 @@ static int testFDStreamReadCommon(const char *scratchdir, bool blocking)
}
if (i == 0) {
if (memcmp(buf, pattern + (PATTERN_LEN / 2), PATTERN_LEN / 2) != 0) {
- fprintf(stderr, "Mismatched pattern data iteration %zu\n", i);
+ virFilePrintf(stderr, "Mismatched pattern data iteration %zu\n", i);
goto cleanup;
}
} else if (i == 9) {
if (memcmp(buf, pattern, PATTERN_LEN / 2) != 0) {
- fprintf(stderr, "Mismatched pattern data iteration %zu\n", i);
+ virFilePrintf(stderr, "Mismatched pattern data iteration %zu\n", i);
goto cleanup;
}
} else {
if (memcmp(buf, pattern, PATTERN_LEN) != 0) {
- fprintf(stderr, "Mismatched pattern data iteration %zu\n", i);
+ virFilePrintf(stderr, "Mismatched pattern data iteration %zu\n", i);
goto cleanup;
}
}
}
if (st->driver->streamFinish(st) != 0) {
- fprintf(stderr, "Failed to finish stream: %s\n",
- virGetLastErrorMessage());
+ virFilePrintf(stderr, "Failed to finish stream: %s\n",
+ virGetLastErrorMessage());
goto cleanup;
}
@@ -229,8 +229,8 @@ static int testFDStreamWriteCommon(const char *scratchdir, bool blocking)
if (i == 9 &&
want == (PATTERN_LEN / 2))
break;
- fprintf(stderr, "Failed to write stream: %s\n",
- virGetLastErrorMessage());
+ virFilePrintf(stderr, "Failed to write stream: %s\n",
+ virGetLastErrorMessage());
goto cleanup;
}
offset += got;
@@ -239,8 +239,8 @@ static int testFDStreamWriteCommon(const char *scratchdir, bool blocking)
}
if (st->driver->streamFinish(st) != 0) {
- fprintf(stderr, "Failed to finish stream: %s\n",
- virGetLastErrorMessage());
+ virFilePrintf(stderr, "Failed to finish stream: %s\n",
+ virGetLastErrorMessage());
goto cleanup;
}
@@ -255,7 +255,7 @@ static int testFDStreamWriteCommon(const char *scratchdir, bool blocking)
want = PATTERN_LEN;
if (saferead(fd, buf, want) != want) {
- fprintf(stderr, "Short read from data\n");
+ virFilePrintf(stderr, "Short read from data\n");
goto cleanup;
}
@@ -263,22 +263,22 @@ static int testFDStreamWriteCommon(const char *scratchdir, bool blocking)
size_t j;
for (j = 0 ; j < (PATTERN_LEN / 2) ; j++) {
if (buf[j] != 0) {
- fprintf(stderr, "Mismatched pattern data iteration %zu\n", i);
+ virFilePrintf(stderr, "Mismatched pattern data iteration %zu\n", i);
goto cleanup;
}
}
if (memcmp(buf + (PATTERN_LEN / 2), pattern, PATTERN_LEN / 2) != 0) {
- fprintf(stderr, "Mismatched pattern data iteration %zu\n", i);
+ virFilePrintf(stderr, "Mismatched pattern data iteration %zu\n", i);
goto cleanup;
}
} else if (i == 9) {
if (memcmp(buf, pattern, PATTERN_LEN / 2) != 0) {
- fprintf(stderr, "Mismatched pattern data iteration %zu\n", i);
+ virFilePrintf(stderr, "Mismatched pattern data iteration %zu\n", i);
goto cleanup;
}
} else {
if (memcmp(buf, pattern, PATTERN_LEN) != 0) {
- fprintf(stderr, "Mismatched pattern data iteration %zu\n", i);
+ virFilePrintf(stderr, "Mismatched pattern data iteration %zu\n", i);
goto cleanup;
}
}
@@ -324,7 +324,7 @@ mymain(void)
virFDStreamSetIOHelper(iohelper);
if (!mkdtemp(scratchdir)) {
- fprintf(stderr, "Cannot create fakesysfsdir");
+ virFilePrintf(stderr, "Cannot create fakesysfsdir");
abort();
}
diff --git a/tests/virstringtest.c b/tests/virstringtest.c
index da06c0f..98f0a56 100644
--- a/tests/virstringtest.c
+++ b/tests/virstringtest.c
@@ -25,8 +25,8 @@
#include "testutils.h"
#include "virerror.h"
#include "viralloc.h"
+#include "virfile.h"
#include "virlog.h"
-
#include "virstring.h"
#define VIR_FROM_THIS VIR_FROM_NONE
@@ -62,18 +62,18 @@ static int testSplit(const void *args)
tmp2 = data->tokens;
while (*tmp1 && *tmp2) {
if (STRNEQ(*tmp1, *tmp2)) {
- fprintf(stderr, "Mismatch '%s' vs '%s'\n", *tmp1, *tmp2);
+ virFilePrintf(stderr, "Mismatch '%s' vs '%s'\n", *tmp1, *tmp2);
goto cleanup;
}
tmp1++;
tmp2++;
}
if (*tmp1) {
- fprintf(stderr, "Too many pieces returned\n");
+ virFilePrintf(stderr, "Too many pieces returned\n");
goto cleanup;
}
if (*tmp2) {
- fprintf(stderr, "Too few pieces returned\n");
+ virFilePrintf(stderr, "Too few pieces returned\n");
goto cleanup;
}
@@ -96,7 +96,7 @@ static int testJoin(const void *args)
return -1;
}
if (STRNEQ(got, data->string)) {
- fprintf(stderr, "Mismatch '%s' vs '%s'\n", got, data->string);
+ virFilePrintf(stderr, "Mismatch '%s' vs '%s'\n", got, data->string);
goto cleanup;
}
@@ -143,49 +143,49 @@ testStrdup(const void *data ATTRIBUTE_UNUSED)
value = VIR_STRDUP(array[i++], testStrdupLookup1(j++));
if (value != 1) {
- fprintf(stderr, "unexpected strdup result %d, expected 1\n", value);
+ virFilePrintf(stderr, "unexpected strdup result %d, expected 1\n", value);
goto cleanup;
}
if (i != 1) {
- fprintf(stderr, "unexpected side effects i=%zu, expected 1\n", i);
+ virFilePrintf(stderr, "unexpected side effects i=%zu, expected 1\n", i);
goto cleanup;
}
if (j != 1) {
- fprintf(stderr, "unexpected side effects j=%zu, expected 1\n", j);
+ virFilePrintf(stderr, "unexpected side effects j=%zu, expected 1\n", j);
goto cleanup;
}
if (STRNEQ_NULLABLE(array[0], "hello") || array[1]) {
- fprintf(stderr, "incorrect array contents '%s' '%s'\n",
- NULLSTR(array[0]), NULLSTR(array[1]));
+ virFilePrintf(stderr, "incorrect array contents '%s' '%s'\n",
+ NULLSTR(array[0]), NULLSTR(array[1]));
goto cleanup;
}
value = VIR_STRNDUP(array[i++], testStrdupLookup1(j++),
testStrdupLookup2(k++));
if (value != 0) {
- fprintf(stderr, "unexpected strdup result %d, expected 0\n", value);
+ virFilePrintf(stderr, "unexpected strdup result %d, expected 0\n", value);
goto cleanup;
}
if (i != 2) {
- fprintf(stderr, "unexpected side effects i=%zu, expected 2\n", i);
+ virFilePrintf(stderr, "unexpected side effects i=%zu, expected 2\n", i);
goto cleanup;
}
if (j != 2) {
- fprintf(stderr, "unexpected side effects j=%zu, expected 2\n", j);
+ virFilePrintf(stderr, "unexpected side effects j=%zu, expected 2\n", j);
goto cleanup;
}
if (k != 1) {
- fprintf(stderr, "unexpected side effects k=%zu, expected 1\n", k);
+ virFilePrintf(stderr, "unexpected side effects k=%zu, expected 1\n", k);
goto cleanup;
}
if (STRNEQ_NULLABLE(array[0], "hello") || array[1]) {
- fprintf(stderr, "incorrect array contents '%s' '%s'\n",
- NULLSTR(array[0]), NULLSTR(array[1]));
+ virFilePrintf(stderr, "incorrect array contents '%s' '%s'\n",
+ NULLSTR(array[0]), NULLSTR(array[1]));
goto cleanup;
}
if (fail) {
- fprintf(stderr, "side effects failed\n");
+ virFilePrintf(stderr, "side effects failed\n");
goto cleanup;
}
--
1.8.1.4
11 years, 5 months
[libvirt] [PATCH] Document that runtime changes may be lost after S4 suspend
by Jiri Denemark
---
src/libvirt.c | 7 +++++++
tools/virsh.pod | 7 +++++++
2 files changed, 14 insertions(+)
diff --git a/src/libvirt.c b/src/libvirt.c
index b129611..6967613 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -2472,6 +2472,13 @@ error:
* Dependent on hypervisor used, this may require a
* guest agent to be available, e.g. QEMU.
*
+ * Beware that at least for QEMU, the domain's process will be terminated
+ * when VIR_NODE_SUSPEND_TARGET_DISK is used and a new process will be
+ * launched when libvirt is asked to wake up the domain. As a result of
+ * this, any runtime changes, such as device hotplug or memory settings,
+ * are lost unless such changes were made with VIR_DOMAIN_AFFECT_CONFIG
+ * flag.
+ *
* Returns: 0 on success,
* -1 on failure.
*/
diff --git a/tools/virsh.pod b/tools/virsh.pod
index 11984bc..7c8ce18 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -1680,6 +1680,13 @@ hypervisor driver and 0 should be used.).
Note that this command requires a guest agent configured and running in the
domain's guest OS.
+Beware that at least for QEMU, the domain's process will be terminated when
+target disk is used and a new process will be launched when libvirt is asked
+to wake up the domain. As a result of this, any runtime changes, such as
+device hotplug or memory settings, are lost unless such changes were made
+with I<--config> flag.
+
+
=item B<dompmwakeup> I<domain>
Wakeup a domain from pmsuspended state (either suspended by dompmsuspend or
--
1.8.2.1
11 years, 5 months
[libvirt] [PATCH] libxl: allow an <emulator> to be selected in the domain config XML
by David Scott
The emulator path supplied can be any valid path on the system.
Note that when setting a device_model, libxl needs us to set the
device_model_version too. The device_model_version can be either
...QEMU_XEN: meaning "upstream qemu", the default in xen-4.3 onwards
...QEMU_XEN_TRADITIONAL: the old xen-specific fork
We detect the device_model_version by examining the qemu filename:
if it is "qemu-dm" then it's the old xen-specific fork. If anything
else then we assume "upstream qemu" (whose filename may change
in future). Note that if you are using a wrapper script to (eg)
adjust the arguments of the old qemu during development, you will
have to ensure the wrapper script also has the name "qemu-dm", by
placing it in a separate directory.
Signed-off-by: David Scott <dave.scott(a)eu.citrix.com>
---
src/libxl/libxl_conf.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 44 insertions(+), 0 deletions(-)
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 7e0753a..2aa5a62 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -788,6 +788,46 @@ libxlMakeCapabilities(libxl_ctx *ctx)
}
int
+libxlMakeEmulator(virDomainDefPtr def, libxl_domain_config *d_config)
+{
+ /* No explicit override means use the default */
+ if (!def->emulator) {
+ return 0;
+ }
+
+ if (!virFileExists(def->emulator)) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("emulator '%s' not found"),
+ def->emulator);
+ return -1;
+ }
+
+ VIR_FREE(d_config->b_info.device_model);
+ if ((d_config->b_info.device_model = strdup(def->emulator)) == NULL) {
+ virReportOOMError();
+ return -1;
+ }
+
+ /* N.B. from xen/tools/libxl/libxl_types.idl:
+ * "If setting device_model you must set device_model_version too."
+ *
+ * The xen-4.3 and later default is "upstream qemu" (QEMU_XEN)
+ * so we make that the default and special-case the old-style
+ * "traditional qemu" (QEMU_XEN_TRADITIONAL)
+ */
+
+ d_config->b_info.device_model_version =
+ LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN;
+
+ if (STREQ(basename(def->emulator), "qemu-dm"))
+ d_config->b_info.device_model_version =
+ LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
+
+ return 0;
+}
+
+
+int
libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
virDomainDefPtr def, libxl_domain_config *d_config)
{
@@ -811,6 +851,10 @@ libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
goto error;
}
+ if (libxlMakeEmulator(def, d_config) < 0) {
+ goto error;
+ }
+
d_config->on_reboot = def->onReboot;
d_config->on_poweroff = def->onPoweroff;
d_config->on_crash = def->onCrash;
--
1.7.1
11 years, 5 months
[libvirt] [PATCH] qemu: escape literal IPv6 address in NBD migration
by Ján Tomko
A literal IPv6 must be escaped, otherwise migration fails with:
unable to execute QEMU command 'drive-mirror': address resolution failed
for f0::0d:5901: Servname not supported for ai_socktype
since QEMU treats everything after the first ':' as the port.
---
src/qemu/qemu_migration.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index ffc86a4..7aa0476 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -1193,6 +1193,7 @@ qemuMigrationDriveMirror(virQEMUDriverPtr driver,
size_t i, lastGood = 0;
char *diskAlias = NULL;
char *nbd_dest = NULL;
+ char *hoststr = NULL;
unsigned int mirror_flags = VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT;
virErrorPtr err = NULL;
@@ -1212,6 +1213,16 @@ qemuMigrationDriveMirror(virQEMUDriverPtr driver,
port = mig->nbd->port;
mig->nbd->port = 0;
+ /* escape literal IPv6 address */
+ if (strchr(host, ':')) {
+ if (virAsprintf(&hoststr, "[%s]", host) < 0) {
+ virReportOOMError();
+ goto error;
+ }
+ } else if (VIR_STRDUP(hoststr, host) < 0) {
+ goto error;
+ }
+
if (*migrate_flags & QEMU_MONITOR_MIGRATE_NON_SHARED_INC)
mirror_flags |= VIR_DOMAIN_BLOCK_REBASE_SHALLOW;
@@ -1228,7 +1239,7 @@ qemuMigrationDriveMirror(virQEMUDriverPtr driver,
if ((virAsprintf(&diskAlias, "%s%s",
QEMU_DRIVE_HOST_PREFIX, disk->info.alias) < 0) ||
(virAsprintf(&nbd_dest, "nbd:%s:%d:exportname=%s",
- host, port, diskAlias) < 0)) {
+ hoststr, port, diskAlias) < 0)) {
virReportOOMError();
goto error;
}
@@ -1297,6 +1308,7 @@ qemuMigrationDriveMirror(virQEMUDriverPtr driver,
cleanup:
VIR_FREE(diskAlias);
VIR_FREE(nbd_dest);
+ VIR_FREE(hoststr);
return ret;
error:
--
1.8.1.5
11 years, 5 months
[libvirt] [PATCH] Check for existence of interface prior to setting terminate flag
by John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=903480
During domain destruction it's possible that the learnIPAddressThread has
already removed the interface prior to the teardown filter path being run.
The teardown code would only be telling the thread to terminate.
---
src/nwfilter/nwfilter_learnipaddr.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/nwfilter/nwfilter_learnipaddr.c b/src/nwfilter/nwfilter_learnipaddr.c
index 2b49333..c56d119 100644
--- a/src/nwfilter/nwfilter_learnipaddr.c
+++ b/src/nwfilter/nwfilter_learnipaddr.c
@@ -251,6 +251,14 @@ virNWFilterTerminateLearnReq(const char *ifname) {
int ifindex;
virNWFilterIPAddrLearnReqPtr req;
+ /* It's possible that it's already be removed as a result of
+ * virNWFilterDeregisterLearnReq during learnIPAddressThread() exit
+ */
+ if (virNetDevExists(ifname) != 1) {
+ virResetLastError();
+ return 0;
+ }
+
if (virNetDevGetIndex(ifname, &ifindex) < 0) {
virResetLastError();
return rc;
--
1.8.1.4
11 years, 5 months
[libvirt] Information needed about "virsh # cpu-stats test_vm"
by Anusha Rayani
Hi,
We are implementing feature called CPU separation in the platform. So,
guest VMs will have dedicated cores allocated using cgroups (cgroups
hierachy related VMs managed by libvirt).
virsh cpu-stats command is not working in our platform :
virsh # cpu-stats test_vm
error: Failed to virDomainGetCPUStats()
error: Requested operation is not valid: cgroup CPUACCT controller is not
mounted
It should show info like this.
$ virsh cpu-stats test_vm
CPU0:
cpu_time 0.025812184 seconds
vcpu_time 0.025812184 seconds
CPU1:
cpu_time 4.893484927 seconds
vcpu_time 4.893484927 seconds
Total:
cpu_time 4.924620941 seconds
user_time 1.060000000 seconds
system_time 3.050000000 seconds
We are suspecting some issue in virsh when it is trying to find to where
that cgroups is mounted in a system (default in ubuntu is
/sys/fs/cgroup/cpuset/libvirt/, but in our platform uses /dev/cgroup_xxx).
Find /proc/cgroups and /proc/mounts log below:
==================================
# cat /proc/cgroups
#subsys_name hierarchy num_cgroups enabled
cpuset 0 1 1
ns 0 1 1
cpu 1 3 1
cpuacct 0 1 1
memory 2 1 1
freezer 0 1 1
net_cls 0 1 1
blkio 0 1 1
# cat /proc/mounts
cpu /dev/cgroup_cpu cgroup rw,relatime,cpu 0 0
memory /dev/cgroup_mem cgroup rw,relatime,memory 0 0
Can you please help us in this regard to enable this command in our
platform,
Thanks in advance !!!
Regards,
Anusha
11 years, 5 months
[libvirt] [PATCH] Resolve memory leak found by valgrind
by John Ferlan
Commit '6afdfc8e' adjusted the exit and error paths to go through the error
and cleanup labels, but neglected to remove the return ret prior to cleanup.
Also noted the 'type' xml string fetch was never checked for NULL which
could lead to some interesting results.
---
src/conf/storage_conf.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index f0ea41d..94eb69a 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -834,6 +834,12 @@ virStoragePoolDefParseXML(xmlXPathContextPtr ctxt)
}
type = virXPathString("string(./@type)", ctxt);
+ if (type == NULL) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("storage pool missing type attribute"));
+ goto error;
+ }
+
if ((ret->type = virStoragePoolTypeFromString(type)) < 0) {
virReportError(VIR_ERR_XML_ERROR,
_("unknown storage pool type %s"), type);
@@ -956,8 +962,6 @@ virStoragePoolDefParseXML(xmlXPathContextPtr ctxt)
goto error;
}
- return ret;
-
cleanup:
VIR_FREE(uuid);
VIR_FREE(type);
--
1.8.1.4
11 years, 5 months
[libvirt] [PATCH] qemu: snapshot: Don't kill access to disk if snapshot creation fails
by Peter Krempa
If snapshot creation failed for example due to invalid use of the
"REUSE_EXTERNAL" flag, libvirt killed access to the original image file
instead of the new image file. On machines with selinux this kills the
whole VM as the selinux context is enforced immediately.
* qemu_driver.c:qemuDomainSnapshotUndoSingleDiskActive():
- Kill access to the new image file instead of the old one.
Partially resolves: https://bugzilla.redhat.com/show_bug.cgi?id=906639
---
src/qemu/qemu_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index e638e7c..5ca0fd4 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -11309,7 +11309,7 @@ qemuDomainSnapshotUndoSingleDiskActive(virQEMUDriverPtr driver,
(persistDisk && VIR_STRDUP(persistSource, source) < 0))
goto cleanup;
- qemuDomainPrepareDiskChainElement(driver, vm, disk, origdisk->src,
+ qemuDomainPrepareDiskChainElement(driver, vm, disk, disk->src,
VIR_DISK_CHAIN_NO_ACCESS);
if (need_unlink && stat(disk->src, &st) == 0 &&
S_ISREG(st.st_mode) && unlink(disk->src) < 0)
--
1.8.2.1
11 years, 5 months
[libvirt] [PATCH] qemu: Fix damaged whitespace
by Peter Krempa
After deleting "WithDriver" from the async job function the code was
unaligned.
---
Notes:
Pushed as trivial.
src/qemu/qemu_driver.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d0dee14..e638e7c 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -11460,8 +11460,7 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn,
int thaw = 0; /* 1 if freeze succeeded, -1 if freeze failed */
bool pmsuspended = false;
- if (qemuDomainObjBeginAsyncJob(driver, vm,
- QEMU_ASYNC_JOB_SNAPSHOT) < 0)
+ if (qemuDomainObjBeginAsyncJob(driver, vm, QEMU_ASYNC_JOB_SNAPSHOT) < 0)
goto cleanup;
/* If quiesce was requested, then issue a freeze command, and a
--
1.8.2.1
11 years, 5 months
[libvirt] [PATCH] Properly indent function's opening bracket
by Martin Kletzander
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
Notes:
Pushed as 'trivial'
src/storage/storage_backend_fs.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c
index 1379f17..1a85afc 100644
--- a/src/storage/storage_backend_fs.c
+++ b/src/storage/storage_backend_fs.c
@@ -1089,7 +1089,8 @@ static int
virStorageBackendFileSystemVolBuild(virConnectPtr conn,
virStoragePoolObjPtr pool,
virStorageVolDefPtr vol,
- unsigned int flags) {
+ unsigned int flags)
+{
virCheckFlags(VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA, -1);
return _virStorageBackendFileSystemVolBuild(conn, pool, vol, NULL, flags);
--
1.8.2.1
11 years, 5 months