Cole Robinson | 28 Jun 21:10 2016
Picon
Gravatar

[libvirt] [PATCH python] allow pkg-config binary to be set by env

From: Markus Rothe <markusr815 <at> gmail.com>

https://bugzilla.redhat.com/show_bug.cgi?id=1350523
---
 setup.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/setup.py b/setup.py
index 099b1e0..a4cfb88 100755
--- a/setup.py
+++ b/setup.py
 <at>  <at>  -28,6 +28,8  <at>  <at>  _pkgcfg = -1
 def get_pkgcfg(do_fail=True):
     global _pkgcfg
     if _pkgcfg == -1:
+        _pkgcfg = os.getenv('PKG_CONFIG')
+    if _pkgcfg is None:
         _pkgcfg = distutils.spawn.find_executable("pkg-config")
     if _pkgcfg is None and do_fail:
         raise Exception("pkg-config binary is required to compile libvirt-python")
--

-- 
2.7.4

Jim Fehlig | 28 Jun 19:39 2016
Gravatar

[libvirt] question about PCI new_id sysfs interface

After updating the dom0 kernel on one of my Xen test hosts, I noticed problems 
with PCI hostdev management. E.g

# virsh nodedev-detach pci_0000_07_10_1
error: Failed to detach device pci_0000_07_10_1
error: Failed to add PCI device ID '8086 1520' to pciback: File exists

It turns out there was a small interface change to new_id with the following 
commit to 3.16 kernel

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/pci/pci-driver.c?h=v3.16&id=8895d3bcb8ba960b1b83f95d772b641352ea8e51

which now causes xen_pciback to fail writes of "vendorid productid" to new_id. e.g.

# echo "8086 1520" > /sys/bus/pci/drivers/pciback/new_id
-bash: echo: write error: File exists

Interestingly, vfio doesn't encounter the same error

# echo "8086 1520" > /sys/bus/pci/drivers/vfio-pci/new_id
# echo $?
0

