Eric Blake | 24 Oct 22:56 2014
Picon

[libvirt] [PATCH v2] qemu: better error message when block job can't succeed

https://bugzilla.redhat.com/show_bug.cgi?id=1140981 reports that
the qemu-kvm shipped as part of RHEL 7.0 intentionally cripples
block jobs by removing the 'block-stream' QMP command, but that
our probe for whether block jobs work was merely whether
'block-job-cancel' exists.  As the crippling did not remove
job cancellation, we end up trying the qemu command and printing
an ugly message:

 error: Requested operation is not valid: Command 'block-stream' is not found

even though our code base was already prepared to print a nice
message that jobs are unsupported:

 error: unsupported configuration: block jobs not supported with this qemu binary

Doing one more QMP probe lets us match the reality of crippled qemu.
Yes, we really have to cater to two spellings of the command, due to
older upstream qemu.

* src/qemu/qemu_capabilities.h (QEMU_CAPS_BLOCK_STREAM): New probe.
* src/qemu/qemu_capabilities.c (virQEMUCapsProbeQMPCommands): Kill
block jobs with nice error message if qemu is crippled.

Signed-off-by: Eric Blake <eblake <at> redhat.com>
---
 src/qemu/qemu_capabilities.c | 11 +++++++++++
 src/qemu/qemu_capabilities.h |  1 +
 2 files changed, 12 insertions(+)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
(Continue reading)

Conrad Meyer | 24 Oct 22:28 2014
Picon

[libvirt] [PATCHv3 0/2] Add non-FreeBSD guest support to Bhyve driver.

Drvbhyve hardcodes bhyveload(8) as the host bootloader for guests.
bhyveload(8) loader only supports FreeBSD guests.

This patch adds <bootloader> and <bootloader_args> handling to
bhyve_command, so libvirt can boot non-FreeBSD guests in Bhyve.

See patch logs for further details.

Thanks,
Conrad

Changelog:
v3:
  - Based on latest git as of less than an hour ago; tested HDD booting a Linux
    guest several times.
  - Added first cut at CD booting. I'm not sure grub-bhyve supports this
    (was not able to to test it).
  - make 'syntax-check' clean
  - Per Roman (off-list), split up virBhyveProcessBuildLoadCmd into a few
    smaller functions.
  - Also per Roman (off-list), use virCommandAddArgSet() for bootloader_args.
    (Without the nasty cast, my compiler complains.)
v2:
  - Dropped hvm -> xen change per Peter's feedback.

Conrad Meyer (2):
  bhyve: Support /domain/bootloader configuration for non-FreeBSD
    guests.
  Generated PO files for 'bhyve: Support /domain/bootloader'

(Continue reading)

Eric Blake | 24 Oct 21:04 2014
Picon

Re: [libvirt] [PATCH v5 1/7] qemu: Add define for the news throttle options

On 10/07/2014 05:14 AM, Matthias Gatto wrote:
> Add defines for the news options total_bytes_sec_max, write_bytes_sec_max, read_bytes_sec_max,
total_iops_sec_max, write_iops_sec_max, read_iops_sec_max, size_iops_sec.

s/news/new/

Also, please wrap your commit messages to around 72 columns or so (git
log likes to indent messages, and lots of people still like to use
80-column messages, so anything longer results in annoying truncation or
wraparound on the display)

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

On 10/07/2014 05:14 AM, Matthias Gatto wrote:
> Add defines for the news options total_bytes_sec_max, write_bytes_sec_max, read_bytes_sec_max,
total_iops_sec_max, write_iops_sec_max, read_iops_sec_max, size_iops_sec.

s/news/new/

Also, please wrap your commit messages to around 72 columns or so (git
log likes to indent messages, and lots of people still like to use
80-column messages, so anything longer results in annoying truncation or
wraparound on the display)

--

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
(Continue reading)

Shanzhi Yu | 24 Oct 21:01 2014
Picon

[libvirt] [PATCH] util: fix libvirtd crash caused by virStorageNetHostTransportTypeFromString

When split uri->scheme into two strings with "+", the second one will be
"rdma://server/..", pass it to virStorageNetHostTransportTypeFromString
will lead libvirtd crash. So a second virStringSplit call is needed.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1156288
Signed-off-by: Shanzhi Yu <shyu <at> redhat.com>
---
 src/util/virstoragefile.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index 960aa23..795c188 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
 <at>  <at>  -2144,6 +2144,9  <at>  <at>  virStorageSourceParseBackingURI(virStorageSourcePtr src,
         goto cleanup;
     }

