[libvirt] [PATCH] remote: disable unused function on win32 platform build
by Daniel P. Berrangé
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
Pushed as trivial build fix
src/remote/remote_driver.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 3973b37d5f..95437b4365 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -712,6 +712,7 @@ remoteConnectSupportsFeatureUnlocked(virConnectPtr conn,
}
+#ifndef WIN32
static char *remoteGetUNIXSocketNonRoot(void)
{
char *sockname = NULL;
@@ -729,6 +730,7 @@ static char *remoteGetUNIXSocketNonRoot(void)
VIR_DEBUG("Chosen UNIX sockname %s", sockname);
return sockname;
}
+#endif /* WIN32 */
static char *remoteGetUNIXSocketRoot(unsigned int flags)
{
--
2.14.3
6 years, 7 months
[libvirt] [PATCH] util: improve virNetDevTapGetRealDeviceName
by Roman Bogorodskiy
virNetDevTapGetRealDeviceName() is used on FreeBSD because interface
names (such as one sees in output of tools like ifconfig(8)) might not
match their /dev entity names, and for bhyve we need the latter.
Current implementation is not very efficient because in order to find
/dev name, it goes through all /dev/tap* entries and tries to issue
TAPGIFNAME ioctl on it. Not only this is slow, but also there's a bug in
this implementation when more than one NIC is passed to a VM: once we
find the tap interface we're looking for, we set its state to UP because
opening it for issuing ioctl sets it DOWN, even if it was UP before.
When we have more than 1 NIC for a VM, we have only last one UP because
others remain DOWN after unsuccessful attempts to match interface name.
New implementation just uses sysctl(3), so it should be faster and
won't make interfaces go down to get name.
---
src/util/virnetdevtap.c | 71 +++++++++++++++++++++----------------------------
1 file changed, 30 insertions(+), 41 deletions(-)
diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c
index a3ed59da8..afe4f0b3c 100644
--- a/src/util/virnetdevtap.c
+++ b/src/util/virnetdevtap.c
@@ -48,7 +48,8 @@
#ifdef __linux__
# include <linux/if_tun.h> /* IFF_TUN, IFF_NO_PI */
#elif defined(__FreeBSD__)
-# include <net/if_tap.h>
+# include <net/if_mib.h>
+# include <sys/sysctl.h>
#endif
#if defined(HAVE_GETIFADDRS) && defined(AF_LINK)
# include <ifaddrs.h>
@@ -101,55 +102,43 @@ virNetDevTapGetName(int tapfd ATTRIBUTE_UNUSED, char **ifname ATTRIBUTE_UNUSED)
char*
virNetDevTapGetRealDeviceName(char *ifname ATTRIBUTE_UNUSED)
{
-#ifdef TAPGIFNAME
+#ifdef IFDATA_DRIVERNAME
+ int ifindex = 0;
+ int name[6];
+ size_t len = 0;
char *ret = NULL;
- struct dirent *dp;
- DIR *dirp = NULL;
- char *devpath = NULL;
- int fd;
- if (virDirOpen(&dirp, "/dev") < 0)
+ if ((ifindex = if_nametoindex(ifname)) == 0) {
+ virReportSystemError(errno,
+ _("Unable to get interface index for '%s'"),
+ ifname);
return NULL;
+ }
- while (virDirRead(dirp, &dp, "/dev") > 0) {
- if (STRPREFIX(dp->d_name, "tap")) {
- struct ifreq ifr;
- if (virAsprintf(&devpath, "/dev/%s", dp->d_name) < 0)
- goto cleanup;
- if ((fd = open(devpath, O_RDWR)) < 0) {
- if (errno == EBUSY) {
- VIR_FREE(devpath);
- continue;
- }
+ name[0] = CTL_NET;
+ name[1] = PF_LINK;
+ name[2] = NETLINK_GENERIC;
+ name[3] = IFMIB_IFDATA;
+ name[4] = ifindex;
+ name[5] = IFDATA_DRIVERNAME;
- virReportSystemError(errno, _("Unable to open '%s'"), devpath);
- goto cleanup;
- }
-
- if (ioctl(fd, TAPGIFNAME, (void *)&ifr) < 0) {
- virReportSystemError(errno, "%s",
- _("Unable to query tap interface name"));
- goto cleanup;
- }
+ if (sysctl(name, 6, NULL, &len, 0, 0) < 0) {
+ virReportSystemError(errno,
+ _("Unable to get driver name for '%s'"),
+ ifname);
+ return NULL;
+ }
- if (STREQ(ifname, ifr.ifr_name)) {
- /* we can ignore the return value
- * because we still have nothing
- * to do but return;
- */
- ignore_value(VIR_STRDUP(ret, dp->d_name));
- goto cleanup;
- }
+ ret = malloc(len);
- VIR_FREE(devpath);
- VIR_FORCE_CLOSE(fd);
- }
+ if (sysctl(name, 6, ret, &len, 0, 0) < 0) {
+ virReportSystemError(errno,
+ _("Unable to get driver name for '%s'"),
+ ifname);
+ free(ret);
+ return NULL;
}
- cleanup:
- VIR_FREE(devpath);
- VIR_FORCE_CLOSE(fd);
- VIR_DIR_CLOSE(dirp);
return ret;
#else
return NULL;
--
2.16.2
6 years, 7 months
[libvirt] [PATCH 0/2] po: clean up some language translations
by Daniel P. Berrangé
First we purge some translated strings that are no longer required, then
we refresh from Zanata to purge bogus non-translations.
Daniel P. Berrangé (2):
Refresh translations to drop unused strings
po: delete bogus translations from various languages
po/af.mini.po | 2 +-
po/am.mini.po | 2 +-
po/anp.mini.po | 2 +-
po/ar.mini.po | 744 +---------------------------------------------------
po/as.mini.po | 520 +-----------------------------------
po/ast.mini.po | 2 +-
po/bal.mini.po | 2 +-
po/be.mini.po | 2 +-
po/bg.mini.po | 26 +-
po/bn.mini.po | 743 +--------------------------------------------------
po/bn_IN.mini.po | 287 +-------------------
po/bo.mini.po | 2 +-
po/br.mini.po | 2 +-
po/brx.mini.po | 2 +-
po/bs.mini.po | 20 +-
po/ca.mini.po | 23 +-
po/cs.mini.po | 67 +----
po/cy.mini.po | 744 +---------------------------------------------------
po/da.mini.po | 20 +-
po/de.mini.po | 549 +-------------------------------------
po/de_CH.mini.po | 2 +-
po/el.mini.po | 2 +-
po/en_GB.mini.po | 525 +-----------------------------------
po/eo.mini.po | 2 +-
po/es.mini.po | 548 +-------------------------------------
po/et.mini.po | 743 +--------------------------------------------------
po/eu.mini.po | 743 +--------------------------------------------------
po/fa.mini.po | 2 +-
po/fi.mini.po | 23 +-
po/fil.mini.po | 2 +-
po/fr.mini.po | 67 +----
po/fur.mini.po | 2 +-
po/ga.mini.po | 2 +-
po/gl.mini.po | 743 +--------------------------------------------------
po/gu.mini.po | 524 +-----------------------------------
po/he.mini.po | 743 +--------------------------------------------------
po/hi.mini.po | 362 +------------------------
po/hr.mini.po | 2 +-
po/hu.mini.po | 20 +-
po/ia.mini.po | 2 +-
po/id.mini.po | 8 +-
po/ilo.mini.po | 2 +-
po/is.mini.po | 743 +--------------------------------------------------
po/it.mini.po | 270 +------------------
po/ja.mini.po | 553 +-------------------------------------
po/ka.mini.po | 743 +--------------------------------------------------
po/kk.mini.po | 2 +-
po/km.mini.po | 2 +-
po/kn.mini.po | 532 +------------------------------------
po/ko.mini.po | 323 +----------------------
po/kw.mini.po | 2 +-
po/kw(a)kkcor.mini.po | 2 +-
po/kw(a)uccor.mini.po | 2 +-
po/kw_GB.mini.po | 2 +-
po/ky.mini.po | 2 +-
po/lt.mini.po | 743 +--------------------------------------------------
po/lv.mini.po | 743 +--------------------------------------------------
po/mai.mini.po | 2 +-
po/mk.mini.po | 20 +-
po/ml.mini.po | 526 +------------------------------------
po/mn.mini.po | 2 +-
po/mr.mini.po | 544 +-------------------------------------
po/ms.mini.po | 2 +-
po/my.mini.po | 2 +-
po/nb.mini.po | 2 +-
po/nds.mini.po | 2 +-
po/ne.mini.po | 2 +-
po/nl.mini.po | 349 +-----------------------
po/nn.mini.po | 743 +--------------------------------------------------
po/nso.mini.po | 743 +--------------------------------------------------
po/or.mini.po | 446 +------------------------------
po/pa.mini.po | 515 +-----------------------------------
po/pl.mini.po | 356 +------------------------
po/pt.mini.po | 29 +-
po/pt_BR.mini.po | 545 +-------------------------------------
po/ro.mini.po | 743 +--------------------------------------------------
po/ru.mini.po | 522 +-----------------------------------
po/si.mini.po | 743 +--------------------------------------------------
po/sk.mini.po | 743 +--------------------------------------------------
po/sl.mini.po | 743 +--------------------------------------------------
po/sq.mini.po | 2 +-
po/sr.mini.po | 125 +--------
po/sr(a)latin.mini.po | 125 +--------
po/sv.mini.po | 27 +-
po/ta.mini.po | 545 +-------------------------------------
po/te.mini.po | 516 +-----------------------------------
po/tg.mini.po | 2 +-
po/th.mini.po | 743 +--------------------------------------------------
po/tr.mini.po | 743 +--------------------------------------------------
po/tw.mini.po | 2 +-
po/uk.mini.po | 628 +-------------------------------------------
po/ur.mini.po | 743 +--------------------------------------------------
po/vi.mini.po | 315 +---------------------
po/wba.mini.po | 2 +-
po/yo.mini.po | 2 +-
po/zh_CN.mini.po | 519 +-----------------------------------
po/zh_HK.mini.po | 2 +-
po/zh_TW.mini.po | 20 +-
po/zu.mini.po | 743 +--------------------------------------------------
99 files changed, 122 insertions(+), 27500 deletions(-)
--
2.14.3
6 years, 7 months
[libvirt] [PATCH rust] git: add config file telling git-publish how to send patches
by Daniel P. Berrangé
The "git-publish" tool is a useful git extension for sending patch
series for code review. It automatically creates versioned tags
each time code on a branch is sent, so that there is a record of
each version. It also remembers the cover letter so it does not
need re-entering each time the series is reposted.
With this config file present it is now sufficient[1] to run
$ git publish
to send all patches in a branch to the list for review, with the
correct subject prefix added for this non-core libvirt module.
[1] Assuming your $HOME/.gitconfig has an SMTP server listed
at least e.g.
[sendemail]
smtpserver = smtp.example.com
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
.gitpublish | 4 ++++
1 file changed, 4 insertions(+)
create mode 100644 .gitpublish
diff --git a/.gitpublish b/.gitpublish
new file mode 100644
index 0000000..a86d7a7
--- /dev/null
+++ b/.gitpublish
@@ -0,0 +1,4 @@
+[gitpublishprofile "default"]
+base = master
+to = libvir-list(a)redhat.com
+prefix = PATCH rust
--
2.14.3
6 years, 7 months
[libvirt] [rust PATCH] travis: fix syntax for script commands
by Daniel P. Berrangé
The script: commands were listed without a leading '-' which caused
travis to concatenate them into a single command. This meant the second
command became a set of arguments to the first command. Historically
cargo ignored these extra args so the mistake was not noticed, but it
now generates a fatal error.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
.travis.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index f9844bb..c52f745 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -40,5 +40,5 @@ install:
- echo "pass" | sudo saslpasswd2 -p -a libvirt user
script:
- cargo test --verbose
- cargo test --verbose -- --ignored
+ - cargo test --verbose
+ - cargo test --verbose -- --ignored
--
2.14.3
6 years, 7 months
[libvirt] [PATCH 00/14] Initial split of the daemons
by Daniel P. Berrangé
This patch series is the final bit of refactoring needed to start
splitting up libvirtd for real.
The last three patches are not really quite ready for merge, but I've
included them to illustrate what the end result is looking like. I have
taken the approach of adding conditionals into the libvirtd source, so
that we don't end up with 10+ cut+paste copies of all the boilerplate
code. Essentially the virt${DRIVER}d daemons are functionally identical
to libvirtd, except that anything todo with TCP is disabled, and they
only load a single driver. This does mean they are somewhat "fatter"
than they need to be (mostly in terms of number of worker threads in
every daemon), but I figure we can optimize later if desired.
Obviously splitting off storage, nwfilter and network drivers is going
to require extra work first because of the callbacks they have into virt
drivers. Hence I've started with the secret driver as the trivial thing
to prove the general concept. The nodedev and interface drivers will
also be trivial, at least to start with. I'm contemplating whether we
should put the host device assignment tracking into the nodedev driver
itself.
With this series, if you connect to the QEMU driver, you should
automatically get a connection to the separate virtsecretd
daemon. Similarly when the QEMU driver tries to open the secret driver,
it should end up talking to the virtsecretd daemon via the remote driver.
Daniel P. Berrangé (14):
build: prevent unloading of all public libraries
remote: stop trying to load Xen driver module
build: prevent unloading of dlopen'd modules
driver: don't keep a pointer to the loaded library handle
driver: fix handling of error return from finding resource
driver: tighten check for whether loadable module exists or not
driver: use normal error reporting APIs when loading modules
driver: add option to make missing drivers a fatal problem
remote: honour errors from virDriverLoadModule
remote: split URI scheme into driver and transport upfront
remote: refactor code for building UNIX socket paths
remote: conditionalize sources for some pieces to become optional
remote: allow remote driver to connect to alternative daemons
secret: introduce virtsecretd daemon
src/Makefile.am | 12 ++-
src/driver.c | 91 ++++++++++------
src/driver.h | 9 +-
src/libvirt.c | 24 +++++
src/remote/Makefile.inc.am | 20 ++++
src/remote/remote_daemon.c | 196 ++++++++++++++++++++--------------
src/remote/remote_daemon_config.c | 36 +++++--
src/remote/remote_daemon_config.h | 9 +-
src/remote/remote_daemon_dispatch.c | 11 +-
src/remote/remote_driver.c | 202 ++++++++++++++++++++++++------------
src/remote/remote_driver.h | 4 -
src/secret/Makefile.inc.am | 54 ++++++++++
src/storage/storage_backend.c | 13 +--
src/util/virfile.c | 4 +
tests/virdrivermoduletest.c | 2 +-
15 files changed, 483 insertions(+), 204 deletions(-)
--
2.14.3
6 years, 7 months
[libvirt] [PATCH] qemu: Add I/O thread support info into domain capabilities
by Martin Kletzander
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
docs/schemas/domaincaps.rng | 9 +++++++++
src/conf/domain_capabilities.c | 3 +++
src/conf/domain_capabilities.h | 1 +
src/qemu/qemu_capabilities.c | 11 +++++++++++
.../domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml | 1 +
tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml | 1 +
tests/domaincapsschemadata/qemu_2.12.0.s390x.xml | 1 +
tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml | 1 +
.../domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml | 1 +
tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml | 1 +
tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml | 1 +
tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml | 1 +
tests/domaincapsschemadata/qemu_2.7.0.s390x.xml | 1 +
tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml | 1 +
tests/domaincapsschemadata/qemu_2.8.0.s390x.xml | 1 +
tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml | 1 +
tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml | 1 +
tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml | 1 +
tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml | 1 +
19 files changed, 39 insertions(+)
diff --git a/docs/schemas/domaincaps.rng b/docs/schemas/domaincaps.rng
index 39053181eb9a..dca5fa1c8fa0 100644
--- a/docs/schemas/domaincaps.rng
+++ b/docs/schemas/domaincaps.rng
@@ -28,6 +28,9 @@
<optional>
<ref name='vcpu'/>
</optional>
+ <optional>
+ <ref name='iothreads'/>
+ </optional>
<optional>
<ref name='os'/>
</optional>
@@ -53,6 +56,12 @@
</element>
</define>
+ <define name='iothreads'>
+ <element name='iothreads'>
+ <empty/>
+ </element>
+ </define>
+
<define name='loader'>
<element name='loader'>
<ref name='supported'/>
diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c
index bebbaf44d00e..87a2ce34542d 100644
--- a/src/conf/domain_capabilities.c
+++ b/src/conf/domain_capabilities.c
@@ -562,6 +562,9 @@ virDomainCapsFormat(virDomainCapsPtr const caps)
if (caps->maxvcpus)
virBufferAsprintf(&buf, "<vcpu max='%d'/>\n", caps->maxvcpus);
+ if (caps->iothreads)
+ virBufferAddLit(&buf, "<iothreads/>\n");
+
virDomainCapsOSFormat(&buf, &caps->os);
virDomainCapsCPUFormat(&buf, &caps->cpu);
diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h
index fa4c1e442f57..3b5ce214d636 100644
--- a/src/conf/domain_capabilities.h
+++ b/src/conf/domain_capabilities.h
@@ -147,6 +147,7 @@ struct _virDomainCaps {
/* Some machine specific info */
int maxvcpus;
+ bool iothreads; /* Whether I/O threads are supported or not. */
virDomainCapsOS os;
virDomainCapsCPU cpu;
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 833c75514c25..00634abb1649 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -4632,6 +4632,16 @@ virQEMUCapsFillDomainCPUCaps(virCapsPtr caps,
}
+static int
+virQEMUCapsFillDomainIOThreadCaps(virQEMUCapsPtr qemuCaps,
+ virDomainCapsPtr domCaps)
+{
+ domCaps->iothreads = virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_IOTHREAD);
+
+ return 0;
+}
+
+
static int
virQEMUCapsFillDomainDeviceDiskCaps(virQEMUCapsPtr qemuCaps,
const char *machine,
@@ -4866,6 +4876,7 @@ virQEMUCapsFillDomainCaps(virCapsPtr caps,
if (virQEMUCapsFillDomainOSCaps(os, firmwares, nfirmwares) < 0 ||
virQEMUCapsFillDomainCPUCaps(caps, qemuCaps, domCaps) < 0 ||
+ virQEMUCapsFillDomainIOThreadCaps(qemuCaps, domCaps) < 0 ||
virQEMUCapsFillDomainDeviceDiskCaps(qemuCaps,
domCaps->machine, disk) < 0 ||
virQEMUCapsFillDomainDeviceGraphicsCaps(qemuCaps, graphics) < 0 ||
diff --git a/tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml b/tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml
index 9cba942fbf8e..47eb0ca571f9 100644
--- a/tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml
+++ b/tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml
@@ -4,6 +4,7 @@
<machine>virt-2.12</machine>
<arch>aarch64</arch>
<vcpu max='255'/>
+ <iothreads/>
<os supported='yes'>
<loader supported='yes'>
<value>/usr/share/AAVMF/AAVMF_CODE.fd</value>
diff --git a/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml b/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml
index 4029e9e386a9..559e8c37a82f 100644
--- a/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml
+++ b/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml
@@ -4,6 +4,7 @@
<machine>pseries-2.12</machine>
<arch>ppc64</arch>
<vcpu max='1024'/>
+ <iothreads/>
<os supported='yes'>
<loader supported='yes'>
<value>/usr/share/AAVMF/AAVMF_CODE.fd</value>
diff --git a/tests/domaincapsschemadata/qemu_2.12.0.s390x.xml b/tests/domaincapsschemadata/qemu_2.12.0.s390x.xml
index 50680c1ef8d2..a437209e45b1 100644
--- a/tests/domaincapsschemadata/qemu_2.12.0.s390x.xml
+++ b/tests/domaincapsschemadata/qemu_2.12.0.s390x.xml
@@ -4,6 +4,7 @@
<machine>s390-ccw-virtio-2.12</machine>
<arch>s390x</arch>
<vcpu max='248'/>
+ <iothreads/>
<os supported='yes'>
<loader supported='yes'>
<value>/usr/share/AAVMF/AAVMF_CODE.fd</value>
diff --git a/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml b/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml
index 851d914bc9c6..5a3cc5bd1dac 100644
--- a/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml
@@ -4,6 +4,7 @@
<machine>pc-i440fx-2.12</machine>
<arch>x86_64</arch>
<vcpu max='255'/>
+ <iothreads/>
<os supported='yes'>
<loader supported='yes'>
<value>/usr/share/AAVMF/AAVMF_CODE.fd</value>
diff --git a/tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml b/tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml
index 7c019b230868..0a5d54f3fde6 100644
--- a/tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml
+++ b/tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml
@@ -4,6 +4,7 @@
<machine>virt-2.6</machine>
<arch>aarch64</arch>
<vcpu max='255'/>
+ <iothreads/>
<os supported='yes'>
<loader supported='yes'>
<value>/usr/share/AAVMF/AAVMF_CODE.fd</value>
diff --git a/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml b/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml
index 3b142806217b..6311425bd3d9 100644
--- a/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml
+++ b/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml
@@ -4,6 +4,7 @@
<machine>integratorcp</machine>
<arch>aarch64</arch>
<vcpu max='1'/>
+ <iothreads/>
<os supported='yes'>
<loader supported='yes'>
<value>/usr/share/AAVMF/AAVMF_CODE.fd</value>
diff --git a/tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml b/tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml
index 98c72d36de04..5f228bac6924 100644
--- a/tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml
+++ b/tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml
@@ -4,6 +4,7 @@
<machine>pseries-2.6</machine>
<arch>ppc64</arch>
<vcpu max='255'/>
+ <iothreads/>
<os supported='yes'>
<loader supported='yes'>
<value>/usr/share/AAVMF/AAVMF_CODE.fd</value>
diff --git a/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml b/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml
index de81886237ee..0fe1f61e7716 100644
--- a/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml
@@ -4,6 +4,7 @@
<machine>pc-i440fx-2.6</machine>
<arch>x86_64</arch>
<vcpu max='255'/>
+ <iothreads/>
<os supported='yes'>
<loader supported='yes'>
<value>/usr/share/AAVMF/AAVMF_CODE.fd</value>
diff --git a/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml b/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml
index b93d00ece197..73436b69ea7f 100644
--- a/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml
+++ b/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml
@@ -4,6 +4,7 @@
<machine>s390-ccw-virtio-2.7</machine>
<arch>s390x</arch>
<vcpu max='248'/>
+ <iothreads/>
<os supported='yes'>
<loader supported='yes'>
<value>/usr/share/AAVMF/AAVMF_CODE.fd</value>
diff --git a/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml b/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml
index d860cd833fed..f2d728b0f72e 100644
--- a/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml
@@ -4,6 +4,7 @@
<machine>pc-i440fx-2.8</machine>
<arch>x86_64</arch>
<vcpu max='255'/>
+ <iothreads/>
<os supported='yes'>
<loader supported='yes'>
<value>/usr/share/AAVMF/AAVMF_CODE.fd</value>
diff --git a/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml b/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml
index ee40d1e84ec3..1f22724912c5 100644
--- a/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml
+++ b/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml
@@ -4,6 +4,7 @@
<machine>s390-ccw-virtio-2.8</machine>
<arch>s390x</arch>
<vcpu max='248'/>
+ <iothreads/>
<os supported='yes'>
<loader supported='yes'>
<value>/usr/share/AAVMF/AAVMF_CODE.fd</value>
diff --git a/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml b/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml
index 33161f7b8234..94f6acb100cf 100644
--- a/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml
@@ -4,6 +4,7 @@
<machine>pc-i440fx-2.8</machine>
<arch>x86_64</arch>
<vcpu max='255'/>
+ <iothreads/>
<os supported='yes'>
<loader supported='yes'>
<value>/usr/share/AAVMF/AAVMF_CODE.fd</value>
diff --git a/tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml b/tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml
index 07e1db641a76..8fe95efad421 100644
--- a/tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml
@@ -4,6 +4,7 @@
<machine>pc-q35-2.9</machine>
<arch>x86_64</arch>
<vcpu max='288'/>
+ <iothreads/>
<os supported='yes'>
<loader supported='yes'>
<value>/usr/share/AAVMF/AAVMF_CODE.fd</value>
diff --git a/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml b/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml
index 6c2bbac190c7..4dd15fd0dddc 100644
--- a/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml
@@ -4,6 +4,7 @@
<machine>pc-i440fx-2.9</machine>
<arch>x86_64</arch>
<vcpu max='255'/>
+ <iothreads/>
<os supported='yes'>
<loader supported='yes'>
<value>/usr/share/AAVMF/AAVMF_CODE.fd</value>
diff --git a/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml b/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml
index 2fc3b721389d..f7077d2b75b1 100644
--- a/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml
@@ -4,6 +4,7 @@
<machine>pc-i440fx-2.9</machine>
<arch>x86_64</arch>
<vcpu max='255'/>
+ <iothreads/>
<os supported='yes'>
<loader supported='yes'>
<value>/usr/share/AAVMF/AAVMF_CODE.fd</value>
--
2.17.0
6 years, 7 months
[libvirt] [PATCH] virNumaGetHugePageInfo: Return page_avail and page_free as ULL
by Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1569678
On some large systems (with ~400GB of RAM) it is possible for
unsigned int to overflow in which case we report invalid number
of 4K pages pool size. Switch to unsigned long long.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/conf/capabilities.c | 5 +++--
src/conf/capabilities.h | 2 +-
src/util/virhostmem.c | 2 +-
src/util/virnuma.c | 32 ++++++++++++++++++--------------
src/util/virnuma.h | 8 ++++----
tests/virnumamock.c | 4 ++--
6 files changed, 29 insertions(+), 24 deletions(-)
diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c
index c4ee7efb5f..dd2fc77f91 100644
--- a/src/conf/capabilities.c
+++ b/src/conf/capabilities.c
@@ -816,7 +816,7 @@ virCapabilitiesFormatNUMATopology(virBufferPtr buf,
cells[i]->mem);
for (j = 0; j < cells[i]->npageinfo; j++) {
- virBufferAsprintf(buf, "<pages unit='KiB' size='%u'>%zu</pages>\n",
+ virBufferAsprintf(buf, "<pages unit='KiB' size='%u'>%llu</pages>\n",
cells[i]->pageinfo[j].size,
cells[i]->pageinfo[j].avail);
}
@@ -1351,7 +1351,8 @@ virCapabilitiesGetNUMAPagesInfo(int node,
int *npageinfo)
{
int ret = -1;
- unsigned int *pages_size = NULL, *pages_avail = NULL;
+ unsigned int *pages_size = NULL;
+ unsigned long long *pages_avail = NULL;
size_t npages, i;
if (virNumaGetPages(node, &pages_size, &pages_avail, NULL, &npages) < 0)
diff --git a/src/conf/capabilities.h b/src/conf/capabilities.h
index 694a3590bf..f0a06a24df 100644
--- a/src/conf/capabilities.h
+++ b/src/conf/capabilities.h
@@ -107,7 +107,7 @@ typedef struct _virCapsHostNUMACellPageInfo virCapsHostNUMACellPageInfo;
typedef virCapsHostNUMACellPageInfo *virCapsHostNUMACellPageInfoPtr;
struct _virCapsHostNUMACellPageInfo {
unsigned int size; /* page size in kibibytes */
- size_t avail; /* the size of pool */
+ unsigned long long avail; /* the size of pool */
};
typedef struct _virCapsHostNUMACell virCapsHostNUMACell;
diff --git a/src/util/virhostmem.c b/src/util/virhostmem.c
index 11efe8c502..c923a1edf5 100644
--- a/src/util/virhostmem.c
+++ b/src/util/virhostmem.c
@@ -783,7 +783,7 @@ virHostMemGetFreePages(unsigned int npages,
for (cell = startCell; cell <= lastCell; cell++) {
for (i = 0; i < npages; i++) {
unsigned int page_size = pages[i];
- unsigned int page_free;
+ unsigned long long page_free;
if (virNumaGetPageInfo(cell, page_size, 0, NULL, &page_free) < 0)
goto cleanup;
diff --git a/src/util/virnuma.c b/src/util/virnuma.c
index bebe301f8d..784db0a7ce 100644
--- a/src/util/virnuma.c
+++ b/src/util/virnuma.c
@@ -563,8 +563,8 @@ virNumaGetHugePageInfoDir(char **path, int node)
static int
virNumaGetHugePageInfo(int node,
unsigned int page_size,
- unsigned int *page_avail,
- unsigned int *page_free)
+ unsigned long long *page_avail,
+ unsigned long long *page_free)
{
int ret = -1;
char *path = NULL;
@@ -579,7 +579,7 @@ virNumaGetHugePageInfo(int node,
if (virFileReadAll(path, 1024, &buf) < 0)
goto cleanup;
- if (virStrToLong_ui(buf, &end, 10, page_avail) < 0 ||
+ if (virStrToLong_ull(buf, &end, 10, page_avail) < 0 ||
*end != '\n') {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to parse: %s"),
@@ -598,7 +598,7 @@ virNumaGetHugePageInfo(int node,
if (virFileReadAll(path, 1024, &buf) < 0)
goto cleanup;
- if (virStrToLong_ui(buf, &end, 10, page_free) < 0 ||
+ if (virStrToLong_ull(buf, &end, 10, page_free) < 0 ||
*end != '\n') {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to parse: %s"),
@@ -645,8 +645,8 @@ int
virNumaGetPageInfo(int node,
unsigned int page_size,
unsigned long long huge_page_sum,
- unsigned int *page_avail,
- unsigned int *page_free)
+ unsigned long long *page_avail,
+ unsigned long long *page_free)
{
int ret = -1;
long system_page_size = virGetSystemPageSize();
@@ -709,8 +709,8 @@ virNumaGetPageInfo(int node,
int
virNumaGetPages(int node,
unsigned int **pages_size,
- unsigned int **pages_avail,
- unsigned int **pages_free,
+ unsigned long long **pages_avail,
+ unsigned long long **pages_free,
size_t *npages)
{
int ret = -1;
@@ -718,7 +718,9 @@ virNumaGetPages(int node,
DIR *dir = NULL;
int direrr = 0;
struct dirent *entry;
- unsigned int *tmp_size = NULL, *tmp_avail = NULL, *tmp_free = NULL;
+ unsigned int *tmp_size = NULL;
+ unsigned long long *tmp_avail = NULL;
+ unsigned long long *tmp_free = NULL;
unsigned int ntmp = 0;
size_t i;
bool exchange;
@@ -744,7 +746,9 @@ virNumaGetPages(int node,
while (dir && (direrr = virDirRead(dir, &entry, path)) > 0) {
const char *page_name = entry->d_name;
- unsigned int page_size, page_avail = 0, page_free = 0;
+ unsigned int page_size;
+ unsigned long long page_avail = 0;
+ unsigned long long page_free = 0;
char *end;
/* Just to give you a hint, we're dealing with this:
@@ -934,8 +938,8 @@ int
virNumaGetPageInfo(int node ATTRIBUTE_UNUSED,
unsigned int page_size ATTRIBUTE_UNUSED,
unsigned long long huge_page_sum ATTRIBUTE_UNUSED,
- unsigned int *page_avail ATTRIBUTE_UNUSED,
- unsigned int *page_free ATTRIBUTE_UNUSED)
+ unsigned long long *page_avail ATTRIBUTE_UNUSED,
+ unsigned long long *page_free ATTRIBUTE_UNUSED)
{
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("page info is not supported on this platform"));
@@ -946,8 +950,8 @@ virNumaGetPageInfo(int node ATTRIBUTE_UNUSED,
int
virNumaGetPages(int node ATTRIBUTE_UNUSED,
unsigned int **pages_size ATTRIBUTE_UNUSED,
- unsigned int **pages_avail ATTRIBUTE_UNUSED,
- unsigned int **pages_free ATTRIBUTE_UNUSED,
+ unsigned long long **pages_avail ATTRIBUTE_UNUSED,
+ unsigned long long **pages_free ATTRIBUTE_UNUSED,
size_t *npages ATTRIBUTE_UNUSED)
{
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
diff --git a/src/util/virnuma.h b/src/util/virnuma.h
index e4e1fd0b97..a3ffb6d6c7 100644
--- a/src/util/virnuma.h
+++ b/src/util/virnuma.h
@@ -52,12 +52,12 @@ int virNumaGetNodeCPUs(int node, virBitmapPtr *cpus) ATTRIBUTE_NOINLINE;
int virNumaGetPageInfo(int node,
unsigned int page_size,
unsigned long long huge_page_sum,
- unsigned int *page_avail,
- unsigned int *page_free);
+ unsigned long long *page_avail,
+ unsigned long long *page_free);
int virNumaGetPages(int node,
unsigned int **pages_size,
- unsigned int **pages_avail,
- unsigned int **pages_free,
+ unsigned long long **pages_avail,
+ unsigned long long **pages_free,
size_t *npages)
ATTRIBUTE_NONNULL(5) ATTRIBUTE_NOINLINE;
int virNumaSetPagePoolSize(int node,
diff --git a/tests/virnumamock.c b/tests/virnumamock.c
index d8f90b81b3..475efc1f34 100644
--- a/tests/virnumamock.c
+++ b/tests/virnumamock.c
@@ -125,8 +125,8 @@ virNumaGetDistances(int node ATTRIBUTE_UNUSED,
int
virNumaGetPages(int node,
unsigned int **pages_size,
- unsigned int **pages_avail,
- unsigned int **pages_free,
+ unsigned long long **pages_avail,
+ unsigned long long **pages_free,
size_t *npages)
{
const int pages_def[] = { 4, 2 * 1024, 1 * 1024 * 1024};
--
2.16.1
6 years, 7 months
[libvirt] [PATCH v2 0/2] fix parallel shutdown in libvirt-guests.sh
by Christian Ehrhardt
Working on a few issues in parallel shutdown. The first is fixing a real issue,
while the latter avoids printing a message with an empty variable.
*Updates since V1*
- added Reviewed-by to patch #1
- added second patch to skip the message without a guest nama
Christian Ehrhardt (2):
tools: fix check_guests_shutdown loop
tools: do not report unknown guests in print_guests_shutdown
tools/libvirt-guests.sh.in | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
--
2.7.4
6 years, 7 months
[libvirt] [PATCH 0/4] Reimplement logging wildcards to use full shell glob syntax
by Daniel P. Berrangé
This series provides a more generalized support for wildcards
in logging and removes the ordering constraint.
Daniel P. Berrangé (4):
Revert "util: virlog: Introduce wildcard to log filters"
log: rename virLogFlags to virLogFilterFlags to match docs
log: support logging using shell wildcard syntax
log: update docs for daemons to improve user understanding
src/locking/test_virtlockd.aug.in | 2 +-
src/locking/virtlockd.conf | 70 ++++++++++++++++++++++++++----------
src/logging/test_virtlogd.aug.in | 2 +-
src/logging/virtlogd.conf | 73 +++++++++++++++++++++++++++-----------
src/remote/libvirtd.conf | 74 ++++++++++++++++++++++++---------------
src/remote/test_libvirtd.aug.in | 2 +-
src/util/virlog.c | 61 +++++++++-----------------------
src/util/virlog.h | 4 +--
8 files changed, 169 insertions(+), 119 deletions(-)
--
2.14.3
6 years, 7 months