Chen Fan | 29 Aug 13:20 2014

[libvirt] [PATCH] conf: Check migration_host is valid or not during libvirt restarts

if user specified an invalid strings as migration hostname,
like setting: migration_host = "XXXXXXX", libvirt should check
it and return error during lbivirt restart.

Signed-off-by: Chen Fan <chen.fan.fnst <at> cn.fujitsu.com>
---
 src/qemu/qemu_conf.c | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index e2ec54f..450ac5b 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
 <at>  <at>  -33,6 +33,7  <at>  <at> 
 #include <fcntl.h>
 #include <sys/wait.h>
 #include <arpa/inet.h>
+#include <netdb.h>

 #include "virerror.h"
 #include "qemu_conf.h"
 <at>  <at>  -650,6 +651,45  <at>  <at>  int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
     GET_VALUE_LONG("seccomp_sandbox", cfg->seccompSandbox);

     GET_VALUE_STR("migration_host", cfg->migrateHost);
+    if (cfg->migrateHost) {
+        struct addrinfo hints;
+        struct addrinfo *res;
+
+        memset(&hints, 0, sizeof(hints));
(Continue reading)

Christophe Fergeau | 29 Aug 10:37 2014
Picon

[libvirt] [PATCH] Fix connection to already running session libvirtd

Since 1b807f92, connecting with virsh to an already running session
libvirtd fails with:
$ virsh list --all
error: failed to connect to the hypervisor
error: no valid connection
error: Failed to connect socket to
'/run/user/1000/libvirt/libvirt-sock': Transport endpoint is already
connected

This is caused by a logic error in virNetSocketNewConnectUnix: even if
the connection to the daemon socket succeeded, we still try to spawn the
daemon and then connect to it.
This commit changes the logic to not try to spawn libvirtd if we
successfully connected to its socket.

With whitespace changes removed, this patch becomes just this:

diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
index f913365..79540b3 100644
--- a/src/rpc/virnetsocket.c
+++ b/src/rpc/virnetsocket.c
 <at>  <at>  -574,7 +574,8  <at>  <at>  int virNetSocketNewConnectUNIX(const char *path,
         remoteAddr.data.un.sun_path[0] = '\0';

  retry:
-    if (connect(fd, &remoteAddr.data.sa, remoteAddr.len) < 0 &&
     !spawnDaemon) {
+    if (connect(fd, &remoteAddr.data.sa, remoteAddr.len) < 0) {
+        if (!spawnDaemon) {
             virReportSystemError(errno, _("Failed to connect socket to
(Continue reading)

Li Wei | 29 Aug 09:56 2014

[libvirt] [PATCH 0/2] bulk api: implement block group

This patchset implement the block group for bulk stats, currently only
support JSON monitor.

Li Wei (2):
  qemu: implement block group for bulk stats.
  virsh: add block group for bulk stats.

 include/libvirt/libvirt.h.in |   1 +
 src/libvirt.c                |  13 ++++
 src/qemu/qemu_driver.c       |  31 ++++++++
 src/qemu/qemu_monitor.c      |  23 ++++++
 src/qemu/qemu_monitor.h      |   5 ++
 src/qemu/qemu_monitor_json.c | 170 +++++++++++++++++++++++++++++++++++++++++++
 src/qemu/qemu_monitor_json.h |   5 ++
 tools/virsh-domain-monitor.c |   7 ++
 tools/virsh.pod              |   4 +-
 9 files changed, 257 insertions(+), 2 deletions(-)

--

-- 
1.9.3

Francesco Romani | 29 Aug 09:15 2014
Picon

[libvirt] [PATCH 00/11] bulk stats: QEMU implementation

This patchset enhances the QEMU support for the new bulk stats API.
What is added is the equivalent of these APIs:

virDomainBlockInfo
virDomainGetInfo - for balloon stats
virDomainGetCPUStats
virDomainBlockStatsFlags
virDomainInterfaceStats
virDomainGetVcpusFlags
virDomainGetVcpus

This subset of API is the one oVirt relies on.

The patchset is organized as follows:
- the first 4 patches do refactoring to extract internal helper
  functions to be used by the old API and by the new bulk one.
  For block stats on helper is actually added instead of extracted.
- since some groups require access to the QEMU monitor, one patch
  extend the internal interface to easily accomodate that
- finally, the last six patches implement the support for the
  bulk API.

Francesco Romani (11):
  qemu: extract helper to get the current balloon
  qemu: extract helper to gather vcpu data
  qemu: add helper to get the block stats
  qemu: extract helper to get block info
  qemu: bulk stats: pass connection to workers
  qemu: bulk stats: implement CPU stats group
  qemu: bulk stats: implement balloon group
(Continue reading)

John Ferlan | 28 Aug 21:28 2014
Picon

[libvirt] [PATCH 0/2] Couple more Coverity issues

After perusing the pile of 70 or so warnings - these two stuck out as
ones that were low hanging fruit and not false positives.

Many of the remaining "issues" are false positives or perhaps even
bugs in Coverity, but I understand why they're being flagged. Freeing
memory from counted lists where the incoming count must be zero based
on code path - for some reason Coverity flags them because the incoming
list memory is NULL and the for loop deref would be bad. The issue
is Coverity doesn't seem to dig deep enough to determine that the
count and list pointer are linked, sigh (yes, a lot of those).

John Ferlan (2):
  virnetserverservice: Resolve Coverity ARRAY_VS_SINGLETON
  qemu_driver: Resolve Coverity FORWARD_NULL

 src/qemu/qemu_driver.c        | 3 +--
 src/rpc/virnetserverservice.c | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

--

-- 
1.9.3

Pavel Hrdina | 28 Aug 20:38 2014
Picon

[libvirt] [PATCH 0/4] Introduce new cputune event

This patch series introduces new cputune event to inform
management applications about every change of cputune values
for running domains.

Pavel Hrdina (4):
  domain_conf: separate cputune struct from virDomainDef
  event: introduce new event for cputune
  add an example how to use cputune event
  cputune_event: queue the event for cputune updates

 daemon/remote.c                     |  87 ++++++++++++++++++++++++++
 examples/object-events/event-test.c |  39 +++++++++++-
 include/libvirt/libvirt.h.in        |  62 +++++++++++++++++++
 src/conf/domain_conf.h              |  27 ++++----
 src/conf/domain_event.c             | 120 ++++++++++++++++++++++++++++++++++++
 src/conf/domain_event.h             |   7 +++
 src/libvirt_private.syms            |   2 +
 src/qemu/qemu_cgroup.c              |   6 ++
 src/qemu/qemu_driver.c              |  27 ++++++++
 src/remote/remote_driver.c          | 110 +++++++++++++++++++++++++++++++++
 src/remote/remote_protocol.x        |  39 +++++++++++-
 src/remote_protocol-structs         |  32 ++++++++++
 tools/virsh-domain.c                |  49 +++++++++++++++
 13 files changed, 594 insertions(+), 13 deletions(-)

--

-- 
1.8.5.5

Peter Krempa | 28 Aug 18:32 2014
Picon

[libvirt] [python PATCH 0/5] Implement bindings for bulk stats API

The last patch is to ease review to be able to build the series.

Peter Krempa (5):
  generator: enum: Don't sort enums by names
  API: Skip 'virDomainStatsRecordListFree'
  API: Implement bindings for virConnectGetAllDomainStats
  API: Implement bindings for virDomainListGetStats
  DO NOT APPLY: Fix build with missing virDomainBlockCopy API

 generator.py                   |   6 +-
 libvirt-override-virConnect.py | 100 ++++++++++++++++++++++++++++
 libvirt-override.c             | 144 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 248 insertions(+), 2 deletions(-)

--

-- 
2.0.2

Vasiliy Tolstov | 28 Aug 15:12 2014
Picon

[libvirt] run qemu-agent-command via binding (ruby/python/php)

Hi! Does it possible(featured, planned) to run some qemu-agent-command
via libvirt binding (i'm interesting on ruby and php).?
I'm understand that i can connect via socket and run it, but it very
usable to get this ability inside binding.

--

-- 
Vasiliy Tolstov,
e-mail: v.tolstov <at> selfip.ru
jabber: vase <at> selfip.ru

Adrien Kantcheff | 28 Aug 14:38 2014
Picon
Picon

[libvirt] Proposition for the implementation of new features for Hyper-V driver

Dear libvirt developers,

 

During my final student training in the French company Bull, with a previous student (Simon RASTELLO), we developed new features for Hyper-V driver.  For a project called OpenCloudware, our work was to bring new functionalities using libvirt API in order to do basic actions on virtual machines hosted on Hyper-V.

 

You may be interested in pushing our developments in the official release.

 

The libvirt driver already provides functions to enumerate and get WMI classes by sending WQL requests to WMI provider and also to call WMI class methods. For that last kind of communication, a method requires input parameters. There are two kinds of argument: basic (integer, string…) and complex (objects, end point references, embedded instances). Actually, just the first argument passing mode is available with libvirt driver. But the second one is very useful because there is many WMI methods with complex types parameters, and for the moment it constraints developers to call WMI methods only with basic types parameters. So in order to expand WMI methods calls, we have implemented the second argument passing mode.

 

Thanks to this new argument passing mode, we are available  to set new functionalities.

 

Our contributions include:

 

·         hyperv_driver.c

o   hypervDomainDefineXML

o   hypervDomainCreateXML

o   hypervDomainUndefine

o   hypervDomainUndefineFlags

o   hypervDomainShutdown

o   hypervDomainShutdownFlags

o   hypervDomainGetVcpus

o   hypervDomainGetVcpusFlags 

o   hypervConnectGetMaxVcpus 

o   hypervDomainGetMaxVcpus  

o   hypervDomainSetVcpus            

o   hypervDomainSetVcpusFlags  

o   hypervDomainSetMemory       

o   hypervDomainSetMemoryFlags            

o   hypervDomainSetMaxMemory             

o   hypervNodeGetFreeMemory 

o   hypervDomainAttachDevice    

o   hypervDomainAttachDeviceFlags          

o   hypervDomainGetSchedulerParameters           

o   hypervDomainGetSchedulerParametersFlags 

o   hypervDomainGetSchedulerType         

o   hypervConnectGetCapabilities               

o   hypervConnectGetVersion      

o   hypervDomainSetAutostart     

o   hypervDomainGetAutostart    

 

·         hyperv_network.c

o   hypervConnectNumOfNetworks          

o   hypervConnectListNetworks   

o   hypervConnectNumOfDefinedNetworks          

o   hypervConnectListDefinedNetworks  

o   hypervNetworkLookupByName            

o   hypervNetworkGetXMLDesc  

 

·         hyperv_storage_driver.c

o   hypervConnectNumOfStoragePools (stub)

o   hypervConnectListStoragePools (stub)

o   hypervConnectNumOfDefinedStoragePools (stub)

o   hypervStoragePoolLookupByName (stub)

o   hypervStorageVolLookupByPath (stub)

 

·         hyperv_private.h

o   Add mutex to protect against concurrent calls

o   Add virDomainXMLOptionPtr to parse Domain XML

 

·         hyperv_wmi.h

o   Structures for complex arguments: objects, EPR (end point references) and embedded instances

 

·         hyperv_wmi.c

o   Methods to invoke WMI methods with complex arguments

 

·         hyperv_wmi_generator.input

o   CIM_DataFile

o   Win32_ComputerSystemProduct

o   Msvm_VirtualSystemManagementService

o   Msvm_VirtualSystemGlobalSettingData

o   Msvm_ResourceAllocationSettingData

o   Msvm_AllocationCapabilities

o   Msvm_VirtualSwitch

o   Msvm_SwitchPort

o   Msvm_SyntheticEthernetPortSettingData

o   Msvm_VirtualSwitchManagementService

o   Win32_OperatingSystem

o   Win32_PerfFormattedData_HvStats_HyperVHypervisorVirtualProcessor

o   Win32_PerfRawData_HvStats_HyperVHypervisorVirtualProcessor

 

·         hyperv_wmi_generator.py

o   Add CIM_DataFile class header to be generated

o   Add tab classes and types to be generated

o   Add a function to print header types

 

·         openwsman.h

o   Add ws_xml_create_doc signature

o   Add xml_parser_get_root signature

 

Attach files contain sources and an pdf of our contributions.

 

I’m ending my training this week but I’m available to answer any questions you may have. You can use my personal email: adrien.kantcheff <at> gmail.com

 

I also put in copy of this email my tutors Yves VINTER and Christian BOURGEOIS. Feel free to contact them as well.

 

 

Best regards,

 

Adrien KANTCHEFF

Bull

 

 

Attachment (Hyper-V driver 1.2.6 sources - Bull.zip): application/x-zip-compressed, 50 KiB
<div>
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Dear libvirt developers,<p></p></span></p>
<p class="MsoNormal"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span lang="EN-US">During my final student training in the French company Bull, with a previous student (Simon RASTELLO), we developed new features for Hyper-V driver. &nbsp;For a project called OpenCloudware, our work was to bring new functionalities
 using libvirt API in order to do basic actions on virtual machines hosted on Hyper-V.<p></p></span></p>
<p class="MsoNormal"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span lang="EN-US">You may be interested in pushing our developments in the official release.<p></p></span></p>
<p class="MsoNormal"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span lang="EN-US">The libvirt driver already provides functions to enumerate and get WMI classes by sending WQL requests to WMI provider and also to call WMI class methods. For that last kind of communication, a method requires input parameters.
 There are two kinds of argument: basic (integer, string&hellip;) and complex (objects, end point references, embedded instances). Actually, just the first argument passing mode is available with libvirt driver. But the second one is very useful because there is many
 WMI methods with complex types parameters, and for the moment it constraints developers to call WMI methods only with basic types parameters. So in order to expand WMI methods calls, we have implemented the second argument passing mode.<p></p></span></p>
<p class="MsoNormal"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks to this new argument passing mode, we are available&nbsp; to set new functionalities.
<p></p></span></p>
<p class="MsoNormal"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span lang="EN-US">Our contributions include: <p></p></span></p>
<p class="MsoNormal"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoListParagraph"><span lang="EN-US"><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hyperv_driver.c<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervDomainDefineXML<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervDomainCreateXML<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervDomainUndefine<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervDomainUndefineFlags<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervDomainShutdown<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervDomainShutdownFlags<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervDomainGetVcpus<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervDomainGetVcpusFlags&nbsp; <p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervConnectGetMaxVcpus&nbsp; <p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervDomainGetMaxVcpus&nbsp;&nbsp; <p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervDomainSetVcpus&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervDomainSetVcpusFlags&nbsp;&nbsp; <p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervDomainSetMemory&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervDomainSetMemoryFlags&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervDomainSetMaxMemory&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervNodeGetFreeMemory&nbsp; <p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervDomainAttachDevice&nbsp;&nbsp;&nbsp;&nbsp; <p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervDomainAttachDeviceFlags&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervDomainGetSchedulerParameters&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervDomainGetSchedulerParametersFlags&nbsp;
<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervDomainGetSchedulerType&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervConnectGetCapabilities&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervConnectGetVersion&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervDomainSetAutostart&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervDomainGetAutostart&nbsp;&nbsp;&nbsp;&nbsp; <p></p></span></p>
<p class="MsoNormal"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoListParagraph"><span lang="EN-US"><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hyperv_network.c<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervConnectNumOfNetworks&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervConnectListNetworks&nbsp;&nbsp;&nbsp; <p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervConnectNumOfDefinedNetworks&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervConnectListDefinedNetworks&nbsp;&nbsp;
<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervNetworkLookupByName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervNetworkGetXMLDesc&nbsp;&nbsp; <p></p></span></p>
<p class="MsoNormal"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoListParagraph"><span lang="EN-US"><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hyperv_storage_driver.c <p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervConnectNumOfStoragePools (stub)<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervConnectListStoragePools (stub)<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervConnectNumOfDefinedStoragePools (stub)<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervStoragePoolLookupByName (stub)<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hypervStorageVolLookupByPath (stub)<p></p></span></p>
<p class="MsoNormal"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoListParagraph"><span lang="EN-US"><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hyperv_private.h<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">Add mutex to protect against concurrent calls<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">Add virDomainXMLOptionPtr to parse Domain XML
<p></p></span></p>
<p class="MsoNormal"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoListParagraph"><span lang="EN-US"><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hyperv_wmi.h<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">Structures for complex arguments: objects, EPR (end point references) and embedded instances<p></p></span></p>
<p class="MsoNormal"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoListParagraph"><span lang="EN-US"><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hyperv_wmi.c<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">Methods to invoke WMI methods with complex arguments<p></p></span></p>
<p class="MsoNormal"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoListParagraph"><span lang="EN-US"><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hyperv_wmi_generator.input<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">CIM_DataFile<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">Win32_ComputerSystemProduct<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">Msvm_VirtualSystemManagementService<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">Msvm_VirtualSystemGlobalSettingData<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">Msvm_ResourceAllocationSettingData<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">Msvm_AllocationCapabilities<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">Msvm_VirtualSwitch<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">Msvm_SwitchPort<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">Msvm_SyntheticEthernetPortSettingData<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">Msvm_VirtualSwitchManagementService<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">Win32_OperatingSystem<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">Win32_PerfFormattedData_HvStats_HyperVHypervisorVirtualProcessor<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">Win32_PerfRawData_HvStats_HyperVHypervisorVirtualProcessor<p></p></span></p>
<p class="MsoNormal"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoListParagraph"><span lang="EN-US"><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><span lang="EN-US">hyperv_wmi_generator.py<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">Add CIM_DataFile class header to be generated<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">Add tab classes and types to be generated<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">Add a function to print header types<p></p></span></p>
<p class="MsoNormal"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoListParagraph"><span lang="EN-US"><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><span lang="EN-US">openwsman.h<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">Add ws_xml_create_doc signature<p></p></span></p>
<p class="MsoListParagraph">
<span lang="EN-US"><span>o<span>&nbsp;&nbsp;
</span></span></span><span lang="EN-US">Add xml_parser_get_root signature<p></p></span></p>
<p class="MsoNormal"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span lang="EN-US">Attach files contain sources and an pdf of our contributions.<p></p></span></p>
<p class="MsoNormal"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span lang="EN-US">I&rsquo;m ending my training this week but I&rsquo;m available to answer any questions you may have. You can use my personal email:
<a href="mailto:adrien.kantcheff <at> gmail.com">adrien.kantcheff <at> gmail.com</a><p></p></span></p>
<p class="MsoNormal"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span lang="EN-US">I also put in copy of this email my tutors Yves VINTER and Christian BOURGEOIS. Feel free to contact them as well.<p></p></span></p>
<p class="MsoNormal"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span lang="EN-US">Best regards,<p></p></span></p>
<p class="MsoNormal"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span lang="EN-US">Adrien KANTCHEFF<p></p></span></p>
<p class="MsoNormal"><span lang="EN-US">Bull<p></p></span></p>
<p class="MsoNormal"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span lang="EN-US"><p>&nbsp;</p></span></p>
</div>
</div>
Christophe Fergeau | 28 Aug 14:20 2014
Picon

[libvirt] Cosmetic bug on libvirt.org

Hey,

I just noticed that clicking on "FAQ" in the left sidebar on libvirt.org
main page highlights the "Wiki" cell instead of highlighting "FAQ".
I have no idea how the website works, so I'm just reporting it here.

Cheers,

Christophe
Hey,

I just noticed that clicking on "FAQ" in the left sidebar on libvirt.org
main page highlights the "Wiki" cell instead of highlighting "FAQ".
I have no idea how the website works, so I'm just reporting it here.

Cheers,

Christophe
Peter Krempa | 28 Aug 14:18 2014
Picon

[libvirt] [PATCHv4] qemu: Implement bulk stats API and one of the stats groups to return

Implement the API function for virDomainListGetStats and
virConnectGetAllDomainStats in a modular way and implement the
VIR_DOMAIN_STATS_STATE group of statistics.

Although it may look like the function looks universal I'd rather not
expose it to other drivers as the coming stats groups are likely to do
qemu specific stuff to obtain the stats.
---

Notes:
    Version 4:
    - fixed handling and error checking of  <at> stats
    - domain filtering flags are now rejected when passing in a domain list

 src/qemu/qemu_driver.c | 198 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 198 insertions(+)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 73959da..45a080b 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
 <at>  <at>  -17190,6 +17190,203  <at>  <at>  qemuConnectGetDomainCapabilities(virConnectPtr conn,
 }

+static int
+qemuDomainGetStatsState(virDomainObjPtr dom,
+                        virDomainStatsRecordPtr record,
+                        int *maxparams,
+                        unsigned int privflags ATTRIBUTE_UNUSED)
+{
+    if (virTypedParamsAddInt(&record->params,
+                             &record->nparams,
+                             maxparams,
+                             "state.state",
+                             dom->state.state) < 0)
+        return -1;
+
+    if (virTypedParamsAddInt(&record->params,
+                             &record->nparams,
+                             maxparams,
+                             "state.reason",
+                             dom->state.reason) < 0)
+        return -1;
+
+    return 0;
+}
+
+
+typedef int
+(*qemuDomainGetStatsFunc)(virDomainObjPtr dom,
+                          virDomainStatsRecordPtr record,
+                          int *maxparams,
+                          unsigned int flags);
+
+struct qemuDomainGetStatsWorker {
+    qemuDomainGetStatsFunc func;
+    unsigned int stats;
+};
+
+static struct qemuDomainGetStatsWorker qemuDomainGetStatsWorkers[] = {
+    { qemuDomainGetStatsState, VIR_DOMAIN_STATS_STATE},
+    { NULL, 0 }
+};
+
+
+static int
+qemuDomainGetStatsCheckSupport(unsigned int *stats,
+                               bool enforce)
+{
+    unsigned int supportedstats = 0;
+    size_t i;
+
+    for (i = 0; qemuDomainGetStatsWorkers[i].func; i++)
+        supportedstats |= qemuDomainGetStatsWorkers[i].stats;
+
+    if (*stats == 0) {
+        *stats = supportedstats;
+        return 0;
+    }
+
+    if (enforce &&
+        *stats & ~supportedstats) {
+        virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED,
+                       _("Stats types bits 0x%x are not supported by this daemon"),
+                       *stats & ~supportedstats);
+        return -1;
+    }
+
+    *stats &= supportedstats;
+    return 0;
+}
+
+
+static int
+qemuDomainGetStats(virConnectPtr conn,
+                   virDomainObjPtr dom,
+                   unsigned int stats,
+                   virDomainStatsRecordPtr *record,
+                   unsigned int flags)
+{
+    int maxparams = 0;
+    virDomainStatsRecordPtr tmp;
+    size_t i;
+    int ret = -1;
+
+    if (VIR_ALLOC(tmp) < 0)
+        goto cleanup;
+
+    for (i = 0; qemuDomainGetStatsWorkers[i].func; i++) {
+        if (stats & qemuDomainGetStatsWorkers[i].stats) {
+            if (qemuDomainGetStatsWorkers[i].func(dom, tmp, &maxparams,
+                                                  flags) < 0)
+                goto cleanup;
+        }
+    }
+
+    if (!(tmp->dom = virGetDomain(conn, dom->def->name, dom->def->uuid)))
+        goto cleanup;
+
+    *record = tmp;
+    tmp = NULL;
+    ret = 0;
+
+ cleanup:
+    if (tmp) {
+        virTypedParamsFree(tmp->params, tmp->nparams);
+        VIR_FREE(tmp);
+    }
+
+    return ret;
+}
+
+
+
+static int
+qemuConnectGetAllDomainStats(virConnectPtr conn,
+                             virDomainPtr *doms,
+                             unsigned int ndoms,
+                             unsigned int stats,
+                             virDomainStatsRecordPtr **retStats,
+                             unsigned int flags)
+{
+    virQEMUDriverPtr driver = conn->privateData;
+    virDomainPtr *domlist = NULL;
+    virDomainObjPtr dom = NULL;
+    virDomainStatsRecordPtr *tmpstats = NULL;
+    bool enforce = !!(flags & VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS);
+    int ntempdoms;
+    int nstats = 0;
+    size_t i;
+    int ret = -1;
+
+    if (ndoms)
+        virCheckFlags(VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS, -1);
+    else
+        virCheckFlags(VIR_CONNECT_LIST_DOMAINS_FILTERS_ACTIVE |
+                      VIR_CONNECT_LIST_DOMAINS_FILTERS_PERSISTENT |
+                      VIR_CONNECT_LIST_DOMAINS_FILTERS_STATE |
+                      VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS, -1);
+
+    if (virConnectGetAllDomainStatsEnsureACL(conn) < 0)
+        return -1;
+
+    if (qemuDomainGetStatsCheckSupport(&stats, enforce) < 0)
+        return -1;
+
+    if (!ndoms) {
+        unsigned int lflags = flags & (VIR_CONNECT_LIST_DOMAINS_FILTERS_ACTIVE |
+                                       VIR_CONNECT_LIST_DOMAINS_FILTERS_PERSISTENT |
+                                       VIR_CONNECT_LIST_DOMAINS_FILTERS_STATE);
+
+        if ((ntempdoms = virDomainObjListExport(driver->domains,
+                                                conn,
+                                                &domlist,
+                                                virConnectGetAllDomainStatsCheckACL,
+                                                lflags)) < 0)
+            goto cleanup;
+
+        ndoms = ntempdoms;
+        doms = domlist;
+    }
+
+    if (VIR_ALLOC_N(tmpstats, ndoms + 1) < 0)
+        goto cleanup;
+
+    for (i = 0; i < ndoms; i++) {
+        virDomainStatsRecordPtr tmp = NULL;
+
+        if (!(dom = qemuDomObjFromDomain(doms[i])))
+            continue;
+
+        if (!domlist &&
+            !virConnectGetAllDomainStatsCheckACL(conn, dom->def))
+            continue;
+
+        if (qemuDomainGetStats(conn, dom, stats, &tmp, flags) < 0)
+            goto cleanup;
+
+        if (tmp)
+            tmpstats[nstats++] = tmp;
+
+        virObjectUnlock(dom);
+        dom = NULL;
+    }
+
+    *retStats = tmpstats;
+    tmpstats = NULL;
+
+    ret = nstats;
+
+ cleanup:
+    if (dom)
+        virObjectUnlock(dom);
+
+    virDomainStatsRecordListFree(tmpstats);
+    virDomainListFree(domlist);
+
+    return ret;
+}
+
+
 static virDriver qemuDriver = {
     .no = VIR_DRV_QEMU,
     .name = QEMU_DRIVER_NAME,
 <at>  <at>  -17387,6 +17584,7  <at>  <at>  static virDriver qemuDriver = {
     .domainSetTime = qemuDomainSetTime, /* 1.2.5 */
     .nodeGetFreePages = qemuNodeGetFreePages, /* 1.2.6 */
     .connectGetDomainCapabilities = qemuConnectGetDomainCapabilities, /* 1.2.7 */
+    .connectGetAllDomainStats = qemuConnectGetAllDomainStats, /* 1.2.8 */
 };

--

-- 
2.0.2


Gmane