+    if (!(scheme = virStringSplit(scheme[1], ":", 2)))
+        goto cleanup;
+
     if (scheme[1] &&
         (src->hosts->transport = virStorageNetHostTransportTypeFromString(scheme[1])) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
--

-- 
1.9.3

Eric Blake | 24 Oct 20:43 2014
Picon

Re: [libvirt] [PATCH v5 1/7] qemu: Add define for the news throttle options

On 10/07/2014 05:14 AM, Matthias Gatto wrote:
> Add defines for the news options total_bytes_sec_max, write_bytes_sec_max, read_bytes_sec_max,
total_iops_sec_max, write_iops_sec_max, read_iops_sec_max, size_iops_sec.
> 
> Signed-off-by: Matthias Gatto <matthias.gatto <at> outscale.com>
> ---
>  include/libvirt/libvirt.h.in | 54 ++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 54 insertions(+)

Oops, because I took my time reviewing this, Dan has refactored this
file in the meantime, and the patch doesn't apply cleanly any more.  At
least the conflict resolution is obvious.

ACK. I'll push this after reviewing the rest of the series.

--

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

On 10/07/2014 05:14 AM, Matthias Gatto wrote:
> Add defines for the news options total_bytes_sec_max, write_bytes_sec_max, read_bytes_sec_max,
total_iops_sec_max, write_iops_sec_max, read_iops_sec_max, size_iops_sec.
> 
> Signed-off-by: Matthias Gatto <matthias.gatto <at> outscale.com>
> ---
>  include/libvirt/libvirt.h.in | 54 ++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 54 insertions(+)

(Continue reading)

Laine Stump | 24 Oct 19:57 2014

[libvirt] [PATCH] util: eliminate "use after free" in callers of virNetDevLinkDump

virNetDevLinkDump() gets a message from netlink into "resp", then
calls nlmsg_parse() to fill the table "tb" with pointers into resp. It
then returns tb to its caller, but not before freeing the buffer at
resp. That means that all the callers of virNetDevLinkDump() are
examining memory that has already been freed. This can be verified by
filling the buffer at resp with garbage prior to freeing it (or, I
suppose, just running libvirtd under valgrind) then performing some
operation that calls virNetDevLinkDump().

The code has been like this ever since virNetDevLinkDump() was written
- the original author didn't notice it, and neither did later
additional users of the function. It has only been pure luck (or maybe
a lack of heavy load, and/or maybe an allocation algorithm in malloc()
that delays re-use of just-freed memory) that has kept this from
causing errors, for example when configuring a PCI passthrough or
macvtap passthrough network interface.

The solution taken in this patch is the simplest - just return resp to
the caller along with tb, then have the caller free it after they are
finished using the data (pointers) in tb. I alternately could have
made a cleaner interface by creating a new struct that put tb and resp
together along with a vir*Free() function for it, but this function is
only used in a couple places, and I'm not sure there will be
additional new uses of virNetDevLinkDump(), so the value of adding a
new type, extra APIs, etc. is dubious.
---
 src/util/virnetdev.c             | 26 +++++++++++++++++---------
 src/util/virnetdev.h             |  2 +-
 src/util/virnetdevvportprofile.c | 17 ++++++++++++-----
 3 files changed, 30 insertions(+), 15 deletions(-)
(Continue reading)

Julio Faracco | 24 Oct 14:33 2014
Picon

[libvirt] [PATCH v2] tests: Adding SELINUX_LIBS to fix viridentitytest linker bug.

In a clean build system (Ubuntu 14.04), the viridentitytest failed to compile.
Even if all the SELINUX libraries and depedencies are installed. See the error
message below:

[...]
  CC       viridentitytest.o
  CCLD     viridentitytest
/usr/bin/ld: viridentitytest.o: undefined reference to symbol
                                                       'security_disable'
//lib/x86_64-linux-gnu/libselinux.so.1: error adding symbols: DSO missing
                                                           from command line
collect2: error: ld returned 1 exit status
make: *** [viridentitytest] Error 1

Simply adding the variable SELINUX_LIBS in viridentitytest rules of
Makefile.am to include SELINUX libraries into viridentitytest solved that
compilation issue. A conditional was added to consider when libvirt is using
or not SELINUX.

Signed-off-by: Julio Faracco <jcfaracco <at> gmail.com>
---
 tests/Makefile.am | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 4c3d4ef..363c902 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
 <at>  <at>  -926,11 +926,13  <at>  <at>  virstoragetest_LDADD = $(LDADDS) \

(Continue reading)

Shanzhi Yu | 24 Oct 11:31 2014
Picon

[libvirt] [PATCH] vbox: network: make sure driver not be NULL in virRegisterNetworkDriver

libvirtd will report below error if does not make sure driver not be NULL
in virRegisterNetworkDriver

$ libvirtd
2014-10-24 09:24:36.443+0000: 28876: info : libvirt version: 1.2.10
2014-10-24 09:24:36.443+0000: 28876: error : virRegisterNetworkDriver:549 : driver in
virRegisterNetworkDriver must not be NULL
2014-10-24 09:24:36.443+0000: 28876: error : virDriverLoadModule:99 : Failed module registration vboxNetworkRegister

Signed-off-by: Shanzhi Yu <shyu <at> redhat.com>
---
 src/vbox/vbox_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/vbox/vbox_driver.c b/src/vbox/vbox_driver.c
index 743a488..ff69069 100644
--- a/src/vbox/vbox_driver.c
+++ b/src/vbox/vbox_driver.c
 <at>  <at>  -152,7 +152,7  <at>  <at>  int vboxNetworkRegister(void)
     if (VBoxCGlueInit(&uVersion) == 0)
         networkDriver = vboxGetNetworkDriver(uVersion);

-    if (virRegisterNetworkDriver(networkDriver) < 0)
+    if ((networkDriver != NULL) && (virRegisterNetworkDriver(networkDriver) < 0)) 
         return -1;
     return 0;
 }
