Peter Krempa | 24 Jul 16:07 2014
Picon

[libvirt] [PATCH 0/3] Multiple RNG device support

Qemu and kernel support multiple RNG's, so I revived my old patch to add the support to libvirt.

Peter Krempa (3):
  qemu: cgroup: Don't use NULL path on default backed RNGs
  virtio-rng: allow multiple RNG devices
  test: qemu: Add tests for multiple virtio-rng devices

 src/conf/domain_audit.c                            |  4 +-
 src/conf/domain_conf.c                             | 58 +++++++++++-----------
 src/conf/domain_conf.h                             |  4 +-
 src/qemu/qemu_cgroup.c                             | 27 ++++++----
 src/qemu/qemu_command.c                            | 29 ++++++-----
 .../qemuxml2argv-virtio-rng-multiple.args          |  9 ++++
 .../qemuxml2argv-virtio-rng-multiple.xml           | 31 ++++++++++++
 tests/qemuxml2argvtest.c                           |  2 +
 8 files changed, 109 insertions(+), 55 deletions(-)
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-multiple.args
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-multiple.xml

--

-- 
2.0.0

Martin Kletzander | 24 Jul 15:46 2014
Picon

[libvirt] [PATCH 0/2] Allow display type selection in virsh domdisplay

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

Martin Kletzander (2):
  virsh: add error message when no graphical display is found
  virsh: add option for selecting domdisplay type

 tools/virsh-domain.c | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

--
2.0.2

John Ferlan | 24 Jul 15:31 2014
Picon

[libvirt] [PATCH] qemu: Remove extraneous space in function prototypes

During review of the iSCSI hostdev series, eblake noted that the
prototypes shouldn't have the extranenous space between the "*" and
the function name:

http://www.redhat.com/archives/libvir-list/2014-July/msg01227.html

Since it was more invasive than 1 or 2 lines - I said I'd send a
patch covering this once committed.

Signed-off-by: John Ferlan <jferlan <at> redhat.com>
---
NOTE: There are other instances of this in other trees - I figured
I'd just cover this particular directory.  I can do more if desired...

 src/qemu/qemu_capabilities.h |   2 +-
 src/qemu/qemu_command.h      | 136 +++++++++++++++++++++----------------------
 src/qemu/qemu_conf.h         |   2 +-
 3 files changed, 70 insertions(+), 70 deletions(-)

diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 4332633..d80daaa 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
 <at>  <at>  -310,7 +310,7  <at>  <at>  bool virQEMUCapsSupportsChardev(virDomainDefPtr def,
 bool virQEMUCapsIsMachineSupported(virQEMUCapsPtr qemuCaps,
                                    const char *canonical_machine);

-const char * virQEMUCapsGetDefaultMachine(virQEMUCapsPtr qemuCaps);
+const char *virQEMUCapsGetDefaultMachine(virQEMUCapsPtr qemuCaps);

(Continue reading)

Peter Krempa | 24 Jul 14:20 2014
Picon

[libvirt] [RFC] Memory hotplug for qemu guests and the relevant XML parts

Hi,

qemu recently added support for memory hotplug (hot unplug will arrive
later) since commit ~ bef3492d1169a54c966cecd0e0b1dd25e9341582 in qemu.git.

For the hotplug to work the VM needs to be started with a certain number
of "dimm" slots for plugging virtual memory modules. The memory of the
VM at startup has to occupy at least one of the slots. Later on the
management can decide to plug more memory to the guest by inserting a
virtual memory module into the guest.

For representing this in libvirt I'm thinking of using the <devices>
section of our domain XML where we'd add a new device type:

<memory type="ram">
	<source .../> <!-- will be elaborated below -->
	<target .../> <!-- will be elaborated below -->
	<address type="acpi-dimm" slot="1"/>
</memory>

type="ram" to denote that we are adding RAM memory. This will allow
possible extensions for example to add a generic pflash (type="flash",
type="rom") device or other
memory type mapped in the address space.

To enable this infrastructure qemu needs two command line options
supplied, one setting the maximum amount of supportable memory and the
second one the maximum number of memory modules (capped at 256 due to ACPI).

The current XML format for specifying memory looks like this:
(Continue reading)

Picon

[libvirt] Building libvirt-python under mingw32

Hello. I'm trying to build libvirt-python. And get these error messages:
http://s17.postimg.org/4uor0767z/libvirt_python.jpg

I have python 2.7.8 x86.

What can be problem with?
<div>Hello. I'm trying to build libvirt-python. And get these error messages:<br><a href="http://s17.postimg.org/4uor0767z/libvirt_python.jpg">http://s17.postimg.org/4uor0767z/libvirt_python.jpg</a><br><br>I have python 2.7.8 x86.<br><br>What can be problem with?</div>
Martin Kletzander | 24 Jul 14:03 2014
Picon

[libvirt] [PATCH] change blkiotune weight range min from 100 to 10

This reflects the same change made in kernel commit df457f845e (before
v2.6.38-rc7).  On the rare occasion when the user would try setting
the weight to value in range <10, 100) on older kernel, we will error
out with EINVAL properly.  Modifying the error message (adding a hint
for example) would cause weird logs, especially without stacked error
messages (I couldn't resist mentioning it again).

There is no (easy) way of getting the limits from kernel, since it's
not exposed.

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

Signed-off-by: Martin Kletzander <mkletzan <at> redhat.com>
---
 src/lxc/lxc_driver.c   | 4 ++--
 src/qemu/qemu_driver.c | 4 ++--
 tools/virsh-domain.c   | 2 +-
 tools/virsh.pod        | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 05d10b4..a7f4b87 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
 <at>  <at>  -2559,7 +2559,7  <at>  <at>  lxcDomainSetBlkioParameters(virDomainPtr dom,
             virTypedParameterPtr param = &params[i];

             if (STREQ(param->field, VIR_DOMAIN_BLKIO_WEIGHT)) {
-                if (params[i].value.ui > 1000 || params[i].value.ui < 100) {
+                if (params[i].value.ui > 1000 || params[i].value.ui < 10) {
                     virReportError(VIR_ERR_INVALID_ARG, "%s",
                                    _("out of blkio weight range."));
                     ret = -1;
 <at>  <at>  -2660,7 +2660,7  <at>  <at>  lxcDomainSetBlkioParameters(virDomainPtr dom,
             virTypedParameterPtr param = &params[i];

             if (STREQ(param->field, VIR_DOMAIN_BLKIO_WEIGHT)) {
-                if (params[i].value.ui > 1000 || params[i].value.ui < 100) {
+                if (params[i].value.ui > 1000 || params[i].value.ui < 10) {
                     virReportError(VIR_ERR_INVALID_ARG, "%s",
                                    _("out of blkio weight range."));
                     ret = -1;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 626d557..eae8ae2 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
 <at>  <at>  -7819,7 +7819,7  <at>  <at>  qemuDomainSetBlkioParameters(virDomainPtr dom,
             virTypedParameterPtr param = &params[i];

             if (STREQ(param->field, VIR_DOMAIN_BLKIO_WEIGHT)) {
-                if (params[i].value.ui > 1000 || params[i].value.ui < 100) {
+                if (params[i].value.ui > 1000 || params[i].value.ui < 10) {
                     virReportError(VIR_ERR_INVALID_ARG, "%s",
                                    _("out of blkio weight range."));
                     ret = -1;
 <at>  <at>  -7920,7 +7920,7  <at>  <at>  qemuDomainSetBlkioParameters(virDomainPtr dom,
             virTypedParameterPtr param = &params[i];

             if (STREQ(param->field, VIR_DOMAIN_BLKIO_WEIGHT)) {
-                if (params[i].value.ui > 1000 || params[i].value.ui < 100) {
+                if (params[i].value.ui > 1000 || params[i].value.ui < 10) {
                     virReportError(VIR_ERR_INVALID_ARG, "%s",
                                    _("out of blkio weight range."));
                     ret = -1;
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index ba47258..c58beaf 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
 <at>  <at>  -1255,7 +1255,7  <at>  <at>  static const vshCmdOptDef opts_blkiotune[] = {
     },
     {.name = "weight",
      .type = VSH_OT_INT,
-     .help = N_("IO Weight in range [100, 1000]")
+     .help = N_("IO Weight in range [10, 1000]")
     },
     {.name = "device-weights",
      .type = VSH_OT_STRING,
diff --git a/tools/virsh.pod b/tools/virsh.pod
index 849ae31..9f3cbee 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
 <at>  <at>  -1824,8 +1824,8  <at>  <at>  Specifying -1 as a value for these limits is interpreted as unlimited.
 [[I<--config>] [I<--live>] | [I<--current>]]

 Display or set the blkio parameters. QEMU/KVM supports I<--weight>.
-I<--weight> is in range [100, 1000]. After kernel 2.6.39, the value
-could be in the range [10, 1000].
+I<--weight> is in range [100, 1000].  Since kernel 2.6.39, the value
+is in the range [10, 1000].

 B<device-weights> is a single string listing one or more device/weight
 pairs, in the format of /path/to/device,weight,/path/to/device,weight.
--

-- 
2.0.2

Nicholas A. Bellinger | 24 Jul 05:24 2014

[libvirt] [PATCH 0/2] qemu: add vhost-scsi-pci support

From: Nicholas Bellinger <nab <at> linux-iscsi.org>

Hi Daniel & Co,

The following is the patch series to add support for vhost-scsi-pci
from QEMU >= v1.5.x into libvirt.  It includes proper support for
passing a pre-opened vhostfd into vhost-scsi, which is required in
order to properly support nova performing a device_add for adding
a individual vhost-scsi-pci WWPN endpoint -> SCSI controller.

The logic closely follows what vhost-net already does in order to
allow a child qemu process to interact with the vhost-scsi character
device for registering vhost memory, setting vhost-scsi endpoints,
etc.

This code has been tested using openstack nova volume-attach, using
a Juno v2 development head from 07192014.

Thank you,

--nab

Mike Perez (1):
  qemu: add vhost-scsi-pci definitions

Nicholas Bellinger (1):
  qemu: add support vhost-scsi-pci for device_add hotplug

 Makefile.am                                        |    2 +-
 docs/formatdomain.html.in                          |   20 ++--
 docs/schemas/domaincommon.rng                      |    5 +
 src/conf/domain_conf.c                             |   20 +++-
 src/conf/domain_conf.h                             |    2 +
 src/qemu/qemu_capabilities.c                       |    2 +
 src/qemu/qemu_capabilities.h                       |    1 +
 src/qemu/qemu_command.c                            |  115 ++++++++++++++++++--
 src/qemu/qemu_command.h                            |    8 +-
 src/qemu/qemu_hotplug.c                            |   47 +++++++-
 src/qemu/qemu_monitor.c                            |   24 ++++
 src/qemu/qemu_monitor.h                            |    4 +
 src/vmx/vmx.c                                      |    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 +
 .../qemuxml2argv-disk-vhost-scsi-cmd_per_lun.args  |    9 ++
 .../qemuxml2argv-disk-vhost-scsi-cmd_per_lun.xml   |   29 +++++
 .../qemuxml2argv-disk-vhost-scsi-max_sectors.args  |    9 ++
 .../qemuxml2argv-disk-vhost-scsi-max_sectors.xml   |   29 +++++
 .../qemuxml2argv-disk-vhost-scsi-num_queues.args   |    9 ++
 .../qemuxml2argv-disk-vhost-scsi-num_queues.xml    |   29 +++++
 .../qemuxml2argv-disk-vhost-scsi-wwpn.args         |    9 ++
 .../qemuxml2argv-disk-vhost-scsi-wwpn.xml          |   29 +++++
 tests/qemuxml2argvtest.c                           |   12 ++
 tests/qemuxml2xmltest.c                            |    4 +
 26 files changed, 399 insertions(+), 23 deletions(-)
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-vhost-scsi-cmd_per_lun.args
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-vhost-scsi-cmd_per_lun.xml
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-vhost-scsi-max_sectors.args
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-vhost-scsi-max_sectors.xml
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-vhost-scsi-num_queues.args
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-vhost-scsi-num_queues.xml
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-vhost-scsi-wwpn.args
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-vhost-scsi-wwpn.xml

--

-- 
1.7.9.5

Eric Blake | 24 Jul 05:06 2014
Picon

[libvirt] [PATCH v2 0/3] fix pciexpress memory leak

diff in v2: split out trivial fixes, refactor pcie code to
virpci.h, add proper free function to cover all leaks

Eric Blake (3):
  nodedev: let compiler help us on switches
  nodedev: move pci express types to virpci.h
  nodedev: fix pci express memory leak

 src/conf/node_device_conf.c        | 13 ++++++-------
 src/conf/node_device_conf.h        | 29 +----------------------------
 src/libvirt_private.syms           |  1 +
 src/node_device/node_device_udev.c |  2 +-
 src/util/virpci.c                  | 15 +++++++++++++++
 src/util/virpci.h                  | 33 ++++++++++++++++++++++++++++++++-
 6 files changed, 56 insertions(+), 37 deletions(-)

--

-- 
1.9.3

Wang Rui | 24 Jul 04:17 2014

[libvirt] [PATCH] util: virTimeFieldsThenRaw never return negative

From: James <james.wangyufei <at> huawei.com>

virTimeFieldsThenRaw will never return negative result, so I delete related
judgement.

Signed-off-by: James <james.wangyufei <at> huawei.com>
---
 src/util/virtime.c | 7 ++-----
 src/util/virtime.h | 4 ++--
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/util/virtime.c b/src/util/virtime.c
index 2a91ea5..662c161 100644
--- a/src/util/virtime.c
+++ b/src/util/virtime.c
 <at>  <at>  -121,9 +121,8  <at>  <at>  const unsigned short int __mon_yday[2][13] = {
  * Converts the timestamp  <at> when into broken-down field format.
  * Time time is always in UTC
  *
- * Returns 0 on success, -1 on error with errno set
  */
-int virTimeFieldsThenRaw(unsigned long long when, struct tm *fields)
+void virTimeFieldsThenRaw(unsigned long long when, struct tm *fields)
 {
     /* This code is taken from GLibC under terms of LGPLv2+ */
     long int days, rem, y;
 <at>  <at>  -171,7 +170,6  <at>  <at>  int virTimeFieldsThenRaw(unsigned long long when, struct tm *fields)
     days -= ip[y];
     fields->tm_mon = y;
     fields->tm_mday = days + 1;
-    return 0;
 }

 
 <at>  <at>  -209,8 +207,7  <at>  <at>  int virTimeStringThenRaw(unsigned long long when, char *buf)
 {
     struct tm fields;

-    if (virTimeFieldsThenRaw(when, &fields) < 0)
-        return -1;
+    virTimeFieldsThenRaw(when, &fields);

     fields.tm_year += 1900;
     fields.tm_mon += 1;
diff --git a/src/util/virtime.h b/src/util/virtime.h
index 25332db..61f36dc 100644
--- a/src/util/virtime.h
+++ b/src/util/virtime.h
 <at>  <at>  -43,12 +43,12  <at>  <at>  int virTimeMillisNowRaw(unsigned long long *now)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
 int virTimeFieldsNowRaw(struct tm *fields)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
-int virTimeFieldsThenRaw(unsigned long long when, struct tm *fields)
-    ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
 int virTimeStringNowRaw(char *buf)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
 int virTimeStringThenRaw(unsigned long long when, char *buf)
     ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+void virTimeFieldsThenRaw(unsigned long long when, struct tm *fields)
+     ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;

 /* These APIs are *not* async signal safe and return -1,
  * raising a libvirt error on failure
--

-- 
1.7.12.4

Nehal J Wani | 24 Jul 00:05 2014
Picon

[libvirt] [PATCH] leaseshelper: avoid mem leak after storing lease entries

Contents of existing lease file were being stored in a variable
which was never freed.

---
 src/network/leaseshelper.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/network/leaseshelper.c b/src/network/leaseshelper.c
index e4b5283..c8543a2 100644
--- a/src/network/leaseshelper.c
+++ b/src/network/leaseshelper.c
 <at>  <at>  -361,6 +361,7  <at>  <at>  main(int argc, char **argv)

     VIR_FREE(pid_file);
     VIR_FREE(exptime);
+    VIR_FREE(lease_entries);
     VIR_FREE(custom_lease_file);
     virJSONValueFree(lease_new);
     virJSONValueFree(leases_array);
--

-- 
1.9.3

Yuanzhen Gu | 23 Jul 23:23 2014
Picon

[libvirt] libvirt log format

Hello folks,

Does any one know how to read the libvirt log information?

For example,

2014-07-22 17:25:22.984+0000: 18571: debug : qemuMonitorIOProcess:356 : QEMU_MONITOR_IO_PROCESS: mon=0x7f733c000a40 buf={"timestamp": {"seconds": 1406049922, "microseconds": 983916}, "event": "STOP"}

is there anyway to find the qemuMonitorIOProcess() function in the source code?  and what does "356" after that means?   Thanks!

Best,
Yuanzhen
<div><div dir="ltr">
<div>
<div>
<div>Hello folks,<br><br>
</div>Does any one know how to read the libvirt log information?<br><br>
</div>For example,<br><br>2014-07-22 17:25:22.984+0000: 18571: debug : qemuMonitorIOProcess:356 : QEMU_MONITOR_IO_PROCESS: mon=0x7f733c000a40 buf={"timestamp": {"seconds": 1406049922, "microseconds": 983916}, "event": "STOP"}<br><br>
</div>is there anyway to find the qemuMonitorIOProcess() function in the source code?&nbsp; and what does "356" after that means?&nbsp;&nbsp; Thanks!<br><div><div>
<br clear="all"><div><div><div><div><div><div><div>
<div><div dir="ltr">

Best,<div>Yuanzhen</div>
</div></div>
</div></div></div></div></div></div></div>
</div></div>
</div></div>

Gmane