John Ferlan | 3 Sep 20:51 2015
Picon

[libvirt] [PATCH v2 0/2] Need to perform address checks for ccw/s390

Assumptions were made that if someone provided an address type ccw or
s390 that it would occur only if using an enabled emulator.  Turns out
that premise isn't necessarily true and it leads to libvirtd crashing
for hotplugs and qemu start errors for config paths.

These patches will make the checks prior to crashes or qemu process
starts in order to avoid the situation.

v1:
http://www.redhat.com/archives/libvir-list/2015-August/msg01043.html

Changes since v1...

... Implement a function to handle the s390-ccw check using STRPREFIX
    instead of a mix of STRPREFIX and STREQLEN

... Create qemuCheckCCWS390AddressSupport to handle checking address
    type if defined on entry to disk, controller, and rng device additions
    whether through hotplug or config options.

NB: It doesn't seem network devices are afflicted, although perhaps
    I read the code wrong. It seems for a network device there is/was
    none of the set the default address if undefined code added.

John Ferlan (2):
  qemu: Introduce qemuDomainMachineIsS390CCW
  qemu: Need to check for machine.os when using ADDRESS_TYPE_CCW

 src/qemu/qemu_command.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++--
 src/qemu/qemu_command.h |  5 +++++
(Continue reading)

Jim Fehlig | 3 Sep 19:40 2015

[libvirt] [PATCH V2] libxl: don't overwrite error from virNetSocketNewConnectTCP()

Remove redundant error reporting in libxlDomainMigrationPerform().
virNetSocketNewConnectTCP() is perfectly capable of reporting
sensible errors.

Signed-off-by: Jim Fehlig <jfehlig <at> suse.com>
---

V2:
Actually try to compile the code and find saved_errno is no
longer used - remove it.

 src/libxl/libxl_migration.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/libxl/libxl_migration.c b/src/libxl/libxl_migration.c
