[libvirt] [PATCH] virnet*: Don't unlock object in dispose
by Michal Privoznik
As of bba93d40 all of our RPC objects are derived from
virObjectLockable. However, during rewrite some errors sneaked
in. For instance, the dispose functions to virNetClient and
virNetServerClient objects were not only freeing allocated
memory, but unlocking themselves. This is wrong. Object should
never disappear while locked.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/rpc/virnetclient.c | 2 --
src/rpc/virnetserverclient.c | 1 -
2 files changed, 3 deletions(-)
diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c
index d7455b5..7fca055 100644
--- a/src/rpc/virnetclient.c
+++ b/src/rpc/virnetclient.c
@@ -622,8 +622,6 @@ void virNetClientDispose(void *obj)
#endif
virNetMessageClear(&client->msg);
-
- virObjectUnlock(client);
}
diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c
index b2a4fdf..f5259c2 100644
--- a/src/rpc/virnetserverclient.c
+++ b/src/rpc/virnetserverclient.c
@@ -866,7 +866,6 @@ void virNetServerClientDispose(void *obj)
virObjectUnref(client->tlsCtxt);
#endif
virObjectUnref(client->sock);
- virObjectUnlock(client);
}
--
2.0.5
9 years, 8 months
[libvirt] [PATCH v3 00/10] Network enhancements and other fixes
by Maxim Nestratov
Maxim Nestratov (9):
parallels: don't forget to unlock domain if unregister fails
parallels: fix home directory for VMs
parallels: minor cleanup
parallels: introduce and use string constants for network types and
names
parallels: fix parallelsLoadNetworks
parallels: better bridge network interface support
parallels: set network adapter device status to connected
parallels: make E1000 network adapter type default
parallels: switch off offline management feature
Mikhail Feoktistov (1):
parallels: set cpu mode when applying xml configuration
9 years, 8 months
[libvirt] [PATCH 0/7] parallels: bridge network support enhancement and other network fixes
by Maxim Nestratov
Maxim Nestratov (7):
parallels: introduce and use string constants for network types and
names
parallels: fix parallelsLoadNetworks
parallels: better bridge network interface support
parallels: set network adapter device status to connected
parallels: make E1000 network adapter type default
parallels: switch off offline management feature
parallels: don't prevent domain start if VIR_DOMAIN_NET_TYPE_BRIDGE
9 years, 8 months
[libvirt] [PATCH 0/4] parallels: fixes and cleanups
by Maxim Nestratov
Maxim Nestratov (3):
parallels: don't forget to unlock domain if unregister fails
parallels: fix home directory for VMs
parallels: minor cleanup
Mikhail Feoktistov (1):
parallels: set cpu mode when applying xml configuration
9 years, 8 months
[libvirt] OVMF whitepaper released
by Laszlo Ersek
http://people.redhat.com/~lersek/ovmf-whitepaper-c770f8c.txt
(An official Red Hat whitepaper PDF edition, for graphical displays, is
in the works. As time and technical hurdles allow, both the plain text
and the PDF editions shall appear under
<http://www.linux-kvm.org/page/OVMF> too, replacing the stale article
currently visible there.)
Feedback is welcome.
For public feedback, please trim the address list to
<edk2-devel(a)lists.sourceforge.net> and yours truly; my intent is to spam
qemu-devel, linux-efi and libvir-list just this once. (Appropriate
levels of embarrassment are already being felt for spamming those.)
Thanks
Laszlo
9 years, 8 months
[libvirt] [PATCH v2] docs: add a note that spice channel is usable only with spice graphics
by Pavel Hrdina
To prevent a confusion about missing chardev argument in qemu
command line add a note about that behavior into documentation.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
docs/formatdomain.html.in | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index fb0a0d1..2f2976c 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -5372,6 +5372,10 @@ qemu-kvm -net nic,model=? /dev/null
under a channel name specified in the <code>channel</code>
attribute. <span class="since">Since 1.2.2</span>
</p>
+ <p>
+ Note: in order for the spiceport to be usable, the domain must have
+ spice graphics as well.
+ </p>
<pre>
...
--
2.0.5
9 years, 8 months
[libvirt] [PATCH v9 0/4] Introduce API to query IP addresses for given domain
by Daniel P. Berrange
This polishes off Nehal's long standing work to add IP address
reporting to libvirt. In v9 I address John's coverity comments
and switched to use an dedicated parameter for selecting the
data source, instead of flags.
Nehal J Wani (4):
domifaddr: Implement the public APIs
domifaddr: Implement the remote protocol
domifaddr: Implement the API for qemu
domifaddr: Add virsh support
daemon/remote.c | 135 ++++++++++++++++++++++++++
include/libvirt/libvirt-domain.h | 28 ++++++
src/driver-hypervisor.h | 6 ++
src/libvirt-domain.c | 123 +++++++++++++++++++++++
src/libvirt_public.syms | 2 +
src/qemu/qemu_agent.c | 204 +++++++++++++++++++++++++++++++++++++++
src/qemu/qemu_agent.h | 4 +
src/qemu/qemu_driver.c | 175 +++++++++++++++++++++++++++++++++
src/remote/remote_driver.c | 104 ++++++++++++++++++++
src/remote/remote_protocol.x | 37 ++++++-
src/remote_protocol-structs | 25 +++++
tests/qemuagenttest.c | 188 ++++++++++++++++++++++++++++++++++++
tools/virsh-domain-monitor.c | 146 ++++++++++++++++++++++++++++
tools/virsh.pod | 16 +++
14 files changed, 1192 insertions(+), 1 deletion(-)
--
2.1.0
9 years, 8 months
[libvirt] [PATCH] network_conf: check sysfs if the bridge exists on host for user created bridges
by Shivaprasad G Bhat
The patch fixes the below problem.
==============================
If the bridge name is not mentioned in the <network> xml, the bridge name is
auto generated from virNetworkAllocateBridge(). If the default template named
bridge is created manually by a user, the bridge start will fail with
"File exists".
bash-4.3$ sudo brctl addbr virbr1
bash-4.3$ brctl show
bridge name bridge id STP enabled interfaces
br0 8000.000000000000 no
virbr0 8000.525400a91d03 yes virbr0-nic
virbr1 8000.000000000000 no
bash-4.3$ sudo virsh net-list --all
Name State Autostart Persistent
----------------------------------------------------------
default active no yes
bash-4.3$ cat /tmp/isolated # Notice that the <bridge> intentionally not given.
<network>
<name>isolated</name>
<forward/>
<ip address="192.168.123.1" netmask="255.255.255.0">
<dhcp>
<range start="192.168.123.2" end="192.168.123.254"/>
</dhcp>
</ip>
</network>
bash-4.3$ sudo virsh net-create /tmp/isolated
error: Failed to create network from isolated
error: Unable to create bridge virbr1: File exists
===============================
---
The following series implements...
Shivaprasad G Bhat (1):
network_conf: check sysfs if the bridge exists on host for user created bridges
src/conf/network_conf.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
--
Signature
9 years, 8 months
[libvirt] [PATCH 0/3] update and unify some documentation texts
by Pavel Hrdina
Pavel Hrdina (3):
iface-define: update and unify documentation
pool-define: update and unify documentation
net-define: update or unify documentation
src/libvirt-interface.c | 3 ++-
src/libvirt-network.c | 3 ++-
src/libvirt-storage.c | 4 ++--
tools/virsh-interface.c | 5 +++--
tools/virsh-network.c | 5 +++--
tools/virsh-pool.c | 5 +++--
tools/virsh.pod | 11 ++++++-----
7 files changed, 21 insertions(+), 15 deletions(-)
--
2.0.5
9 years, 8 months
[libvirt] [PATCH v2] qemu: bulk stats: implement (cpu) tune group.
by Francesco Romani
Management applications, like oVirt, may need to setup cpu quota
limits to enforce QoS for domains.
For this purpose, management applications also need to check how
domains are behaving with respect to CPU quota. This data is available
using the virDomainGetSchedulerParameters API.
This patch adds a new group to bulk stats API to obtain the same
information.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1191428
---
include/libvirt/libvirt-domain.h | 1 +
src/libvirt-domain.c | 16 ++++++++
src/qemu/qemu_driver.c | 84 ++++++++++++++++++++++++++++++++++++++++
tools/virsh-domain-monitor.c | 7 ++++
tools/virsh.pod | 10 ++++-
5 files changed, 117 insertions(+), 1 deletion(-)
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
index a9d3efd..a283f93 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -1723,6 +1723,7 @@ typedef enum {
VIR_DOMAIN_STATS_VCPU = (1 << 3), /* return domain virtual CPU info */
VIR_DOMAIN_STATS_INTERFACE = (1 << 4), /* return domain interfaces info */
VIR_DOMAIN_STATS_BLOCK = (1 << 5), /* return domain block info */
+ VIR_DOMAIN_STATS_TUNE_CPU = (1 << 6), /* return domain CPU tuning info */
} virDomainStatsTypes;
typedef enum {
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 89d1eab..b451299 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -11004,6 +11004,22 @@ virConnectGetDomainCapabilities(virConnectPtr conn,
* "block.<num>.physical" - physical size in bytes of the container of the
* backing image as unsigned long long.
*
+ * VIR_DOMAIN_STATS_TUNE_CPU: Return CPU tuning statistics
+ * and usage information.
+ * The typed parameter keys are in this format:
+ * "tune.vcpu.quota" - max allowed bandwidth, in microseconds, as
+ * long long integer. -1 means 'infinite'.
+ * "tune.vcpu.period" - timeframe on which the virtual cpu quota is
+ * enforced, in microseconds, as unsigned long long.
+ * "tune.emu.quota" - max allowed bandwidth for emulator threads,
+ * in microseconds, as long long integer.
+ * -1 means 'infinite'.
+ * "tune.emu.period" - timeframe on which the emulator quota is
+ * enforced, in microseconds, as unsigned long long.
+ * "tune.cpu.shares" - weight of this domain. This value is meaningful
+ * only if compared with the other values of
+ * the running domains. Expressed as unsigned long long.
+ *
* Note that entire stats groups or individual stat fields may be missing from
* the output in case they are not supported by the given hypervisor, are not
* applicable for the current state of the guest domain, or their retrieval
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index ffa4e19..a810fa5 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -18768,6 +18768,89 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver,
#undef QEMU_ADD_COUNT_PARAM
+
+#define QEMU_ADD_PARAM_LL(record, maxparams, name, value) \
+do { \
+ if (virTypedParamsAddLLong(&(record)->params, \
+ &(record)->nparams, \
+ maxparams, \
+ name, \
+ value) < 0) \
+ goto cleanup; \
+} while (0)
+
+#define QEMU_ADD_PARAM_ULL(record, maxparams, name, value) \
+do { \
+ if (virTypedParamsAddULLong(&(record)->params, \
+ &(record)->nparams, \
+ maxparams, \
+ name, \
+ value) < 0) \
+ goto cleanup; \
+} while (0)
+
+static int
+qemuDomainGetStatsCpuTune(virQEMUDriverPtr driver,
+ virDomainObjPtr dom,
+ virDomainStatsRecordPtr record,
+ int *maxparams,
+ unsigned int privflags ATTRIBUTE_UNUSED)
+{
+ int ret = -1;
+ unsigned long long shares = 0;
+ qemuDomainObjPrivatePtr priv = dom->privateData;
+ virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
+
+ if (!cfg->privileged ||
+ !virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPU)) {
+ ret = 0;
+ goto cleanup;
+ }
+
+ if (virCgroupGetCpuShares(priv->cgroup, &shares) < 0) {
+ ret = 0;
+ goto cleanup;
+ }
+
+ QEMU_ADD_PARAM_ULL(record, maxparams, "tune.cpu.shares", shares);
+
+ if (virCgroupSupportsCpuBW(priv->cgroup)) {
+ unsigned long long period = 0;
+ long long quota = 0;
+ unsigned long long emulator_period = 0;
+ long long emulator_quota = 0;
+ int err;
+
+ err = qemuGetVcpusBWLive(dom, &period, "a);
+ if (!err) {
+ QEMU_ADD_PARAM_ULL(record, maxparams,
+ "tune.vcpu.period", period);
+ QEMU_ADD_PARAM_LL(record, maxparams,
+ "tune.vcpu.quota", quota);
+ }
+
+ err = qemuGetEmulatorBandwidthLive(dom, priv->cgroup,
+ &emulator_period, &emulator_quota);
+ if (!err) {
+ QEMU_ADD_PARAM_ULL(record, maxparams,
+ "tune.emu.period", emulator_period);
+ QEMU_ADD_PARAM_LL(record, maxparams,
+ "tune.emu.quota", emulator_quota);
+ }
+ }
+
+ ret = 0;
+
+ cleanup:
+ virObjectUnref(cfg);
+ return ret;
+}
+
+#undef QEMU_ADD_PARAM_LL
+
+#undef QEMU_ADD_PARAM_ULL
+
+
typedef int
(*qemuDomainGetStatsFunc)(virQEMUDriverPtr driver,
virDomainObjPtr dom,
@@ -18788,6 +18871,7 @@ static struct qemuDomainGetStatsWorker qemuDomainGetStatsWorkers[] = {
{ qemuDomainGetStatsVcpu, VIR_DOMAIN_STATS_VCPU, false },
{ qemuDomainGetStatsInterface, VIR_DOMAIN_STATS_INTERFACE, false },
{ qemuDomainGetStatsBlock, VIR_DOMAIN_STATS_BLOCK, true },
+ { qemuDomainGetStatsCpuTune, VIR_DOMAIN_STATS_TUNE_CPU, false },
{ NULL, 0, false }
};
diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c
index 464ac11..ede433d 100644
--- a/tools/virsh-domain-monitor.c
+++ b/tools/virsh-domain-monitor.c
@@ -2017,6 +2017,10 @@ static const vshCmdOptDef opts_domstats[] = {
.type = VSH_OT_BOOL,
.help = N_("report domain block device statistics"),
},
+ {.name = "tune-cpu",
+ .type = VSH_OT_BOOL,
+ .help = N_("report domain cpu scheduler parameters"),
+ },
{.name = "list-active",
.type = VSH_OT_BOOL,
.help = N_("list only active domains"),
@@ -2127,6 +2131,9 @@ cmdDomstats(vshControl *ctl, const vshCmd *cmd)
if (vshCommandOptBool(cmd, "block"))
stats |= VIR_DOMAIN_STATS_BLOCK;
+ if (vshCommandOptBool(cmd, "tune-cpu"))
+ stats |= VIR_DOMAIN_STATS_TUNE_CPU;
+
if (vshCommandOptBool(cmd, "list-active"))
flags |= VIR_CONNECT_GET_ALL_DOMAINS_STATS_ACTIVE;
diff --git a/tools/virsh.pod b/tools/virsh.pod
index 1f71c91..bcc966e 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -828,6 +828,7 @@ or unique source names printed by this command.
=item B<domstats> [I<--raw>] [I<--enforce>] [I<--backing>] [I<--state>]
[I<--cpu-total>] [I<--balloon>] [I<--vcpu>] [I<--interface>] [I<--block>]
+[I<--tune-cpu>]
[[I<--list-active>] [I<--list-inactive>] [I<--list-persistent>]
[I<--list-transient>] [I<--list-running>] [I<--list-paused>]
[I<--list-shutoff>] [I<--list-other>]] | [I<domain> ...]
@@ -846,7 +847,7 @@ behavior use the I<--raw> flag.
The individual statistics groups are selectable via specific flags. By
default all supported statistics groups are returned. Supported
statistics groups flags are: I<--state>, I<--cpu-total>, I<--balloon>,
-I<--vcpu>, I<--interface>, I<--block>.
+I<--vcpu>, I<--interface>, I<--block>, I<--tune-cpu>.
When selecting the I<--state> group the following fields are returned:
"state.state" - state of the VM, returned as number from virDomainState enum,
@@ -906,6 +907,13 @@ local file or block device,
"block.<num>.capacity" - logical size of source file in bytes,
"block.<num>.physical" - physical size of source file in bytes
+I<--tune-cpu> returns:
+"tune.vcpu.quota" - max allowed bandwidth, in microseconds,
+"tune.vcpu.period" - timeframe for enforcing the vcpu quota, in microseconds,
+"tune.emu.quota" - maximum bandwidth for emulator threads, in microseconds,
+"tune.emu.period" - timeframe for enforcing the emu quota, in microseconds,
+"tune.cpu.shares" - weight of this domain, compared to other running domains.
+
Selecting a specific statistics groups doesn't guarantee that the
daemon supports the selected group of stats. Flag I<--enforce>
forces the command to fail if the daemon doesn't support the
--
2.1.0
9 years, 8 months