[libvirt] [PATCH] docs: add VMmanager to web apps
by Martin Kletzander
This is a request for adding a VMmanager application as requested and
described by Ksenya Phil.
Signed-off-by: Ksenya Phil <philka2003(a)mail.ru>
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
docs/apps.html.in | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/docs/apps.html.in b/docs/apps.html.in
index 7b581db..86e45fc 100644
--- a/docs/apps.html.in
+++ b/docs/apps.html.in
@@ -393,6 +393,15 @@
with FreeIPA for Kerberos authentication, and in the future,
certificate management.
</dd>
+ <dt><a href="http://ispsystem.com/en/software/vmmanager">VMmanager</a></dt>
+ <dd>
+ VMmanager is a software solution for virtualization management
+ that can be used both for hosting virtual machines and
+ building a cloud. VMmanager can manage not only one server,
+ but a large cluster of hypervisors. It delivers a number of
+ functions, such as live migration that allows for load
+ balancing between cluster nodes, monitoring CPU, memory.
+ </dd>
</dl>
<h2><a name="mobile">Mobile applications</a></h2>
--
1.9.0
10 years, 8 months
[libvirt] [PATCH v14 00/49] write separate module for hostdev passthrough
by Chunyan Liu
These patches implements a separate module for hostdev passthrough so that it
could be shared by different drivers and can maintain a global state of a host
device.
Patch 1: fix memory leak in virscsi.c
Patch 2: improve virHostdevManager to use virOject wrapper and keep reference
Patches 3~7: switch existing qemu and lxc driver to use virHostdevManager's
lists, so that to maintain a global state of every host device.
Patches 8~45 are to extract general code from qemu_hostdev.c piece by piece,
make them reusable common APIs.
Patches 46: unit test for the virhostdev common library
Patches 47: add a hostdev backend type for xen
Patches 48: add pci passthrough to libxl driver based on the common library
Patches 49: change lxc to use common library APIs
---
changes to v13:
* change virHostdevManager, use virObject and keep reference, solve 'free'
problem
* add .hostdevMgr to qemu/lxc/libxl driver, get virHostdevManager in
StateInitialize for once and keep reference, instead of getting it every
time virHostdevManager is used.
* fix v13 3/49 "qemu-reuse-hostdev-interfaces-to-avoid-duplicate.patch":
update qemuPrepareHostUSBDevices parameters to specify hostdevs and
nhostdevs, so that could be reused in qemu_hotplug.
* rebase left patches
Chunyan Liu (49):
virscsi: fix memory leak
virhostdev: use virObject to virHostdevManager to keep reference
update qemuPrepareHostUSBDevices parameters to keep consistency
qemu: reuse hostdev interfaces to avoid duplicate
qemu: remove functions used internally only from qemu_hostdev.h
qemu: use general virhostdev lists instead of its own
lxc: use general virhostdev lists instead of its own
qemu_hostdev: move cfg->relaxedACS as a flag
qemu_hostdev: move ColdBoot as a flag
qemu_hostdev: move netconfig file location to virhostdev stateDir
extract general code from qemuPrepareHostdevPCIDevices
rename qemu*NetConfigRestore/Replace to
virHostdevNetConfigRestore/Replace
rename qemuGet*PciHostDeviceList to virHostdevGet*PciHostDeviceList
pass driver name as a parameter to virHostdevPrepareHostdevPCIDevices
extract general code from qemuDomainReAttachHostdevDevices
pass driver name as a parameter to virHostdevReAttachPCIDevices
rename qemuReAttachPciDevice to virHostdevReAttachPciDevice
move virHostdevPrepare(ReAttach)PCIDevices to virhostdev.c
extract general code from qemuUpdateActivePciHostdevs
extract general code from qemuUpdateActiveUsbHostdevs
extract general code from qemuUpdateActiveScsiHostdevs
pass driver_name as parameter of virHostdevUpdate*Hostdevs functions
move virHostdevUpdate* functions to virhostdev.c
extract general code from qemuPrepareHostUSBDevices
rename qemu*USBDevices to virHostdev*USBDevices
pass driver name to virHostdevPrepareUSBDevices
move virHostdevPrepareHostUSBDevices to virhostdev.c
extract general code from qemuPrepareHostSCSIDevices
pass driver name as parameter to virHostdevPrepareSCSIDevices
move virHostdevPrepareHostSCSIDevices to virhostdev.c
extract general code from qemuDomainReAttachHostUsbDevices
pass driver name as paramter to virHostdevReAttachUsbHostdevs
move virHostdevReAttachUsbHostdevs to virhostdev.c
extract general code from qemuDomainReAttachHostScsiDevices
pass driver name as parameter to virHostdevReAttachScciHostdevs
move virHostdevReAttachHostScsiDevices to virhostdev.c
extract general code of NodeDeviceDetach
extract general code of NodeDeviceReAttach
extract general code of NodeDeviceReset
move virHostdevNodeDevice* to virhostdev.c
improve parameter name to let it more meaningful
rename some function names to keep consistency
improve virHostdevUpdate* parameters to make it more widely used
add 3 wrapper functions for prepare/reattach/update domain hostdevs
add parameter checks to common interfaces
add unit test for new virhostdev common library
change lxc_hostdev.c to use virhostdev common library APIs
add hostdev pci backend type for xen
add pci passthrough to libxl driver
.gitignore | 1 +
docs/schemas/domaincommon.rng | 1 +
src/conf/domain_conf.c | 3 +-
src/conf/domain_conf.h | 1 +
src/libvirt_private.syms | 15 +
src/libxl/libxl_conf.c | 63 ++
src/libxl/libxl_conf.h | 7 +-
src/libxl/libxl_domain.c | 9 +
src/libxl/libxl_driver.c | 454 +++++++++++-
src/lxc/lxc_conf.h | 5 +-
src/lxc/lxc_driver.c | 12 +-
src/lxc/lxc_hostdev.c | 307 +-------
src/qemu/qemu_command.c | 3 +-
src/qemu/qemu_conf.h | 9 +-
src/qemu/qemu_driver.c | 76 +-
src/qemu/qemu_hostdev.c | 1203 ++-----------------------------
src/qemu/qemu_hostdev.h | 29 +-
src/qemu/qemu_hotplug.c | 78 +-
src/qemu/qemu_process.c | 8 +-
src/util/virhostdev.c | 1565 ++++++++++++++++++++++++++++++++++++++++-
src/util/virhostdev.h | 96 +++
src/util/virscsi.c | 13 +-
tests/Makefile.am | 5 +
tests/virhostdevtest.c | 507 +++++++++++++
24 files changed, 2832 insertions(+), 1638 deletions(-)
create mode 100644 tests/virhostdevtest.c
--
1.9.0
10 years, 8 months
[libvirt] libvirt: [PATCH] libxl: Check for control_d string to decide about dom0
by Stefan Bader
I have been looking into a bug report (see BugLink) which reported
libvirt to fail starting inside a Xen guest. Upon further investigation
I found that some tools that help monitoring Xen guests will mount
xenfs to /proc/xen. This will create a capabilities files there even
if the guest is not dom0. However it will return nothing when reading
from it.
Ian, just to sanity check myself. I looked at the xenfs code and to
me there only seem to be those two outcomes (either "control_d" for
running in dom0 or notrhing if not).
With the following patch applied, libvirt starts up correctly in
the normal guests (with xenfs mounted) without initializing libxl.
And also in dom0 where it still enables the libxl driver (if the
xl toolstack is selected).
-Stefan
>From f11949caca6dfe1a802472a2a6d4fe760115ccc6 Mon Sep 17 00:00:00 2001
From: Stefan Bader <stefan.bader(a)canonical.com>
Date: Wed, 12 Mar 2014 11:37:16 +0100
Subject: [PATCH] libxl: Check for control_d string to decide about dom0
As soon as any guest mounts xenfs to /proc/xen, there is a capabilities
file in that directory. However it returns nothing when reading from it.
Change the test to actually check the contents of the file.
BugLink: http://bugs.launchpad.net/bugs/1248025
Signed-off-by: Stefan Bader <stefan.bader(a)canonical.com>
---
src/libxl/libxl_driver.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 65d80a2..844e828 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -944,6 +944,7 @@ libxlDriverShouldLoad(bool privileged)
bool ret = false;
virCommandPtr cmd;
int status;
+ char *output = NULL;
/* Don't load if non-root */
if (!privileged) {
@@ -951,8 +952,17 @@ libxlDriverShouldLoad(bool privileged)
return ret;
}
- /* Don't load if not running on a Xen control domain (dom0) */
- if (!virFileExists("/proc/xen/capabilities")) {
+ /*
+ * Don't load if not running on a Xen control domain (dom0). It is not
+ * sufficient to check for the file to exist as any guest can mount
+ * xenfs to /proc/xen.
+ */
+ status = virFileReadAll("/proc/xen/capabilities", 10. &output);
+ if (status >= 0) {
+ status = strncmp(output, "control_d", 9);
+ }
+ VIR_FREE(output);
+ if (status) {
VIR_INFO("No Xen capabilities detected, probably not running "
"in a Xen Dom0. Disabling libxenlight driver");
--
1.7.9.5
10 years, 8 months
[libvirt] [PATCH] Fix Invalid write in virCryptoHashString()
by Nehal J Wani
While running vircryptotest, it was found that valgrind pointed out the
following error:
==27453== Invalid write of size 1
==27453== at 0x4C7D7C9: virCryptoHashString (vircrypto.c:76)
==27453== by 0x401C4E: testCryptoHash (vircryptotest.c:41)
==27453== by 0x402A11: virtTestRun (testutils.c:199)
==27453== by 0x401AD5: mymain (vircryptotest.c:76)
==27453== by 0x40318D: virtTestMain (testutils.c:782)
==27453== by 0x3E6CE1ED1C: (below main) (libc-start.c:226)
==27453== Address 0x51f0541 is 0 bytes after a block of size 65 alloc'd
==27453== at 0x4A0577B: calloc (vg_replace_malloc.c:593)
==27453== by 0x4C69F2E: virAllocN (viralloc.c:189)
==27453== by 0x4C7D76B: virCryptoHashString (vircrypto.c:69)
==27453== by 0x401C4E: testCryptoHash (vircryptotest.c:41)
==27453== by 0x402A11: virtTestRun (testutils.c:199)
==27453== by 0x401AD5: mymain (vircryptotest.c:76)
==27453== by 0x40318D: virtTestMain (testutils.c:782)
==27453== by 0x3E6CE1ED1C: (below main) (libc-start.c:226)
==27453==
...and many more
---
The errors go away, if I either do:
Line 76: (*output)[hashstrlen - 1] = '\0';
or
Line 61: if (VIR_ALLOC_N(*output, hashstrlen + 1) < 0)
But the second one seems less harmful, as anyway we are going to free
that memory.
src/util/vircrypto.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/util/vircrypto.c b/src/util/vircrypto.c
index 3af3aa3..aa2b0c8 100644
--- a/src/util/vircrypto.c
+++ b/src/util/vircrypto.c
@@ -66,7 +66,7 @@ virCryptoHashString(virCryptoHash hash,
return -1;
}
- if (VIR_ALLOC_N(*output, hashstrlen) < 0)
+ if (VIR_ALLOC_N(*output, hashstrlen + 1) < 0)
return -1;
for (i = 0; i < hashinfo[hash].hashlen; i++) {
--
1.7.1
10 years, 8 months
[libvirt] [PATCH] Fix type mismatch of virNetDev*NetConfig on non-Linux
by Ján Tomko
Commit b4bbaee changed char* to const char*, but omitted
the non-Linux version.
---
Pushed as a build breaker fix.
src/util/virnetdev.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index 9d8b7cf..55781b2 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -1802,11 +1802,11 @@ virNetDevLinkDump(const char *ifname ATTRIBUTE_UNUSED,
}
int
-virNetDevReplaceNetConfig(char *linkdev ATTRIBUTE_UNUSED,
+virNetDevReplaceNetConfig(const char *linkdev ATTRIBUTE_UNUSED,
int vf ATTRIBUTE_UNUSED,
const virMacAddr *macaddress ATTRIBUTE_UNUSED,
int vlanid ATTRIBUTE_UNUSED,
- char *stateDir ATTRIBUTE_UNUSED)
+ const char *stateDir ATTRIBUTE_UNUSED)
{
virReportSystemError(ENOSYS, "%s",
_("Unable to replace net config on this platform"));
@@ -1815,9 +1815,9 @@ virNetDevReplaceNetConfig(char *linkdev ATTRIBUTE_UNUSED,
}
int
-virNetDevRestoreNetConfig(char *linkdev ATTRIBUTE_UNUSED,
+virNetDevRestoreNetConfig(const char *linkdev ATTRIBUTE_UNUSED,
int vf ATTRIBUTE_UNUSED,
- char *stateDir ATTRIBUTE_UNUSED)
+ const char *stateDir ATTRIBUTE_UNUSED)
{
virReportSystemError(ENOSYS, "%s",
_("Unable to restore net config on this platform"));
--
1.8.3.2
10 years, 8 months
[libvirt] [PATCH] Load CPU map from builddir when run uninstalled
by Jiri Denemark
When libvirtd is run from a build directory without being installed, it
should not depend on files from a libvirt package installed in the
system. Not only because there may not be any libvirt installed at all.
We already do a good job for plugins but cpu_map.xml was still loaded
from the system.
The Makefile.am change is necessary to make this all work from VPATH
builds since libvirtd has no idea where to find libvirt sources. It only
knows the path from which it was started, i.e, a builddir.
https://bugzilla.redhat.com/show_bug.cgi?id=1074327
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
daemon/libvirtd.c | 7 ++++++-
src/Makefile.am | 4 ++++
src/cpu/cpu_map.c | 3 +++
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index 72f0e81..d91e1e9 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -103,6 +103,7 @@
#include "configmake.h"
#include "virdbus.h"
+#include "cpu/cpu_map.h"
#if WITH_SASL
virNetSASLContextPtr saslCtxt = NULL;
@@ -1155,13 +1156,16 @@ int main(int argc, char **argv) {
if (strstr(argv[0], "lt-libvirtd") ||
strstr(argv[0], "/daemon/.libs/libvirtd")) {
char *tmp = strrchr(argv[0], '/');
+ char *cpumap;
if (!tmp) {
fprintf(stderr, _("%s: cannot identify driver directory\n"), argv[0]);
exit(EXIT_FAILURE);
}
*tmp = '\0';
char *driverdir;
- if (virAsprintfQuiet(&driverdir, "%s/../../src/.libs", argv[0]) < 0) {
+ if (virAsprintfQuiet(&driverdir, "%s/../../src/.libs", argv[0]) < 0 ||
+ virAsprintfQuiet(&cpumap, "%s/../../src/cpu/cpu_map.xml",
+ argv[0]) < 0) {
fprintf(stderr, _("%s: initialization failed\n"), argv[0]);
exit(EXIT_FAILURE);
}
@@ -1174,6 +1178,7 @@ int main(int argc, char **argv) {
#ifdef WITH_DRIVER_MODULES
virDriverModuleInitialize(driverdir);
#endif
+ cpuMapOverride(cpumap);
*tmp = '/';
/* Must not free 'driverdir' - it is still used */
}
diff --git a/src/Makefile.am b/src/Makefile.am
index 25d0370..306880b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -977,6 +977,10 @@ libvirt_la_BUILT_LIBADD += libvirt_cpu.la
libvirt_cpu_la_CFLAGS = \
-I$(top_srcdir)/src/conf $(AM_CFLAGS)
libvirt_cpu_la_SOURCES = $(CPU_SOURCES)
+libvirt_cpu_la_DEPENDENCIES = $(abs_builddir)/cpu/cpu_map.xml
+
+$(abs_builddir)/cpu/cpu_map.xml:
+ $(AM_V_GEN)ln -s $(srcdir)/cpu/cpu_map.xml $@
if WITH_VMX
noinst_LTLIBRARIES += libvirt_vmx.la
diff --git a/src/cpu/cpu_map.c b/src/cpu/cpu_map.c
index 7c2bdec..f6c63d4 100644
--- a/src/cpu/cpu_map.c
+++ b/src/cpu/cpu_map.c
@@ -28,6 +28,7 @@
#include "cpu_map.h"
#include "configmake.h"
#include "virstring.h"
+#include "virlog.h"
#define VIR_FROM_THIS VIR_FROM_CPU
@@ -86,6 +87,8 @@ int cpuMapLoad(const char *arch,
int element;
const char *mapfile = (cpumap ? cpumap : CPUMAPFILE);
+ VIR_DEBUG("Loading CPU map from %s", mapfile);
+
if (arch == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("undefined hardware architecture"));
--
1.9.0
10 years, 8 months
[libvirt] [PATCH] nwfilter: Add missing goto err_exit in error path
by Stefan Berger
From: Stefan Berger <stefanb(a)linux.vnet.ibm.com>
https://bugzilla.redhat.com/show_bug.cgi?id=1071095
Add a missing goto err_exit in the error path where an unsupported
value is assigned to the CTRL_IP_LEARNING key.
Signed-off-by: Stefan Berger <stefanb(a)linux.vnet.ibm.com>
---
src/nwfilter/nwfilter_gentech_driver.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/nwfilter/nwfilter_gentech_driver.c b/src/nwfilter/nwfilter_gentech_driver.c
index e576dc4..5c3b25e 100644
--- a/src/nwfilter/nwfilter_gentech_driver.c
+++ b/src/nwfilter/nwfilter_gentech_driver.c
@@ -732,6 +732,7 @@ virNWFilterInstantiate(const unsigned char *vmuuid ATTRIBUTE_UNUSED,
_("filter '%s' "
"learning value '%s' invalid."),
filter->name, learning);
+ goto err_exit;
}
} else
goto err_unresolvable_vars;
--
1.8.1.4
10 years, 8 months
[libvirt] libvirtError: this function is not supported by the connection driver: virInterfaceDefineXML
by Sijo Jose
Hi,
Could anyone help I'm getting the following error when I tried to add a new
network interface.
DETAILS
Connection
---------------------------
import libvirt
conn = libvirt.open('qemu:///system')
Interface XML
----------------------
<interface type="bridge" name="br0">
<start mode="onboot"/>
<mtu size="1500"/>
<protocol family="ipv4">
<dhcp/>
</protocol>
<bridge stp="off" delay="0.01">
<interface type="ethernet" name="eth0">
<mac address="ab:bb:cc:dd:ee:ff"/>
</interface>
<interface type="ethernet" name="eth1"/>
</bridge>
</interface>
In [96]:
conn.interfaceDefineXML(interfacexml,0)
---------------------------------------------------------------------------libvirtError
Traceback (most recent call
last)/home/saju/<ipython-input-96-0536ffe3fa23> in <module>()----> 1
conn.interfaceDefineXML(br1xml,0)
/usr/lib/python2.7/dist-packages/libvirt.pyc in
interfaceDefineXML(self, xml, flags) 2750 libvirtd. """
2751 ret = libvirtmod.virInterfaceDefineXML(self._o, xml,
flags)-> 2752 if ret is None:raise
libvirtError('virInterfaceDefineXML() failed', conn=self) 2753
__tmp = virInterface(self, _obj=ret) 2754 return __tmp
libvirtError: this function is not supported by the connection driver:
virInterfaceDefineXML
Regards
Sijo Jose
10 years, 8 months
[libvirt] [PATCH] qemu.conf: Mention virtlockd in @lock_manager description
by Michal Privoznik
When I played with virtlockd I was stunned by lacking
documentation. My frustration got bigger when I had to
read the patches to get the correct value to set in
qemu.conf.
Moreover, from pure libvirt-pride I'm changing commented
value from sanlock to lockd. We want to favor our own
implementation after all.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu.conf | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu.conf b/src/qemu/qemu.conf
index e436084..f0e802f 100644
--- a/src/qemu/qemu.conf
+++ b/src/qemu/qemu.conf
@@ -402,11 +402,13 @@
#allow_disk_format_probing = 1
-# To enable 'Sanlock' project based locking of the file
-# content (to prevent two VMs writing to the same
-# disk), uncomment this
+# In order to prevent accidentally starting two domains that
+# share one writable disk, libvirt offers two approaches for
+# locking files. The first one is sanlock, the other one,
+# virtlockd, is then our own implementation. Accepted values
+# are "sanlock" and "lockd".
#
-#lock_manager = "sanlock"
+#lock_manager = "lockd"
--
1.9.0
10 years, 8 months
[libvirt] [PATCH] qemu: don't munge user input during block commit
by Eric Blake
While investigating https://bugzilla.redhat.com/show_bug.cgi?id=1061827
I noticed that we pass user input unscathed for block-pull, but
always pass a canonical absolute name through for block-commit.
[Note that we probably _ought_ to validate that the user's request
for block-pull actually matches the backing chain, the way we already
do for block-commit - but that's a separate issue. Further note that
the ability to pass user input through unscathed allows backdoors
such as specifying a backing image that is a network URI such as
a gluster disk, instead of forcing things to the local file system;
which is an area still under active investigation on whether libvirt
needs to behave differently for network disks.]
Since qemu may write the name that the user passed in as the backing
file, a user may have a reason to want a relative file name passed
through to qemu, and always munging things to absolute prevents that.
Put another way, if you have the backing chain:
[A] <- [B(back=./A)] <- [C(back=./B)]
and commit B into A (virsh blockcommit $dom vda --base A --top B),
the metadata of C will have to be re-written. But should it be
rewritten as [C(back=./A)] or as [C(back=/path/to/A)]? Still up in
the air is whether qemu's decision should be based on whether B
and/or C had relative paths, or on whether the --base and/or
--top arguments to the command were relative paths; but if we always
pass a canonical name, we've prevented the spelling of the command
arguments from being part of the hueristics that qemu uses.
I also audited the code, and verified that we never call
qemuMonitorBlockCommit() with a NULL base, either before or after
the change to qemu_driver.c.
* src/qemu/qemu_driver.c (qemuDomainBlockCommit): Preserve user's
spelling, since absolute vs. relative matters to qemu.
* src/qemu/qemu_monitor.h (qemuMonitorBlockCommit): Base is never
null.
* src/qemu/qemu_monitor.c (qemuMonitorBlockCommit): Likewise.
* src/qemu/qemu_monitor_json.h (qemuMonitorJSONBlockCommit):
Likewise.
* src/qemu/qemu_monitor_json.c (qemuMonitorJSONBlockCommit):
Likewise.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
I was _hoping_ that this would solve the mentioned bugzilla. But
even with this applied, qemu still ended up writing an absolute
backing file name into the active file in the backing chain, so that
bug has been reassigned back to qemu - it probably has to do with
the fact that libvirt always spawns qemu with -drive pointing to
an absolute name, which is unrelated to what this patch fixes.
Therefore, I'm a little bit hesitant to apply this patch, but
wanted to post it for review anyway.
src/qemu/qemu_driver.c | 11 ++++++++---
src/qemu/qemu_monitor.c | 4 ++--
src/qemu/qemu_monitor.h | 3 ++-
src/qemu/qemu_monitor_json.c | 2 +-
src/qemu/qemu_monitor_json.h | 5 +++--
5 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 9aad2dc..31adf78 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -15383,10 +15383,15 @@ qemuDomainBlockCommit(virDomainPtr dom, const char *path, const char *base,
VIR_DISK_CHAIN_READ_WRITE) < 0))
goto endjob;
- /* Start the commit operation. */
+ /* Start the commit operation. Pass the user's original spelling,
+ * if any, through to qemu, since qemu behaves differently
+ * depending on whether the input was specified as relative or
+ * absolute (that is, our absolute top_canon may do the wrong
+ * thing if the user specified a name). */
qemuDomainObjEnterMonitor(driver, vm);
- ret = qemuMonitorBlockCommit(priv->mon, device, top_canon, base_canon,
- bandwidth);
+ ret = qemuMonitorBlockCommit(priv->mon, device,
+ top ? top : top_canon,
+ base ? base : base_canon, bandwidth);
qemuDomainObjExitMonitor(driver, vm);
endjob:
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index a2769db..e4707b7 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -1,7 +1,7 @@
/*
* qemu_monitor.c: interaction with QEMU monitor console
*
- * Copyright (C) 2006-2013 Red Hat, Inc.
+ * Copyright (C) 2006-2014 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@@ -3188,7 +3188,7 @@ qemuMonitorBlockCommit(qemuMonitorPtr mon, const char *device,
unsigned long long speed;
VIR_DEBUG("mon=%p, device=%s, top=%s, base=%s, bandwidth=%ld",
- mon, device, NULLSTR(top), NULLSTR(base), bandwidth);
+ mon, device, top, base, bandwidth);
/* Convert bandwidth MiB to bytes - unfortunately the JSON QMP protocol is
* limited to LLONG_MAX also for unsigned values */
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index eabf000..7bb465b 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -647,7 +647,8 @@ int qemuMonitorBlockCommit(qemuMonitorPtr mon,
const char *top,
const char *base,
unsigned long bandwidth)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
+ ATTRIBUTE_NONNULL(4);
int qemuMonitorArbitraryCommand(qemuMonitorPtr mon,
const char *cmd,
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index ee3ae15..40d6d1a 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -3307,7 +3307,7 @@ qemuMonitorJSONBlockCommit(qemuMonitorPtr mon, const char *device,
"s:device", device,
"U:speed", speed,
"s:top", top,
- base ? "s:base" : NULL, base,
+ "s:base", base,
NULL);
if (!cmd)
return -1;
diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h
index a93c51e..ef71588 100644
--- a/src/qemu/qemu_monitor_json.h
+++ b/src/qemu/qemu_monitor_json.h
@@ -1,7 +1,7 @@
/*
* qemu_monitor_json.h: interaction with QEMU monitor console
*
- * Copyright (C) 2006-2009, 2011-2013 Red Hat, Inc.
+ * Copyright (C) 2006-2009, 2011-2014 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@@ -258,7 +258,8 @@ int qemuMonitorJSONBlockCommit(qemuMonitorPtr mon,
const char *top,
const char *base,
unsigned long long bandwidth)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
+ ATTRIBUTE_NONNULL(4);
int qemuMonitorJSONArbitraryCommand(qemuMonitorPtr mon,
const char *cmd_str,
--
1.8.5.3
10 years, 8 months