[libvirt] [PATCH] Provide a useful README file
by Daniel P. Berrange
The current README file contents has almost no useful info, and that
which does exist is very outdated.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
README | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------
1 file changed, 71 insertions(+), 10 deletions(-)
diff --git a/README b/README
index 3d5167d..7103ae9 100644
--- a/README
+++ b/README
@@ -1,13 +1,74 @@
+ Libvirt API for virtualization
+ ==============================
- LibVirt : simple API for virtualization
+Libvirt provides a portable, long term stable C API for managing the
+virtualization technologies provided by many operating systems. It
+includes support for QEMU, KVM, Xen, LXC, BHyve, Virtuozzo, VMWare
+vCenter and ESX, VMWare Desktop, Hyper-V, VirtualBox and PowerHyp.
- Libvirt is a C toolkit to interact with the virtualization capabilities
-of recent versions of Linux (and other OSes). It is free software
-available under the GNU Lesser General Public License. Virtualization of
-the Linux Operating System means the ability to run multiple instances of
-Operating Systems concurrently on a single hardware system where the basic
-resources are driven by a Linux instance. The library aim at providing
-long term stable C API initially for the Xen paravirtualization but
-should be able to integrate other virtualization mechanisms if needed.
+For some of these hypervisors, it provides a stateful management
+daemon runs on the virtualization host allowing access to the API
+both by non-privileged local users and remote users.
-Daniel Veillard <veillard(a)redhat.com>
+Layered packages provide bindings of the Libvirt C API into other
+languages including Python, Perl, Php, Go, Java, OCaml, as well as
+mappings into object systems such as GObject, CIM and SNMP.
+
+Further information about the libvirt project can be found on the
+website:
+
+ https://libvirt.org
+
+License
+=======
+
+The libvirt C API is distributed under the terms of GNU Lesser General
+Public License, version 2.1 (or later). Some parts of the code that are
+not part of the C library, may have the more restricted GNU General
+Public License, version 2.1 (or later). See the files COPYING.LESSER
+and COPYING for full license terms & conditions.
+
+Installation
+============
+
+Libvirt uses the GNU Autotools build system, so in general can be built
+and installed with the normal commands. For example, to build in a manner
+that is suitable for installing as root, use:
+
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
+ make
+ sudo make install
+
+While to build & install as an unprivileged user
+
+ ./configure --prefix=$HOME/usr
+ make
+ make install
+
+The libvirt code relies on a large number of 3rd party libraries. These will
+be detected during execution of the configure script and a summary printed
+which lists any missing (optional) dependancies.
+
+Contributing
+============
+
+The libvirt project welcomes contributors from all. For most components
+the best way to contributor is to send patches to the primary development
+mailing list, using the 'git send-email' command. Further guidance on this
+can be found in the HACKING file, or the project website
+
+ https://libvirt.org/contribute.html
+
+Contact
+=======
+
+The libvirt project has two primary mailing lists:
+
+ * libvir-list(a)redhat.com (for development)
+ * libvirt-users(a)redhat.com (for users)
+
+Further details on contacting the project are available on the website
+
+ https://libvirt.org/contact.html
+
+-- End
--
2.9.3
7 years, 6 months
[libvirt] [PATCH v3] qemu: improve detection of UNIX path generated by libvirt
by Pavel Hrdina
Currently we consider all UNIX paths with specific prefix as generated
by libvirt, but that's a wrong assumption. Let's make the detection
better by actually checking whether the whole path matches one of the
paths that we generate or generated in the past.
The UNIX path isn't stored in config XML since libvirt-1.3.1.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1446980
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/qemu/qemu_domain.c | 66 +++++++++++++++++-----
.../qemuxml2argv-channel-unix-source-path.xml | 29 ++++++++++
.../qemuxml2xmlout-channel-unix-source-path.xml | 45 +++++++++++++++
tests/qemuxml2xmltest.c | 2 +
4 files changed, 128 insertions(+), 14 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-channel-unix-source-path.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-channel-unix-source-path.xml
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index cc02c801e1..8b7d1b5e41 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3154,24 +3154,58 @@ qemuDomainDefaultNetModel(const virDomainDef *def,
/*
- * Clear auto generated unix socket path, i.e., the one which starts with our
- * channel directory.
+ * Clear auto generated unix socket paths:
+ *
+ * libvirt 1.2.18 and older:
+ * {cfg->channelTargetDir}/{dom-name}.{target-name}
+ *
+ * libvirt 1.2.19 - 1.3.2:
+ * {cfg->channelTargetDir}/domain-{dom-name}/{target-name}
+ *
+ * libvirt 1.3.3 and newer:
+ * {cfg->channelTargetDir}/domain-{dom-id}-{short-dom-name}/{target-name}
+ *
+ * The unix socket path was stored in config XML until libvirt 1.3.0.
+ * If someone specifies the same path as we generate, they shouldn't do it.
+ *
+ * This function clears the path for migration as well, so we need to clear
+ * the path even if we are not storing it in the XML.
*/
-static void
+static int
qemuDomainChrDefDropDefaultPath(virDomainChrDefPtr chr,
virQEMUDriverPtr driver)
{
- virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
+ virQEMUDriverConfigPtr cfg;
+ virBuffer buf = VIR_BUFFER_INITIALIZER;
+ char *regexp = NULL;
+ int ret = -1;
- if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL &&
- chr->targetType == VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO &&
- chr->source->type == VIR_DOMAIN_CHR_TYPE_UNIX &&
- chr->source->data.nix.path &&
- STRPREFIX(chr->source->data.nix.path, cfg->channelTargetDir)) {
+ if (chr->deviceType != VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL ||
+ chr->targetType != VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO ||
+ chr->source->type != VIR_DOMAIN_CHR_TYPE_UNIX ||
+ !chr->source->data.nix.path) {
+ return 0;
+ }
+
+ cfg = virQEMUDriverGetConfig(driver);
+
+ virBufferEscapeRegex(&buf, "^%s", cfg->channelTargetDir);
+ virBufferAddLit(&buf, "/([^/]+\\.)|(domain-[^/]+/)");
+ virBufferEscapeRegex(&buf, "%s$", chr->target.name);
+
+ if (virBufferCheckError(&buf) < 0)
+ goto cleanup;
+
+ regexp = virBufferContentAndReset(&buf);
+
+ if (virStringMatch(chr->source->data.nix.path, regexp))
VIR_FREE(chr->source->data.nix.path);
- }
+ ret = 0;
+ cleanup:
+ VIR_FREE(regexp);
virObjectUnref(cfg);
+ return ret;
}
@@ -3439,8 +3473,10 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
/* clear auto generated unix socket path for inactive definitions */
if ((parseFlags & VIR_DOMAIN_DEF_PARSE_INACTIVE) &&
- dev->type == VIR_DOMAIN_DEVICE_CHR)
- qemuDomainChrDefDropDefaultPath(dev->data.chr, driver);
+ dev->type == VIR_DOMAIN_DEVICE_CHR) {
+ if (qemuDomainChrDefDropDefaultPath(dev->data.chr, driver) < 0)
+ goto cleanup;
+ }
/* forbid capabilities mode hostdev in this kind of hypervisor */
if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV &&
@@ -4226,8 +4262,10 @@ qemuDomainDefFormatBuf(virQEMUDriverPtr driver,
}
}
- for (i = 0; i < def->nchannels; i++)
- qemuDomainChrDefDropDefaultPath(def->channels[i], driver);
+ for (i = 0; i < def->nchannels; i++) {
+ if (qemuDomainChrDefDropDefaultPath(def->channels[i], driver) < 0)
+ goto cleanup;
+ }
}
format:
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-channel-unix-source-path.xml b/tests/qemuxml2argvdata/qemuxml2argv-channel-unix-source-path.xml
new file mode 100644
index 0000000000..42cb3c387c
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-channel-unix-source-path.xml
@@ -0,0 +1,29 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc'>hvm</type>
+ </os>
+ <devices>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <channel type='unix'>
+ <source mode='bind' path='/tmp/channel/QEMUGuest1.org.qemu.guest_agent.0'/>
+ <target type='virtio' name='org.qemu.guest_agent.0'/>
+ </channel>
+ <channel type='unix'>
+ <source mode='bind' path='/tmp/channel/domain-QEMUGuest1/org.qemu.guest_agent.1'/>
+ <target type='virtio' name='org.qemu.guest_agent.1'/>
+ </channel>
+ <channel type='unix'>
+ <source mode='bind' path='/tmp/channel/domain-1-QEMUGuest1/org.qemu.guest_agent.2'/>
+ <target type='virtio' name='org.qemu.guest_agent.2'/>
+ </channel>
+ <channel type='unix'>
+ <source mode='bind' path='/tmp/channel/QEMUGuest1/org.qemu.guest_agent.3'/>
+ <target type='virtio' name='org.qemu.guest_agent.3'/>
+ </channel>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-channel-unix-source-path.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-channel-unix-source-path.xml
new file mode 100644
index 0000000000..2d8fa1e3ac
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-channel-unix-source-path.xml
@@ -0,0 +1,45 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <controller type='virtio-serial' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </controller>
+ <channel type='unix'>
+ <target type='virtio' name='org.qemu.guest_agent.0'/>
+ <address type='virtio-serial' controller='0' bus='0' port='1'/>
+ </channel>
+ <channel type='unix'>
+ <target type='virtio' name='org.qemu.guest_agent.1'/>
+ <address type='virtio-serial' controller='0' bus='0' port='2'/>
+ </channel>
+ <channel type='unix'>
+ <target type='virtio' name='org.qemu.guest_agent.2'/>
+ <address type='virtio-serial' controller='0' bus='0' port='3'/>
+ </channel>
+ <channel type='unix'>
+ <source mode='bind' path='/tmp/channel/QEMUGuest1/org.qemu.guest_agent.3'/>
+ <target type='virtio' name='org.qemu.guest_agent.3'/>
+ <address type='virtio-serial' controller='0' bus='0' port='4'/>
+ </channel>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 2dccde746e..6e3544e4b7 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -551,6 +551,8 @@ mymain(void)
DO_TEST("channel-virtio", NONE);
DO_TEST("channel-virtio-state", NONE);
+ DO_TEST_FULL("channel-unix-source-path", WHEN_INACTIVE, GIC_NONE, NONE);
+
DO_TEST("hostdev-usb-address", NONE);
DO_TEST("hostdev-pci-address", NONE);
DO_TEST("hostdev-vfio", NONE);
--
2.13.0
7 years, 6 months
[libvirt] [RFC] qemu: monitor: do not report error on shutdown
by Christian Ehrhardt
If a shutdown is expected because it was triggered via libvirt we can
also expect the monitor to close. In those cases do not report an
internal error like:
"internal error: End of file from qemu monitor"
Signed-off-by: Christian Ehrhardt <christian.ehrhardt(a)canonical.com>
---
src/qemu/qemu_monitor.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index d71f84c..352cc8a 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -63,6 +63,7 @@ struct _qemuMonitor {
int fd;
int watch;
int hasSendFD;
+ int willhangup;
virDomainObjPtr vm;
@@ -691,8 +692,10 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque)
if (events & VIR_EVENT_HANDLE_HANGUP) {
hangup = true;
if (!error) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("End of file from qemu monitor"));
+ if (!mon->willhangup) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("End of file from qemu monitor"));
+ }
eof = true;
events &= ~VIR_EVENT_HANDLE_HANGUP;
}
@@ -731,7 +734,7 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque)
if (mon->lastError.code != VIR_ERR_OK) {
/* Already have an error, so clear any new error */
virResetLastError();
- } else {
+ } else if (!mon->willhangup) {
virErrorPtr err = virGetLastError();
if (!err)
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
@@ -1282,6 +1285,7 @@ qemuMonitorEmitShutdown(qemuMonitorPtr mon)
{
int ret = -1;
VIR_DEBUG("mon=%p", mon);
+ mon->willhangup = 1;
QEMU_MONITOR_CALLBACK(mon, ret, domainShutdown, mon->vm);
return ret;
--
2.7.4
7 years, 6 months
[libvirt] [libvirt-python PATCH v2] spec: Install egg-info with rpm package
by Martin Kletzander
This was being done due to now deprecated policy and that file should
be installed so that pip can recognize that the packages is already
installed in the system.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
v2:
- Put each egg-info ito its respective RPM package
libvirt-python.spec.in | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libvirt-python.spec.in b/libvirt-python.spec.in
index 5ad029281c52..fc30564133fe 100644
--- a/libvirt-python.spec.in
+++ b/libvirt-python.spec.in
@@ -65,7 +65,6 @@ CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
%if %{with_python3}
%{__python3} setup.py install --skip-build --root=%{buildroot}
%endif
-rm -f %{buildroot}%{_libdir}/python*/site-packages/*egg-info
%check
%{__python} setup.py test
@@ -80,6 +79,7 @@ rm -f %{buildroot}%{_libdir}/python*/site-packages/*egg-info
%{_libdir}/python2*/site-packages/libvirt_qemu.py*
%{_libdir}/python2*/site-packages/libvirt_lxc.py*
%{_libdir}/python2*/site-packages/libvirtmod*
+%{_libdir}/python2*/site-packages/*egg-info
%if %{with_python3}
%files -n libvirt-python3
@@ -94,6 +94,7 @@ rm -f %{buildroot}%{_libdir}/python*/site-packages/*egg-info
%{_libdir}/python3*/site-packages/__pycache__/libvirt_lxc.cpython-*.py*
%{_libdir}/python3*/site-packages/__pycache__/libvirtaio.cpython-*.py*
%{_libdir}/python3*/site-packages/libvirtmod*
+%{_libdir}/python3*/site-packages/*egg-info
%endif
%changelog
--
2.13.0
7 years, 6 months
[libvirt] [PATCH] remove hack for debian etch limits.h
by Daniel P. Berrange
The debian etch distro was end-of-life a long time ago so we no
longer need the ULLONG_MAX hack. In any case gnulib now provides
an equivalent fix by default, and so our definition now triggers
syntax-check rule failure
src/internal.h:# define ULLONG_MAX ULONG_LONG_MAX
maint.mk: define the above via some gnulib .h file
maint.mk:843: recipe for target 'sc_prohibit_always-defined_macros' failed
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
Pushed as a build break fix
src/internal.h | 5 -----
1 file changed, 5 deletions(-)
diff --git a/src/internal.h b/src/internal.h
index 713734c..5a5a430 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -114,11 +114,6 @@
# define __GNUC_PREREQ(maj, min) 0
# endif
-/* Work around broken limits.h on debian etch */
-# if defined _GCC_LIMITS_H_ && ! defined ULLONG_MAX
-# define ULLONG_MAX ULONG_LONG_MAX
-# endif
-
# endif /* __GNUC__ */
/**
--
2.9.3
7 years, 6 months
[libvirt] [libvirt-python PATCH] spec: Install egg-info with rpm package
by Martin Kletzander
This was being done due to now deprecated policy and that file should
be installed so that pip can recognize that the packages is already
installed in the system.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
libvirt-python.spec.in | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libvirt-python.spec.in b/libvirt-python.spec.in
index 5ad029281c52..132183c93c02 100644
--- a/libvirt-python.spec.in
+++ b/libvirt-python.spec.in
@@ -65,7 +65,6 @@ CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
%if %{with_python3}
%{__python3} setup.py install --skip-build --root=%{buildroot}
%endif
-rm -f %{buildroot}%{_libdir}/python*/site-packages/*egg-info
%check
%{__python} setup.py test
@@ -81,6 +80,8 @@ rm -f %{buildroot}%{_libdir}/python*/site-packages/*egg-info
%{_libdir}/python2*/site-packages/libvirt_lxc.py*
%{_libdir}/python2*/site-packages/libvirtmod*
+%{_libdir}/python*/site-packages/*egg-info
+
%if %{with_python3}
%files -n libvirt-python3
%defattr(-,root,root)
--
2.13.0
7 years, 6 months
[libvirt] [PATCH] maint: update to latest gnulib
by Daniel P. Berrange
This pulls in the fixes for poll() on Win32 which finally
makes the remote driver work again.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
.gnulib | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.gnulib b/.gnulib
index 94386a1..da830b5 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit 94386a13667c645fd42544a7fd302cdddd39fcdf
+Subproject commit da830b5146cb553ac2a4bcfe76caeb57bda24cc3
--
2.9.3
7 years, 6 months
[libvirt] [PATCH] vz: support virDomainGetBlockInfo in driver
by Nikolay Shirokovskiy
Actually physical size is not available in vz sdk right now so let's
set it to allocation as an estimation in non sparse case.
---
src/vz/vz_driver.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
src/vz/vz_sdk.c | 23 +++++++++++++++++++++++
src/vz/vz_sdk.h | 1 +
3 files changed, 74 insertions(+)
diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
index 9a429f4..7b32558 100644
--- a/src/vz/vz_driver.c
+++ b/src/vz/vz_driver.c
@@ -4005,6 +4005,55 @@ vzDomainBlockResize(virDomainPtr domain,
return ret;
}
+static int
+vzDomainGetBlockInfo(virDomainPtr domain,
+ const char *path,
+ virDomainBlockInfoPtr info,
+ unsigned int flags)
+{
+ virDomainObjPtr dom;
+ virDomainDiskDefPtr disk;
+ long long allocation;
+ bool job = false;
+ int ret = -1;
+
+ virCheckFlags(0, -1);
+
+ if (!(dom = vzDomObjFromDomainRef(domain)))
+ return -1;
+
+ if (virDomainGetBlockInfoEnsureACL(domain->conn, dom->def) < 0)
+ goto cleanup;
+
+ if (vzDomainObjBeginJob(dom) < 0)
+ goto cleanup;
+ job = true;
+
+ if (vzEnsureDomainExists(dom) < 0)
+ goto cleanup;
+
+ if (!(disk = virDomainDiskByName(dom->def, path, false))) {
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("invalid path %s not assigned to domain"), path);
+ goto cleanup;
+ }
+
+ if ((allocation = prlsdkGetDiskAllocation(dom, disk)) < 0)
+ goto cleanup;
+
+ info->capacity = disk->src->capacity;
+ info->allocation = allocation;
+ info->physical = allocation;
+
+ ret = 0;
+
+ cleanup:
+ if (job)
+ vzDomainObjEndJob(dom);
+ virDomainObjEndAPI(&dom);
+ return ret;
+}
+
static virHypervisorDriver vzHypervisorDriver = {
.name = "vz",
.connectOpen = vzConnectOpen, /* 0.10.0 */
@@ -4106,6 +4155,7 @@ static virHypervisorDriver vzHypervisorDriver = {
.domainAbortJob = vzDomainAbortJob, /* 3.1.0 */
.domainReset = vzDomainReset, /* 3.1.0 */
.domainBlockResize = vzDomainBlockResize, /* 3.3.0 */
+ .domainGetBlockInfo = vzDomainGetBlockInfo, /* 3.4.0 */
};
static virConnectDriver vzConnectDriver = {
diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index 4d2c6b0..b8f561c 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -4962,3 +4962,26 @@ int prlsdkResizeImage(virDomainObjPtr dom, virDomainDiskDefPtr disk,
PrlHandle_Free(prldisk);
return ret;
}
+
+long long prlsdkGetDiskAllocation(virDomainObjPtr dom,
+ virDomainDiskDefPtr disk)
+{
+ vzDomObjPtr privdom = dom->privateData;
+ PRL_HANDLE job;
+ PRL_HANDLE prldisk;
+ PRL_UINT32 size;
+ PRL_RESULT pret;
+
+ job = PrlVm_RefreshConfig(privdom->sdkdom);
+ if (waitDomainJob(job, dom))
+ return -1;
+
+ prldisk = prlsdkGetDisk(privdom->sdkdom, disk);
+ if (prldisk == PRL_INVALID_HANDLE)
+ return -1;
+
+ pret = PrlVmDevHd_GetSizeOnDisk(prldisk, &size);
+ prlsdkCheckRetExit(pret, -1);
+
+ return ((unsigned long long)size) << 20;
+}
diff --git a/src/vz/vz_sdk.h b/src/vz/vz_sdk.h
index 0a77431..6b73067 100644
--- a/src/vz/vz_sdk.h
+++ b/src/vz/vz_sdk.h
@@ -91,3 +91,4 @@ PRL_HANDLE
prlsdkSdkDomainLookupByName(vzDriverPtr driver, const char *name);
int prlsdkCancelJob(virDomainObjPtr dom);
int prlsdkResizeImage(virDomainObjPtr dom, virDomainDiskDefPtr disk, unsigned long long newsize);
+long long prlsdkGetDiskAllocation(virDomainObjPtr dom, virDomainDiskDefPtr disk);
--
1.8.3.1
7 years, 6 months
[libvirt] [PATCH 0/5] qemu: Unbreak aarch64/virt TCG guests
by Andrea Bolognani
This issue was reported on the list a while ago, and now bug
reports are popping up in Bugzilla as well.
Since the proper fix (implementing the MSI controller for
GICv3 in QEMU) has been confirmed to be a long way off, let's
deal with it in libvirt.
Andrea Bolognani (5):
qemu: Use qemuDomainMachineIsVirt() more
tests: Check default GIC version for aarch64/virt TCG guests
qemu: Use GICv2 for aarch64/virt TCG guests
gic: Remove VIR_GIC_VERSION_DEFAULT
news: Update for GIC version on TCG changes
docs/news.xml | 11 ++++++
src/qemu/qemu_capabilities.c | 7 +---
src/qemu/qemu_command.c | 6 +--
src/qemu/qemu_domain.c | 44 +++++++++++++++-------
src/util/virgic.h | 3 --
.../qemuxml2argv-aarch64-gic-none-tcg.args | 19 ++++++++++
.../qemuxml2argv-aarch64-gic-none-tcg.xml | 17 +++++++++
tests/qemuxml2argvtest.c | 3 ++
.../qemuxml2xmlout-aarch64-gic-none-tcg.xml | 25 ++++++++++++
tests/qemuxml2xmltest.c | 1 +
10 files changed, 110 insertions(+), 26 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-tcg.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-tcg.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-none-tcg.xml
--
2.7.4
7 years, 6 months