index 9609e06..0d23e5f 100644
--- a/src/libxl/libxl_migration.c
+++ b/src/libxl/libxl_migration.c
 <at>  <at>  -472,7 +472,6  <at>  <at>  libxlDomainMigrationPerform(libxlDriverPrivatePtr driver,
     virURIPtr uri = NULL;
     virNetSocketPtr sock;
     int sockfd = -1;
-    int saved_errno = EINVAL;
     int ret = -1;

     /* parse dst host:port from uri */
 <at>  <at>  -487,12 +486,8  <at>  <at>  libxlDomainMigrationPerform(libxlDriverPrivatePtr driver,
     /* socket connect to dst host:port */
     if (virNetSocketNewConnectTCP(hostname, portstr,
                                   AF_UNSPEC,
(Continue reading)

Cédric Bosdonnat | 3 Sep 17:57 2015

[libvirt] [sandbox] Add ext4 module to QEMU initrd

Some distros don't have ext4 built in their kernel, but as a module.
Make sure the ext4 module is loaded or we will fail loading root
host-images on those distros.
---
 libvirt-sandbox/libvirt-sandbox-builder-machine.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libvirt-sandbox/libvirt-sandbox-builder-machine.c b/libvirt-sandbox/libvirt-sandbox-builder-machine.c
index 43372b5..3d3267a 100644
--- a/libvirt-sandbox/libvirt-sandbox-builder-machine.c
+++ b/libvirt-sandbox/libvirt-sandbox-builder-machine.c
 <at>  <at>  -184,6 +184,13  <at>  <at>  static gchar *gvir_sandbox_builder_machine_mkinitrd(GVirSandboxConfig *config,
     /* For dhclient to work */
     gvir_sandbox_config_initrd_add_module(initrd, "af_packet.ko");

+    /* In case ext4 is built as a module, include it and its deps
+     * for the root mount */
+    gvir_sandbox_config_initrd_add_module(initrd, "mbcache.ko");
+    gvir_sandbox_config_initrd_add_module(initrd, "jbd2.ko");
+    gvir_sandbox_config_initrd_add_module(initrd, "crc16.ko");
+    gvir_sandbox_config_initrd_add_module(initrd, "ext4.ko");
+
     if (!gvir_sandbox_builder_initrd_construct(builder, initrd, targetfile, error))
         goto cleanup;

--

-- 
2.1.4

Pavel Hrdina | 3 Sep 17:42 2015
Picon

[libvirt] [PATCH v2] domain-conf: escape string for socket attribute

Commit d091518b tried to escape all strings in produced XML, but missed
this one.

Signed-off-by: Pavel Hrdina <phrdina <at> redhat.com>
---
 src/conf/domain_conf.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 69225f4..f95190f 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
 <at>  <at>  -21118,9 +21118,7  <at>  <at>  virDomainGraphicsDefFormat(virBufferPtr buf,
     switch (def->type) {
     case VIR_DOMAIN_GRAPHICS_TYPE_VNC:
         if (def->data.vnc.socket) {
-            if (def->data.vnc.socket)
-                virBufferAsprintf(buf, " socket='%s'",
-                                  def->data.vnc.socket);
+            virBufferEscapeString(buf, " socket='%s'", def->data.vnc.socket);
         } else {
             if (def->data.vnc.port &&
                 (!def->data.vnc.autoport || !(flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE)))
--

-- 
2.5.1

Pavel Fedin | 3 Sep 14:49 2015

[libvirt] [PATCH 0/3] Implement mockup capabilities cache in QEMU tests

Since commit e8d55172544c1fafe31a9e09346bdebca4f0d6f9 qemu driver checks
emulator capabilities during domain XML post-parse. However, test suite
does not initialize it, therefore a condition to skip all checks if there
is no cache supplied was added. This is actually a hack, whose sole
purpose is to make existing test suite working. Additionally, it prevents
from writing new tests for this particular functionality.

This series solves this problem by implementing proper cache mockup in test
suite. The main idea is to create a cache in standard way and put there
pre-defined capabilities sets (which tests already have).

In this implementation we introduce "test capability sets", which are named
entities. virQEMUCapsCacheLookup() now has a test mode, which is enabled
by setting qemuTestCapsName variable to the name of capability set which
we want to use in current test. This is based on Martin Kletzander's idea
to implement test mode with assertions. Currently, since name of capability
set is different from /usr/bin/something, we will get errors if we try to
do something with the host filesystem. This is achieved by setting cacheDir
and libDir of our mockup cache to "/dev/null".

The concept of using named capability sets allows us to further improve the
test suite. Now it is possibe to get rid of hardcoded capability sets
and replace them with XML files, readable by virQEMUCapsInitCached().
This will allow us to better exercise our capabilities parser. Taking this
into account, qemuTestCapsCacheInsert() is actually temporary. It will not
be needed any more when capabilities are moved to XML files.

Additionally, some small refactoring is done, and common driver
initialization and cleanup sequence is put into two functions:
qemuTestDriverInit() and qemuTestDriverFree().
(Continue reading)

Michal Privoznik | 3 Sep 14:45 2015
Picon

[libvirt] [PATCH] vshInit: Don't leak <at> histsize_env

Caller is responsible for freeing the result of virStringJoin()
when no longer needed:

==10701== 1 bytes in 1 blocks are definitely lost in loss record 1 of 806
==10701==    at 0x4C29F80: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==10701==    by 0xAADB679: strdup (in /lib64/libc-2.20.so)
==10701==    by 0x4F18655: virStrdup (virstring.c:726)
==10701==    by 0x4F175AF: virStringJoin (virstring.c:165)
==10701==    by 0x131D4D: vshReadlineInit (vsh.c:2572)
==10701==    by 0x1322DF: vshInit (vsh.c:2736)
==10701==    by 0x1347C1: main (virsh.c:907)

Signed-off-by: Michal Privoznik <mprivozn <at> redhat.com>
---
 tools/vsh.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/vsh.c b/tools/vsh.c
index 1a5b6e8..54c4614 100644
--- a/tools/vsh.c
+++ b/tools/vsh.c
 <at>  <at>  -2552,8 +2552,8  <at>  <at>  vshReadlineInit(vshControl *ctl)
     char *name_capitalized = NULL;
     int max_history = 500;
     int ret = -1;
+    char *histsize_env = NULL;
     const char *histsize_str = NULL;
-    const char *histsize_env = NULL;
     const char *strings[] = {
         name_capitalized,
(Continue reading)

Ian Campbell | 3 Sep 12:14 2015

[libvirt] [PATCH] libxl: report correct errno from virNetSocketNewConnectTCP on migration

saved_errno is never written to in this function after it is
initialised and it is only used to log the failure from
virNetSocketNewConnectTCP masking the real errno from that function.

Drop saved_errno and use errno itself.

Signed-off-by: Ian Campbell <ian.campbell <at> citrix.com>
---
 src/libxl/libxl_migration.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/libxl/libxl_migration.c b/src/libxl/libxl_migration.c
index 39e4a65..e291d71 100644
--- a/src/libxl/libxl_migration.c
+++ b/src/libxl/libxl_migration.c
 <at>  <at>  -480,7 +480,6  <at>  <at>  libxlDomainMigrationPerform(libxlDriverPrivatePtr driver,
     virURIPtr uri = NULL;
     virNetSocketPtr sock;
     int sockfd = -1;
-    int saved_errno = EINVAL;
     int ret = -1;

     /* parse dst host:port from uri */
 <at>  <at>  -496,7 +495,7  <at>  <at>  libxlDomainMigrationPerform(libxlDriverPrivatePtr driver,
     if (virNetSocketNewConnectTCP(hostname, portstr,
                                   AF_UNSPEC,
                                   &sock) < 0) {
-        virReportSystemError(saved_errno,
+        virReportSystemError(errno,
                              _("unable to connect to '%s:%s'"),
(Continue reading)

Cédric Bosdonnat | 3 Sep 11:51 2015

[libvirt] [PATCH v2] lxc: fuse mount for /proc/cpuinfo

We already have a fuse mount to reflect the cgroup memory restrictions
in the container. This commit adds the same for the number of available
CPUs. Only the CPUs listed by virProcessGetAffinity are shown in the
container's cpuinfo.
---
 src/lxc/lxc_container.c |  42 ++++++++++++-------
 src/lxc/lxc_fuse.c      | 106 +++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 133 insertions(+), 15 deletions(-)

diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index a433552..7ae13a8 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
 <at>  <at>  -1055,24 +1055,38  <at>  <at>  static int lxcContainerMountProcFuse(virDomainDefPtr def,
                                      const char *stateDir)
 {
     int ret;
-    char *meminfo_path = NULL;
+    char *src_path = NULL;
+    char *dst_path = NULL;
+    const char *paths[] = {"meminfo", "cpuinfo"};
+    size_t i;

-    VIR_DEBUG("Mount /proc/meminfo stateDir=%s", stateDir);
+    for (i = 0; i < 2; i++) {
+        VIR_DEBUG("Mount /proc/%s stateDir=%s", paths[i], stateDir);
+
+        if ((ret = virAsprintf(&src_path,
+                               "/.oldroot/%s/%s.fuse/%s",
+                               stateDir,
(Continue reading)

Andrea Bolognani | 2 Sep 18:13 2015
Picon

[libvirt] [PATCH v2 0/2] qemu: Default to virtio-net where available

This new version of the patch addresses Martin's comments
by using capabilities to detect whether virtio-net can be
used, and if that is the case, does so on all architectures.

Plus, the commit messages are slightly less terse this time
around :)

Cheers.

Andrea Bolognani (2):
  qemu: Introduce QEMU_CAPS_DEVICE_VIRTIO_NET capability
  qemu: Default to virtio-net where available

 src/qemu/qemu_capabilities.c                  |  7 ++++++-
 src/qemu/qemu_capabilities.h                  |  1 +
 src/qemu/qemu_domain.c                        | 19 ++++++++++++++-----
 tests/qemucapabilitiesdata/caps_1.2.2-1.caps  |  1 +
 tests/qemucapabilitiesdata/caps_1.3.1-1.caps  |  1 +
 tests/qemucapabilitiesdata/caps_1.4.2-1.caps  |  1 +
 tests/qemucapabilitiesdata/caps_1.5.3-1.caps  |  1 +
 tests/qemucapabilitiesdata/caps_1.6.0-1.caps  |  1 +
 tests/qemucapabilitiesdata/caps_1.6.50-1.caps |  1 +
 tests/qemucapabilitiesdata/caps_2.1.1-1.caps  |  1 +
 tests/qemuhelptest.c                          | 18 ++++++++++++------
 11 files changed, 40 insertions(+), 12 deletions(-)

--

-- 
2.4.3

(Continue reading)

Michal Privoznik | 2 Sep 17:58 2015
Picon

[libvirt] [PATCH v2 0/2] Improve domblklist for network disks

This is a v2 to original proposal:

  https://www.redhat.com/archives/libvir-list/2015-August/msg01021.html

Lin Ma (1):
  virsh: Enhance the detailed output of domblklist for networked source

Michal Privoznik (1):
  virsh: Slightly rework cmdDomblklist

 tools/virsh-domain-monitor.c | 93 ++++++++++++++++++++++++++++++++++----------
 1 file changed, 73 insertions(+), 20 deletions(-)

--

-- 
2.4.6

Cédric Bosdonnat | 2 Sep 09:54 2015

[libvirt] [PATCH] lxc: fuse mount for /proc/cpuinfo

We already have a fuse mount to reflect the cgroup memory restrictions
in the container. This commit adds the same for the number of available
CPUs. Only the CPUs listed by virProcessGetAffinity are shown in the
container's cpuinfo.
---
 src/lxc/lxc_container.c |  42 ++++++++++++-------
 src/lxc/lxc_fuse.c      | 109 +++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 136 insertions(+), 15 deletions(-)

diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index a433552..7ae13a8 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
 <at>  <at>  -1055,24 +1055,38  <at>  <at>  static int lxcContainerMountProcFuse(virDomainDefPtr def,
                                      const char *stateDir)
 {
     int ret;
-    char *meminfo_path = NULL;
+    char *src_path = NULL;
+    char *dst_path = NULL;
+    const char *paths[] = {"meminfo", "cpuinfo"};
+    size_t i;

-    VIR_DEBUG("Mount /proc/meminfo stateDir=%s", stateDir);
+    for (i = 0; i < 2; i++) {
+        VIR_DEBUG("Mount /proc/%s stateDir=%s", paths[i], stateDir);
+
+        if ((ret = virAsprintf(&src_path,
+                               "/.oldroot/%s/%s.fuse/%s",
+                               stateDir,
(Continue reading)


Gmane