vfio-pci has:
static struct pci_driver vfio_pci_driver = {
         .name           = "vfio-pci",
         .id_table       = NULL, /* only dynamic ids */

while xen-pciback has:
static const struct pci_device_id pcistub_ids[] = {
(Continue reading)

Yang hongyang | 25 Jun 05:53 2016
Picon

[libvirt] [PATCH] Fix compile error for stable 1.2.9

Seems a backport miss. An extra member is passed to struct
virLXCBasicMountInfo.

Signed-off-by: Yang hongyang <hongyang.yang <at> easystack.cn>
---
 src/lxc/lxc_container.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 28dabec..1c65fa9 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
 <at>  <at>  -760,7 +760,7  <at>  <at>  typedef struct {

 static const virLXCBasicMountInfo lxcBasicMounts[] = {
     { "proc", "/proc", "proc", MS_NOSUID|MS_NOEXEC|MS_NODEV, false, false },
-    { "/proc/sys", "/proc/sys", NULL, MS_BIND|MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_RDONLY, false, false,
false },
+    { "/proc/sys", "/proc/sys", NULL, MS_BIND|MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_RDONLY, false, false },
     { "sysfs", "/sys", "sysfs", MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_RDONLY, false, false },
     { "securityfs", "/sys/kernel/security", "securityfs", MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_RDONLY,
true, true },
 #if WITH_SELINUX
--

-- 
1.7.1

Michal Privoznik | 28 Jun 15:02 2016
Picon

[libvirt] [PATCH] virStorageTranslateDiskSourcePool: Avoid double free

https://bugzilla.redhat.com/show_bug.cgi?id=1316370

Consider the following disk for a domain:

    <disk type='volume' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <auth username='libvirt'>
        <secret type='iscsi' usage='libvirtiscsi'/>
      </auth>
      <source pool='iscsi-secret-pool' volume='unit:0:0:0' mode='direct' startupPolicy='optional'/>
      <target dev='sda' bus='scsi'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

Now, startupPolicy is currently not allowed for iscsi disks, so
one would expect an error message to be thrown. But what a
surprise is waiting for users if they try to start up such
domain:

==15724== Invalid free() / delete / delete[] / realloc()
==15724==    at 0x4C2B1F0: free (vg_replace_malloc.c:473)
==15724==    by 0x54B7A69: virFree (viralloc.c:582)
==15724==    by 0x552DC90: virStorageAuthDefFree (virstoragefile.c:1549)
==15724==    by 0x552F023: virStorageSourceClear (virstoragefile.c:2055)
==15724==    by 0x552F054: virStorageSourceFree (virstoragefile.c:2067)
==15724==    by 0x55556AA: virDomainDiskDefFree (domain_conf.c:1562)
==15724==    by 0x5557ABE: virDomainDefFree (domain_conf.c:2547)
==15724==    by 0x1B43CC42: qemuProcessStop (qemu_process.c:5918)
==15724==    by 0x1B43BA2E: qemuProcessStart (qemu_process.c:5511)
(Continue reading)

Jiri Denemark | 28 Jun 14:45 2016
Picon

[libvirt] [PATCH] qemu: Let empty default VNC password work as documented

Setting an empty vnc_password in qemu.conf is documented as a way to
disable VNC access, but QEMU does not seem to behave like that. Let's
enforce the behavior by setting password expiration to "now".

Note, this has no effect on setting an empty //graphics <at> passwd in
domain XML. Users may use //graphics <at> passwdValidTo to enforce the same
behavior.

https://bugzilla.redhat.com/show_bug.cgi?id=1180092

Signed-off-by: Jiri Denemark <jdenemar <at> redhat.com>
---
 src/qemu/qemu_hotplug.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index e0b8230..91f48dc 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
 <at>  <at>  -3970,6 +3970,8  <at>  <at>  qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
             snprintf(expire_time, sizeof(expire_time), "now");
         else
             snprintf(expire_time, sizeof(expire_time), "%lu", (long unsigned)auth->validTo);
+    } else if (!auth->passwd && defaultPasswd && defaultPasswd[0] == '\0') {
+        snprintf(expire_time, sizeof(expire_time), "now");
     } else {
         snprintf(expire_time, sizeof(expire_time), "never");
     }
--

-- 
2.9.0
(Continue reading)

Peter Krempa | 28 Jun 14:43 2016
Picon

[libvirt] [PATCH] conf: Allocate structure for 'perf' events in virDomainDefNew

Some code paths already assume that it is allocated since it was always
allocated by virDomainPerfDefParseXML. Move allocation to
virDomainDefNew to handle cases that don't go through the XML parser.

This fixes crash when attempting to connect to an existing process via
virDomainQemuAttach.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1350688
---
 src/conf/domain_conf.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index ef266af..fb622cd 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
 <at>  <at>  -2746,6 +2746,9  <at>  <at>  virDomainDefNew(void)
     if (!(ret->numa = virDomainNumaNew()))
         goto error;

+    if (VIR_ALLOC(ret->perf) < 0)
+        goto error;
+
     ret->mem.hard_limit = VIR_DOMAIN_MEMORY_PARAM_UNLIMITED;
     ret->mem.soft_limit = VIR_DOMAIN_MEMORY_PARAM_UNLIMITED;
     ret->mem.swap_hard_limit = VIR_DOMAIN_MEMORY_PARAM_UNLIMITED;
 <at>  <at>  -13136,9 +13139,6  <at>  <at>  virDomainPerfDefParseXML(virDomainDefPtr def,
     if ((n = virXPathNodeSet("./perf/event", ctxt, &nodes)) < 0)
         return n;

(Continue reading)

Jiri Denemark | 28 Jun 14:01 2016
Picon

[libvirt] [PATCH] docs: Warn against locked memory limit too high

https://bugzilla.redhat.com/show_bug.cgi?id=1046833

Signed-off-by: Jiri Denemark <jdenemar <at> redhat.com>
---
 docs/formatdomain.html.in | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index f660aa6..b0b2f82 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
 <at>  <at>  -862,8 +862,11  <at>  <at> 
         be allowed to swap them out. For QEMU/KVM this requires
         <code>hard_limit</code> <a href="#elementsMemoryTuning">memory tuning</a>
         element to be used and set to the maximum memory configured for the
-        domain plus any memory consumed by the QEMU process itself.
-        <span class="since">Since 1.0.6</span></dd>
+        domain plus any memory consumed by the QEMU process itself. Beware of
+        setting the memory limit too high (and thus allowing the domain to lock
+        most of the host's memory). Doing so may be dangerous to both the
+        domain and the host itself since the host's kernel may run out of
+        memory. <span class="since">Since 1.0.6</span></dd>
     </dl>

 
--

-- 
2.9.0

Michal Privoznik | 28 Jun 13:43 2016
Picon

[libvirt] [libvirt-perl][PATCH 0/3] Fix a few memleaks

I've noticed these while trying to write support for the new
libvirt APIs (but Dan was quicker :-)).

Michal Privoznik (3):
  Prefer virTypedParameterPtr over virTypedParameter *
  get/set_memory_parameters: Favour virTypedParameter over
    virMemoryParameter
  Substitute Safefree with virTypedParamsFree

 Virt.xs | 146 ++++++++++++++++++++++++++++++++--------------------------------
 1 file changed, 74 insertions(+), 72 deletions(-)

--

-- 
2.8.4

Jaroslav Suchanek | 28 Jun 13:05 2016
Picon

[libvirt] [PATCH v2] logging: fixing log level initialization from cmdline

Reorder code for setting default log level from cmdline prior
initialization of log outputs. Thus the --verbose option is reflected.

This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1325072
---

Notes:
    v2: moving up the cmdline override for default logging level also
        for the virlockd

 src/locking/lock_daemon.c | 12 ++++++------
 src/logging/log_daemon.c  | 12 ++++++------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c
index 2c45349..9509e0c 100644
--- a/src/locking/lock_daemon.c
+++ b/src/locking/lock_daemon.c
 <at>  <at>  -482,6 +482,12  <at>  <at>  virLockDaemonSetupLogging(virLockDaemonConfigPtr config,
         virLogParseOutputs(config->log_outputs);

     /*
+     * Command line override for --verbose
+     */
+    if ((verbose) && (virLogGetDefaultPriority() > VIR_LOG_INFO))
+        virLogSetDefaultPriority(VIR_LOG_INFO);
+
+    /*
      * If no defined outputs, and either running
      * as daemon or not on a tty, then first try
(Continue reading)

Andrea Bolognani | 28 Jun 10:11 2016
Picon

[libvirt] [PATCH] vz: Fix indentation in prlsdkGetNetAddresses()

---
Pushed as trivial.

 src/vz/vz_sdk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index 7e75e44..ae218e9 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
 <at>  <at>  -829,7 +829,7  <at>  <at>  prlsdkGetNetAddresses(PRL_HANDLE sdknet, virDomainNetDefPtr net)
     prlsdkCheckRetGoto(pret, cleanup);

     for (i = 0; i < num; ++i) {
-       virNetDevIPAddrPtr ip = NULL;
+        virNetDevIPAddrPtr ip = NULL;
         PRL_UINT32 buflen = 0;
         char *addr;

--

-- 
2.7.4

Cole Robinson | 27 Jun 20:28 2016
Picon
Gravatar

[libvirt] [PATCH] virt-admin: Call virInitialize to fix startup crash

Similar to what virsh and virt-login-shell do

https://bugzilla.redhat.com/show_bug.cgi?id=1350315
---
I can't actually reproduce the bug, the backtrace is similar to
97973ebb7 which added the same fix for virt-login-shell, and
that commit also mentions the randomness of reproducing...

 tools/virt-admin.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/virt-admin.c b/tools/virt-admin.c
index 4acac65..7bff5c3 100644
--- a/tools/virt-admin.c
+++ b/tools/virt-admin.c
 <at>  <at>  -1371,6 +1371,11  <at>  <at>  main(int argc, char **argv)
         return EXIT_FAILURE;
     }

+    if (virInitialize() < 0) {
+        vshError(ctl, "%s", _("Failed to initialize libvirt"));
+        return EXIT_FAILURE;
+    }
+
     virFileActivateDirOverride(argv[0]);

     if (!vshInit(ctl, cmdGroups, NULL))
--

-- 
2.7.4

(Continue reading)


Gmane