--

-- 
1.9.3

(Continue reading)

Erik Skultety | 24 Oct 11:17 2014
Picon

[libvirt] [PATCH] lxc: fix setmem effect on a running LXC machine

When user calls setmem on a running LXC machine, we do update its cgroup
entry (which is in odds with the original bug report, possibly resolved
by later versions), however we neither update domain's runtime XML nor
we update our internal structures and this patch fixes it.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1131919
---
 src/lxc/lxc_driver.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index b3e506f..03a00a9 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
 <at>  <at>  -749,6 +749,10  <at>  <at>  static int lxcDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
                                "%s", _("Failed to set memory for domain"));
                 goto cleanup;
             }
+
+            vm->def->mem.cur_balloon = newmem;
+            if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0)
+                goto cleanup;
         }

         if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
--

-- 
1.9.3

Jincheng Miao | 24 Oct 06:03 2014
Picon

[libvirt] [PATCH] remote: fix jump depends on uninitialised value

Currently remote driver only initializes partial fields of
remote_connect_get_all_domain_stats_args. But xdr_array()
will check the uninitialised field 'doms_val'.
For safty reason, memset all fields of args is better.

Fix the following error from valgrind, like:
==30515== 1 errors in context 1 of 3:
==30515== Conditional jump or move depends on uninitialised value(s)
==30515==    at 0x85E9402: xdr_array (xdr_array.c:88)
==30515==    by 0x4FD8FC9: xdr_remote_connect_get_all_domain_stats_args (remote_protocol.c:6473)
==30515==    by 0x4FE72F2: virNetMessageEncodePayload (virnetmessage.c:350)
==30515==    by 0x4FDD21C: virNetClientProgramCall (virnetclientprogram.c:326)
==30515==    by 0x4FB4D01: callFull.isra.2 (remote_driver.c:6667)
==30515==    by 0x4FCBD45: call (remote_driver.c:6689)
==30515==    by 0x4FCBD45: remoteConnectGetAllDomainStats (remote_driver.c:7793)
==30515==    by 0x4FA0E75: virConnectGetAllDomainStats (libvirt.c:21678)
==30515==    by 0x147FD1: cmdDomstats (virsh-domain-monitor.c:2148)
==30515==    by 0x13006B: vshCommandRun (virsh.c:1915)
==30515==    by 0x12A9E1: main (virsh.c:3699)

Signed-off-by: Jincheng Miao <jmiao <at> redhat.com>
---
 src/remote/remote_driver.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 067f2d0..b8d90ed 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
 <at>  <at>  -7779,6 +7779,8  <at>  <at>  remoteConnectGetAllDomainStats(virConnectPtr conn,
(Continue reading)

Taowei Luo | 24 Oct 03:46 2014
Picon

[libvirt] [PATCH 00/19] vbox: Rewrite the storage driver

This is the last part of rewriting vbox driver. The approache is almost
the same as the previous.
Some code problems such as copyright and irregular macros are fixed in
this series.

Taowei Luo (19):
  vbox: Fix copyright mistake
  vbox: Remove VBOX_OBJECT_CHECK macro
  vbox: move common codes to vbox_common.h
  vbox: Rewrite vbox-independent functions
  vbox: Rewrite vboxStoragePoolNumOfVolumes
  vbox: Rewrite vboxStoragePoolListVolumes
  vbox: Rewrite vboxStorageVolLookupByName
  vbox: Rewrite vboxStorageVolLookupByKey
  vbox: Make FindMedium support old vbox versions
  vbox: Rewrite vboxStorageVolLookupByPath
  vbox: Make CreateHardDisk support all vbox versions
  vbox: Rewrite vboxStorageVolCreateXML
  vbox: Make IMediumAttachment work with vbox2.2 and 3.0
  vbox: Rewrite vboxStorageVolDelete
  vbox: Rewrite vboxStorageVolGetInfo
  vbox: Rewrite vboxStorageVolGetXMLDesc
  vbox: Rewrite vboxStorageVolGetPath
  vbox: New storage driver
  vbox: Remove unused things in vbox_tmpl.c

 po/POTFILES.in                |    1 +
 src/Makefile.am               |   11 +-
 src/vbox/vbox_common.c        |  416 +++++++++------
 src/vbox/vbox_common.h        |  117 +++-
(Continue reading)


Gmane