[libvirt] [PATCH] Remove pointless check for !ret in virDomainNetDefCoalesceParseXML
by Martin Kletzander
It was left there after removing a macro it was part of in first
version or so. Now it will always be NULL.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
Pushed as trivial
src/conf/domain_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 4a777d67bfad..7d3cf178eaf6 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -6789,7 +6789,7 @@ virDomainNetDefCoalesceParseXML(xmlNodePtr node,
if (!str)
goto cleanup;
- if (!ret && VIR_ALLOC(ret) < 0)
+ if (VIR_ALLOC(ret) < 0)
goto cleanup;
if (virStrToLong_ullp(str, NULL, 10, &tmp) < 0) {
--
2.12.2
7 years, 7 months
[libvirt] [PATCH] Don't leak str in virDomainNetDefCoalesceParseXML
by Martin Kletzander
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
Pushed as trivial.
src/conf/domain_conf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index cbeebdc56880..4a777d67bfad 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -6811,6 +6811,7 @@ virDomainNetDefCoalesceParseXML(xmlNodePtr node,
ret->rx_max_coalesced_frames = tmp;
cleanup:
+ VIR_FREE(str);
ctxt->node = save;
return ret;
--
2.12.2
7 years, 7 months
[libvirt] [PATCH v2 0/3] Add support for coalesce settings on interfaces
by Martin Kletzander
In linux this is supported since 4.11-rc3, I tested it with
4.11.0-rc5-next-20170407. The particular patch can be found
here:
https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/commit...
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1414627
In this version the XML is different so that there are no underscores
(and it's actually more readable, IMHO).
Plus some minor adjustments needed after rebase.
Martin Kletzander (3):
util: Add virNetDevSetCoalesce function
conf, docs: Add support for coalesce setting(s)
Set coalesce settings for domain interfaces
configure.ac | 3 +-
docs/formatdomain.html.in | 24 ++++
docs/schemas/domaincommon.rng | 131 +++++++++++++++++++++
src/bhyve/bhyve_command.c | 2 +-
src/conf/domain_conf.c | 80 +++++++++++++
src/conf/domain_conf.h | 2 +
src/libvirt_private.syms | 1 +
src/network/bridge_driver.c | 2 +-
src/qemu/qemu_domain.c | 31 +++++
src/qemu/qemu_interface.c | 2 +-
src/uml/uml_conf.c | 2 +-
src/util/virnetdev.c | 83 +++++++++++++
src/util/virnetdev.h | 34 ++++++
src/util/virnetdevtap.c | 5 +
src/util/virnetdevtap.h | 2 +
tests/bhyvexml2argvmock.c | 1 +
.../qemuxml2argvdata/qemuxml2argv-net-coalesce.xml | 68 +++++++++++
.../qemuxml2xmlout-net-coalesce.xml | 71 +++++++++++
tests/qemuxml2xmltest.c | 1 +
19 files changed, 540 insertions(+), 5 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-coalesce.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml
--
2.12.2
7 years, 7 months
[libvirt] [PATCH v2 0/5] Hyper-V method invocation
by Sri Ramanujam
Changes from v1:
* Removed unneeded util function
Sri Ramanujam (5):
hyperv: Functions to work with invocation parameters.
hyperv: Generate object property type information.
hyperv: add hypervInvokeMethod
hyperv: support virDomainSendKey
hyperv: Add support for virDomainSetMemory
src/hyperv/hyperv_driver.c | 182 +++++++
src/hyperv/hyperv_wmi.c | 879 ++++++++++++++++++++++++++++++++++
src/hyperv/hyperv_wmi.h | 93 +++-
src/hyperv/hyperv_wmi_classes.h | 19 +
src/hyperv/hyperv_wmi_generator.input | 116 +++++
src/hyperv/hyperv_wmi_generator.py | 15 +-
src/hyperv/openwsman.h | 4 +
7 files changed, 1306 insertions(+), 2 deletions(-)
--
2.9.3
7 years, 7 months
Re: [libvirt] creating stream
by Michal Privoznik
On 04/20/2017 03:55 PM, Vasiliy Tolstov wrote:
> 2017-04-06 14:59 GMT+03:00 Michal Privoznik <mprivozn(a)redhat.com>:
>> That is not going to be enough. The RPC protocol is spread among other files
>> too. You really should not hook into our RPC protocol. My question is still
>> unanswered though - why do you need it anyway?
>
> Thanks for all your help, i'm create mostly complete libvirt binding
> using generator. Last problem - do you know binary representation ofr
> virTypedParams? Does it xdr encoded when passed via wire or not? And
> format of this field?
You can see for yourself - just fire up wireshark with libvirt dissector
installed and issue the API.
Also, you may look at remote_typed_param_value and remote_typed_param
structs defined in src/remote/remote_protocol.h.
Michal
7 years, 7 months
[libvirt] [PATCH v3 0/3] libxl: nestedhvm support
by Wim Ten Have
From: Wim ten Have <wim.ten.have(a)oracle.com>
This patch enhances host-passthrough capability to advertise the
required vendor CPU virtualization feature which will be used to
enable 'nestedhvm' in the libxl driver.
Wim ten Have (3):
libxl: set nestedhvm for mode host-passthrough
xenconfig: add conversions for xen-xl
xlconfigtest: add tests for 'nestedhvm' support
cfg.mk | 2 +-
src/libxl/libxl_conf.c | 46 ++++++++++++++--
src/libxl/libxl_conf.h | 2 +-
src/libxl/libxl_domain.c | 2 +-
src/xenconfig/xen_xl.c | 64 ++++++++++++++++++++++
.../test-fullvirt-nestedhvm-disabled.cfg | 26 +++++++++
.../test-fullvirt-nestedhvm-disabled.xml | 61 +++++++++++++++++++++
tests/xlconfigdata/test-fullvirt-nestedhvm.cfg | 26 +++++++++
tests/xlconfigdata/test-fullvirt-nestedhvm.xml | 59 ++++++++++++++++++++
tests/xlconfigtest.c | 2 +
10 files changed, 282 insertions(+), 8 deletions(-)
create mode 100644 tests/xlconfigdata/test-fullvirt-nestedhvm-disabled.cfg
create mode 100644 tests/xlconfigdata/test-fullvirt-nestedhvm-disabled.xml
create mode 100644 tests/xlconfigdata/test-fullvirt-nestedhvm.cfg
create mode 100644 tests/xlconfigdata/test-fullvirt-nestedhvm.xml
--
2.9.3
7 years, 7 months
[libvirt] [PATCH] docs: fix typo in closing HTML element
by Daniel P. Berrange
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
Pushed as a build fix
docs/formatdomain.html.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 5469fc3..9bea3bc 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -5425,7 +5425,7 @@ qemu-kvm -net nic,model=? /dev/null
This element provides means of setting coalesce settings for
some interface devices (currently only type <code>network</code>
and <code>bridge</code>. Currently there is just one attribute,
- <code>max</code>, to tweak, in element <code>frames<code> for
+ <code>max</code>, to tweak, in element <code>frames</code> for
the <code>rx</code> group, which accepts a non-negative integer
that specifies the maximum number of packets that will be
received before an interrupt.
--
2.9.3
7 years, 7 months
[libvirt] [PATCH] util: check ifa_addr pointer before accessing its elements
by Pavel Hrdina
Reported by Rafał Wojciechowski <it(a)rafalwojciechowski.pl>.
Thread 1 (Thread 0x7f194b99d700 (LWP 5631)):
0 virNetDevGetifaddrsAddress (addr=0x7f194b99c7c0, ifname=0x7f193400e2b0 "ovirtmgmt") at util/virnetdevip.c:738
1 virNetDevIPAddrGet (ifname=0x7f193400e2b0 "ovirtmgmt", addr=addr@entry=0x7f194b99c7c0) at util/virnetdevip.c:795
2 0x00007f19467800d6 in networkGetNetworkAddress (netname=<optimized out>, netaddr=netaddr@entry=0x7f1924013f18) at network/bridge_driver.c:4780
3 0x00007f193e43a33c in qemuProcessGraphicsSetupNetworkAddress (listenAddr=0x7f19340f7650 "127.0.0.1", glisten=0x7f1924013f10) at qemu/qemu_process.c:4062
4 qemuProcessGraphicsSetupListen (vm=<optimized out>, graphics=0x7f1924014f10, cfg=0x7f1934119f00) at qemu/qemu_process.c:4133
5 qemuProcessSetupGraphics (flags=17, vm=0x7f19240155d0, driver=0x7f193411f1d0) at qemu/qemu_process.c:4196
6 qemuProcessPrepareDomain (conn=conn@entry=0x7f192c00ab50, driver=driver@entry=0x7f193411f1d0, vm=vm@entry=0x7f19240155d0, flags=flags@entry=17) at qemu/qemu_process.c:4969
7 0x00007f193e4417c0 in qemuProcessStart (conn=conn@entry=0x7f192c00ab50, driver=driver@entry=0x7f193411f1d0, vm=0x7f19240155d0,asyncJob=asyncJob@entry=QEMU_ASYNC_JOB_START, migrateFrom=migrateFrom@entry=0x0, migrateFd=migrateFd@entry=-1, migratePath=migratePath@entry=0x0,snapshot=snapshot@entry=0x0, vmop=vmop@entry=VIR_NETDEV_VPORT_PROFILE_OP_CREATE, flags=17, flags@entry=1) at qemu/qemu_process.c:5553
Man page for getifaddrs also states that the "ifa_addr" may contain
a null pointer which happens if there is an existing network interface
on the host without IP address.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/util/virnetdevip.c | 7 ++++++-
src/util/virnetdevtap.c | 3 +++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/util/virnetdevip.c b/src/util/virnetdevip.c
index 726fa6c3e3..09925e1d74 100644
--- a/src/util/virnetdevip.c
+++ b/src/util/virnetdevip.c
@@ -902,10 +902,15 @@ virNetDevGetifaddrsAddress(const char *ifname,
}
for (ifa = ifap; ifa; ifa = ifa->ifa_next) {
- int family = ifa->ifa_addr->sa_family;
+ int family;
if (STRNEQ_NULLABLE(ifa->ifa_name, ifname))
continue;
+
+ if (!ifa->ifa_addr)
+ continue;
+ family = ifa->ifa_addr->sa_family;
+
if (family != AF_INET6 && family != AF_INET)
continue;
diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c
index 02ef7fd240..93002b9294 100644
--- a/src/util/virnetdevtap.c
+++ b/src/util/virnetdevtap.c
@@ -762,6 +762,9 @@ virNetDevTapInterfaceStats(const char *ifname,
}
for (ifa = ifap; ifa; ifa = ifa->ifa_next) {
+ if (!ifa->ifa_addr)
+ continue;
+
if (ifa->ifa_addr->sa_family != AF_LINK)
continue;
--
2.12.2
7 years, 7 months
[libvirt] [PATCH] Use port range 5901-5999 if not set in qemu.conf, avoid port 5900
by Christophe de Dinechin
In order to avoid conflict with the default port (5900) for host VNC server
(vino-server for example), or to conflict with X11 (starting at port 6000),
restrict range of ports to 5901-5999 unless explicitly specified in qemu.conf.
On the other hand, if port range is explicitly specified in qemu.conf,
there is no reason not to allow ports 1024-5900 (system ports are below 1024).
Addresses https://bugzilla.redhat.com/show_bug.cgi?id=1442235
Signed-off-by: Christophe de Dinechin <dinechin(a)redhat.com>
---
src/qemu/qemu_conf.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 1b704da..07f3177 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -65,9 +65,15 @@ VIR_LOG_INIT("qemu.qemu_conf");
* This limitation is mentioned in qemu.conf, so bear in mind that the
* configuration file should reflect any changes made to these values.
*/
-#define QEMU_REMOTE_PORT_MIN 5900
+
+// Range of available ports - Avoid ports below 1024 (system ports)
+#define QEMU_REMOTE_PORT_MIN 1024
#define QEMU_REMOTE_PORT_MAX 65535
+// Default min and max if not configured in qemu.conf
+#define QEMU_REMOTE_PORT_MIN_DEFAULT 5901
+#define QEMU_REMOTE_PORT_MAX_DEFAULT 5999
+
#define QEMU_WEBSOCKET_PORT_MIN 5700
#define QEMU_WEBSOCKET_PORT_MAX 65535
@@ -283,8 +289,8 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged)
#undef SET_TLS_X509_CERT_DEFAULT
- cfg->remotePortMin = QEMU_REMOTE_PORT_MIN;
- cfg->remotePortMax = QEMU_REMOTE_PORT_MAX;
+ cfg->remotePortMin = QEMU_REMOTE_PORT_MIN_DEFAULT;
+ cfg->remotePortMax = QEMU_REMOTE_PORT_MAX_DEFAULT;
cfg->webSocketPortMin = QEMU_WEBSOCKET_PORT_MIN;
cfg->webSocketPortMax = QEMU_WEBSOCKET_PORT_MAX;
--
2.9.3
7 years, 7 months
[libvirt] How to get VM memory usage
by wangyufeng@cloudguarding.com
Hello everyone,
Could you tell me how to get VM memory usage from libvirt-go?
Thanks
wangyufeng(a)cloudguarding.com
7 years, 7 months