[libvirt] [libvirt-glib 1/5] gconfig: Fix gvir_config_domain_os_get_boot_devices() API doc
by Christophe Fergeau
The elements of the returned list are integer enum values, so they cannot
be unreffed.
---
libvirt-gconfig/libvirt-gconfig-domain-os.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/libvirt-gconfig/libvirt-gconfig-domain-os.c b/libvirt-gconfig/libvirt-gconfig-domain-os.c
index 03c8a85..b922a0e 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-os.c
+++ b/libvirt-gconfig/libvirt-gconfig-domain-os.c
@@ -267,8 +267,7 @@ static gboolean add_boot_device(xmlNodePtr node, gpointer opaque)
* @os: a #GVirConfigDomainOs
*
* Gets the list of devices attached to @os. The returned list should be
- * freed with g_list_free(), after its elements have been unreffed with
- * g_object_unref().
+ * freed with g_list_free().
*
* Returns: (element-type LibvirtGConfig.DomainOsBootDevice) (transfer full):
* a newly allocated #GList of #GVirConfigDomainOsBootDevice.
--
1.8.4.2
10 years, 9 months
[libvirt] [PATCH] The numa node numbers can be non-sequential.
by Shivaprasad G Bhat
On PowerNV platform the numa node numbers can be non-sequential,
#numactl --hardware
node distances:
node 0 1 16 17
0: 10 40 40 40
1: 40 10 40 40
16: 40 40 10 40
17: 40 40 40 10
The numa node number is used as index and vice versa which can cause
the libvirt to crash.
Signed-off-by: Shivaprasad G Bhat <sbhat(a)linux.vnet.ibm.com>
Signed-off-by: Pradipta Kumar Banerjee <bpradip(a)in.ibm.com>
---
src/conf/capabilities.c | 12 ++++++++++--
src/qemu/qemu_driver.c | 5 +++--
src/qemu/qemu_process.c | 2 +-
3 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c
index 726ec3f..78f65cb 100644
--- a/src/conf/capabilities.c
+++ b/src/conf/capabilities.c
@@ -1000,10 +1000,18 @@ virCapabilitiesGetCpusForNode(virCapsPtr caps,
size_t node,
virBitmapPtr cpumask)
{
- virCapsHostNUMACellPtr cell = caps->host.numaCell[node];
+ virCapsHostNUMACellPtr cell = NULL;
size_t cpu;
+ size_t index;
+ /* The numa node numbers can be non-contiguous. Ex: 0,1,16,17. */
+ for (index = 0; index < caps->host.nnumaCell; index++) {
+ if (caps->host.numaCell[index]->num == node) {
+ cell = caps->host.numaCell[index];
+ break;
+ }
+ }
- for (cpu = 0; cpu < cell->ncpus; cpu++) {
+ for (cpu = 0; cell && cpu < cell->ncpus; cpu++) {
if (virBitmapSetBit(cpumask, cell->cpus[cpu].id) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Cpu '%u' in node '%zu' is out of range "
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 6b3825a..ae36fbe 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -8532,12 +8532,13 @@ qemuDomainSetNumaParamsLive(virDomainObjPtr vm,
for (i = 0; i < caps->host.nnumaCell; i++) {
bool result;
- if (virBitmapGetBit(nodeset, i, &result) < 0) {
+ virCapsHostNUMACellPtr cell = caps->host.numaCell[i];
+ if (virBitmapGetBit(nodeset, cell->num, &result) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Failed to get cpuset bit values"));
goto cleanup;
}
- if (result && (virBitmapSetBit(temp_nodeset, i) < 0)) {
+ if (result && (virBitmapSetBit(temp_nodeset, cell->num) < 0)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Failed to set temporary cpuset bit values"));
goto cleanup;
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 8bcd98e..c28f84d 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -2002,7 +2002,7 @@ qemuPrepareCpumap(virQEMUDriverPtr driver,
size_t j;
int cur_ncpus = caps->host.numaCell[i]->ncpus;
bool result;
- if (virBitmapGetBit(nodemask, i, &result) < 0) {
+ if (virBitmapGetBit(nodemask, caps->host.numaCell[i]->num, &result) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Failed to convert nodeset to cpuset"));
virBitmapFree(cpumap);
10 years, 9 months
[libvirt] [PATCH] qemu: be sure we're using the updated value of backend during hotplug
by Laine Stump
Probable fix for
https://bugzilla.redhat.com/show_bug.cgi?id=1056360
commit f094aaac changed qemuPrepareHostdevPCIDevices() such that it
may modify the "backend" (vfio vs. legacy kvm) setting in the
virHostdevDef. However, qemuDomainAttachHostPciDevice() (used by
hotplug) copies the backend setting into a local *before* calling
qemuPrepareHostdevPCIDevices(), and then later makes a decision based
on that pre-change value.
The result is that, if the backend had been set to "default" (i.e. not
specified in the config) and was later updated to "VFIO" by
qemuPrepareHostdevPCIDevices(), the qemu process' MacMemLock is not
increased (as is required for VFIO device assignment).
This patch delays making the local copy of backend until after its
potential modification.
---
src/qemu/qemu_hotplug.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 4315df2..4a885d2 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1,7 +1,7 @@
/*
* qemu_hotplug.h: QEMU device hotplug management
*
- * Copyright (C) 2006-2013 Red Hat, Inc.
+ * Copyright (C) 2006-2014 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@@ -1152,7 +1152,7 @@ qemuDomainAttachHostPciDevice(virQEMUDriverPtr driver,
bool releaseaddr = false;
bool teardowncgroup = false;
bool teardownlabel = false;
- int backend = hostdev->source.subsys.u.pci.backend;
+ int backend;
unsigned long long memKB;
if (VIR_REALLOC_N(vm->def->hostdevs, vm->def->nhostdevs + 1) < 0)
@@ -1162,6 +1162,9 @@ qemuDomainAttachHostPciDevice(virQEMUDriverPtr driver,
&hostdev, 1, priv->qemuCaps) < 0)
return -1;
+ /* this could have been changed by qemuPrepareHostdevPCIDevices */
+ backend = hostdev->source.subsys.u.pci.backend;
+
switch ((virDomainHostdevSubsysPciBackendType) backend) {
case VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO:
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE_VFIO_PCI)) {
--
1.8.5.3
10 years, 9 months
[libvirt] [PATCH] Write up the project governance process
by Daniel P. Berrange
The project has historically operated as a meritocratic
consensus based community. Formally document what has
always been an unwritten assumption amongst the community
participants. Also include an explicit code of conduct
to prempt any potential, but unlikely, future problems.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
docs/governance.html.in | 292 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 292 insertions(+)
create mode 100644 docs/governance.html.in
At FOSDEM this past weekend I was asked what the libvirt
governance process was. While I believe our community
members already understand all this, and it can be infered
from behaviour on lists, it will help future new contributors
to understand how we operate if we actually document it.
This is likely to be particularly helpful for other companies
wondering how to get involved in the libvirt project.
diff --git a/docs/governance.html.in b/docs/governance.html.in
new file mode 100644
index 0000000..8bc4e51
--- /dev/null
+++ b/docs/governance.html.in
@@ -0,0 +1,292 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <body>
+ <h1>Project governance</h1>
+
+ <ul id="toc"></ul>
+
+ <p>
+ The libvirt project operates as a meritocratic, consensus-based community.
+ Anyone with an interest in the project can join the community, contributing
+ to the ongoing development of the project's work. This pages describes how
+ that participation takes place and how contributors earn merit, and thus
+ influence, within the community.
+ </p>
+
+ <h2><a name="codeofconduct">Code of conduct</a></h2>
+
+ <p>
+ The libvirt project community covers people from a wide variety of
+ countries, backgrounds and positions. This global diversity is a great
+ strength of the project, but can also lead to communication issues,
+ which may in turn cause unhappiness. To maximise happiness of the
+ project community taken as a whole, all members (whether users,
+ contributors or committers) are expected to abide by the project's
+ code of conduct. At a high level the code can be summarized as
+ <em>"be excellant to each other"</em>. Expanding on this
+ </p>
+
+ <ul>
+ <li><strong>Be respectful:</strong> disagreements between people are to
+ be expected and are usually the sign of healthy debate and engagement.
+ Disagreements can lead to frustration and even anger for some members.
+ Turning to personal insults, intimidation or threatening behaviour does
+ not improve the situation though. Participants should thus take care to
+ ensure all communications / interactions stay professional at all times.</li>
+
+ <li><strong>Be considerate:</strong> remember that the community has members
+ with a diverse background many of whom have English as a second language.
+ What might appear impolite, may simply be a result of a lack of knowledge
+ of the English language. Bear in mind that actions will have an impact
+ on other community members and the project as a whole, so take potential
+ consequences into account before persuing a course of action.</li>
+
+ <li><strong>Be forgiving:</strong> humans are fallible and as such prone
+ to make mistakes and inexplicably change their positions at times. Don't
+ assume that other members are acting with malicious intent. Be prepared
+ to forgive people who make mistakes and assist each other in learning
+ from them. Playing a blame game doesn't help anyone.</li>
+ </ul>
+
+ <h2><a name="roles">Roles and responsibilities</a></h2>
+
+ <h3><a href="users">Users</a></h3>
+
+ <p>
+ The users are anyone who has a need for the output of the project.
+ There are no rules or requirements to become a user of libvirt. Even
+ if the software does not yet work on their OS platform, a person can
+ be considered a potential future user and welcomed to participate.
+ </p>
+
+ <p>
+ Participation by users is key to ensuring the project moves in the
+ right direction, satisfying their real world needs. Users are
+ encouraged in participate in the broader libvirt community in any
+ number of ways:
+ </p>
+
+ <ul>
+ <li>Evangelism: spread the word about what libvirt is doing, how it
+ helps solve your problems. This can be via blog articles, social
+ media postings, video blogs, user group / conference presentations
+ and any other method of diseminating information</li>
+ <li>Feedback: let the developers know about what does and does not
+ work with the project. Talk to developers on the project's
+ IRC channel and mailing list, or find them at conferences. Tell
+ them what gaps the project has or where they should look for
+ future development</li>
+ <li>Moral support: developers live for recognition of the positive
+ impact their work has on users' lives. Give thanks to the developers
+ when evangelising the project, or when meeting them at user groups,
+ conferences, etc.</li>
+ </ul>
+
+ <p>
+ The above is not an exhaustive list of things users can do to
+ participate in the project. Further ideas and suggestions are
+ welcome. Users are encouraged to take their participation
+ further and become contributors to the project in any of the
+ ways listed in the next section.
+ </p>
+
+ <h3><a name="contributors">Contributors</a></h3>
+
+ <p>
+ The contributors are community members who have some concrete impact
+ to the ongoing development of the project. There are many ways in which
+ members can contribute, with no requirement to be a software engineer.
+ Many users can in fact consider themselves contributors merely by
+ engaging in evangelism for the project.
+ </p>
+
+ <ul>
+ <li>Bug reporting: improve the quality of the project by reporting
+ any problems found either to the project's own bug tracker, or to
+ that of the OS vendor shipping the libvirt code.</li>
+ <li>User help: join the IRC channel or mailing list to assist or advice
+ other users in troubleshooting the problems they face.</li>
+ <li>Feature requests: help set the direction for future work by
+ reporting details of features which are missing to the project's
+ own bug tracker or mailing lists.</li>
+ <li>Graphical design: contribute to the development of the project's
+ websites / wiki brand with improved graphics, styling or layout.</li>
+ <li>Code development: write and submit patches to address bugs or implement
+ new features</li>
+ <li>Architectural design: improve the usefulness of the project
+ by providing feedback on the design of proposed features, to
+ ensure they satisfy the broadest applicable needs and an survive
+ the long term</li>
+ <li>Code review: look at patches which are submitted and critique
+ the code to identify bugs, potential design problems or other
+ issues which should be addressed before the code is accepted</li>
+ <li>Documentation: contribute to content on personal blogs, the
+ website, wiki, code comments, or any of the formal documentation
+ efforts.</li>
+ <li>Translation: join the Fedora transifex community to improve the
+ quality of translations needed by the libvirt project.</li>
+ </ul>
+
+ <p>
+ The above is not an exhaustive list of things members can do to
+ contribute to the project. Further ideas and suggestions are
+ welcome.
+ </p>
+
+ <p>
+ There are no special requirements to becoming a contributor other
+ than having the interest and ability to provide a contribution. The
+ libvirt project <strong>does not require</strong> any
+ <em>"Contributor License Agreement"</em>
+ to be signed prior to engagement with the community.
+ </p>
+
+ <p>
+ In making a contribution to the project, the community member is
+ implicitly stating that they accept the terms of the license under
+ which the work they are contributing to is distributed. They are
+ also implicitly stating that they have the legal right to make the
+ contribution, if doing so on behalf of a broader organization /
+ company. Most of the project's code is distributed under the GNU
+ Lesser General Public License, version 2 or later. Details of the
+ exact license under which contributions will be presumed to be
+ covered are found in the source repositories, or website in question.
+ </p>
+
+ <h3><a name="committers">Committers</a></h3>
+
+ <p>
+ The committers are the subset of contributors who have direct access
+ to commit code to the project's primary source code repositories, which
+ are currently using the GIT software. The committers are chosen based
+ on the quality of their contributions over a period of time. This includes
+ both the quality of code they submit, as well as the quality of reviews
+ they provide on other contributors' submissions and a demonstration that
+ they understand day-to-day operation of the projet and its goals. There
+ is no minimum level of contribution required in order to become a committer,
+ though 2-3 months worth of quality contribution would be a rough guide.
+ </p>
+
+ <p>
+ There are no special requirements to becoming a committer other than to
+ have shown a willingness and ability to contribute to the project over
+ an extended period of time. Proposals for elevating contributors to
+ committers are typically made by existing comitters, though contributors
+ are also welcome to make proposals. The decision to approve the elevation
+ of a contributor to a committer is made through "rough consensus" between
+ the existing committers.
+ </p>
+
+ <p>
+ The aim in elevating contributors to committers is to ensure that there
+ is a broad base of experience and expertize across all areas of the
+ project's work. Committers are not required to have knowledge across
+ all areas of the project's work. While an approved committer has the
+ technical ability to commit code to any area of the project, by convention
+ they will only commit to areas they feel themselves to be qualified to
+ evaluate the contribution. If in doubt, committers will defer to the
+ opinion of other committers with greater expertize in an area.
+ </p>
+
+ <p>
+ The committers hold the ultimate control over what contributions are
+ accepted by the project, however, this does not mean they have the
+ right to do whatever they want. Where there is debate and disagreement
+ between contributors, committers are expected to look at the issues with
+ an unbiased point of view and help achieve a "rough consensus". If the
+ committer has a conflict of interest in the discussion, for example due
+ to their position of employment, they are expected to put the needs of
+ the community project first. If they cannot put the community project
+ first, they must declare their conflict of interest, and allow other
+ non-conflicted committers to make any final decision.
+ </p>
+
+ <p>
+ The committers are expected to monitor contributions to areas of the
+ project where they have expertize and ensure that either some form of
+ feedback is provided to the contributor, or to accept their contribution.
+ There is no formal minimum level of approval required to accept a
+ contribution. Positive review by any committer experienced in the area
+ of work is considered to be enough to justify acceptance in normal
+ circumstances. Where one committer explicitly rejects a contribution,
+ however, other committers should not override that rejection without
+ first establishing a "rough consensus" amongst the broader group of
+ committers.
+ </p>
+
+ <p>
+ Being a committer is a privilege, not a right. In exceptional
+ circumstances, the privilege may be removed from an active
+ contributor. Such decisions will be taken based on "rough
+ consensus" amongst other committers. In the event that a committer
+ is no longer able to participate in the project, after some period
+ of inactivity passes, they may be asked to confirm that they wish
+ to retain their rights as a committer.
+ </p>
+
+ <h3><a name="secteam">Security team</a></h3>
+
+ <p>
+ The security team consists of a subset of the project committers
+ along with representatives from vendors shipping the project's
+ software. The subset of project committers is chosen to be the
+ minimal size neccessary to provide expertise spanning most of
+ the project's work. Further project committers may be requested
+ to engage in resolving specific security issues on a case by
+ case basis. Any vendor who is shipping the project's software
+ may submit a request for one or more of their representatives
+ to join the security team. Such requests must by approved by
+ existing members of the team vouching for the integrity of
+ the nominated person or organization.
+ </p>
+
+ <p>
+ Members of the security team are responsible for triaging and
+ resolving any security issues that are reported to the project.
+ They are expected to abide by the project's documented
+ <a href="securityprocess.html">security process</a>. In particular
+ they must respect any embargo period agreed amongst the team
+ before disclosing a private issue.
+ </p>
+
+ <h2><a name="roughconsensus">Rough consensus</a></h2>
+
+ <p>
+ A core concept for governance of the project described above is
+ that of "rough consensus". To expand on this, it is a process
+ of decision making that involves the following steps
+ </p>
+
+ <ul>
+ <li>Proposal</li>
+ <li>Discussion</li>
+ <li>Vote (exceptional circumstances only)</li>
+ <li>Decision</li>
+ </ul>
+
+ <p>
+ To put this into words, any contributor is welcome to make a proposal
+ for consideration. Any contributor may participate in the discussions
+ around the proposal. The discussion will usually result in agreement
+ between the interested parties, or at least agreement between the
+ committers. Only in the very exceptional circumstance where there
+ is disagreement between committers, would a vote be considered.
+ Even in these exceptional circumstances, it is usually found to be
+ obvious what the majority opinion of the committers is. In the event
+ that even a formal vote is be tied, the committers will have to hold
+ ongoing discussions until the stalemate is resolved or the proposal
+ withdrawn.
+ </p>
+
+ <p>
+ The overall goal of the "rough consensus" process is to ensure that
+ decisions can be made within the project, with a minimum level of
+ bureaucracy and process. Implicit in this is that any person who does
+ not explicitly reject to a proposal is assumed to be supportive, or
+ at least agnostic.
+ </p>
+
+
+ </body>
+</html>
--
1.8.5.3
10 years, 9 months
[libvirt] [PATCH 00/15] Introduce virDomain{Resume,Suspend}Flags
by Michal Privoznik
So far, nothing interesting is happening here. The real work is yet to come :)
Michal Privoznik (15):
Introduce virDomainSuspendFlags
Introduce virDomainResumeFlags
esxDriver: Adapt to virDomain{Resume,Suspend}Flags
hypervDriver: Adapt to virDomain{Resume,Suspend}Flags
libxlDriver: Adapt to virDomain{Resume,Suspend}Flags
lxcDriver: Adapt to virDomain{Resume,Suspend}Flags
openvzDriver: Adapt to virDomain{Resume,Suspend}Flags
parallelsDriver: Adapt to virDomain{Resume,Suspend}Flags
qemuDriver: Adapt to virDomain{Resume,Suspend}Flags
testDriver: Adapt to virDomain{Resume,Suspend}Flags
vboxDriver: Adapt to virDomain{Resume,Suspend}Flags
vmwareDriver: Adapt to virDomain{Resume,Suspend}Flags
xenUnifiedDriver: Adapt to virDomain{Resume,Suspend}Flags
xenapiDriver: Adapt to virDomain{Resume,Suspend}Flags
virsh: Adapt to virDomain{Resume,Suspend}Flags
include/libvirt/libvirt.h.in | 4 ++
src/driver.h | 10 ++++
src/esx/esx_driver.c | 28 ++++++++++-
src/hyperv/hyperv_driver.c | 28 ++++++++++-
src/libvirt.c | 104 ++++++++++++++++++++++++++++++++++-----
src/libvirt_public.syms | 6 +++
src/libxl/libxl_driver.c | 28 +++++++++--
src/lxc/lxc_driver.c | 30 +++++++++--
src/openvz/openvz_driver.c | 28 ++++++++++-
src/parallels/parallels_driver.c | 24 ++++++++-
src/qemu/qemu_driver.c | 35 +++++++++++--
src/remote/remote_driver.c | 2 +
src/remote/remote_protocol.x | 24 ++++++++-
src/remote_protocol-structs | 10 ++++
src/test/test_driver.c | 26 +++++++++-
src/vbox/vbox_tmpl.c | 28 ++++++++++-
src/vmware/vmware_driver.c | 24 ++++++++-
src/xen/xen_driver.c | 28 +++++++++--
src/xenapi/xenapi_driver.c | 42 ++++++++++++++--
tools/virsh-domain.c | 52 +++++++++++++++-----
20 files changed, 502 insertions(+), 59 deletions(-)
--
1.8.5.2
10 years, 9 months
[libvirt] [PATCHv2 0/2] Fix problems with "forwardPlainNames"
by Laine Stump
changes from V1:
* Fix the test cases
* more information in commit log
* Add 2nd patch to make default forwardPlainNames='yes', as suggested
by danpb (since that was the original behavior).
Here is the thread of the original patch:
https://www.redhat.com/archives/libvir-list/2013-December/msg00397.html
(continued here in January):
https://www.redhat.com/archives/libvir-list/2014-January/msg01521.html
I believe I've addressed Daniel's concerns except the ability to
prevent forwarding of unresolved names in the configured domain, but
that was never the intended behavior to begin with. These patches fix
the bugs in the currently advertised behavior; we can create followup
patches for this "new" behavior if there is demand (so far there have
only been people saying that behavior should be *removed* :-)
Laine Stump (2):
network: only prevent forwarding of DNS requests for unqualified names
network: change default of forwardPlainNames to 'yes'
src/conf/network_conf.c | 32 +++++++++++++++-------
src/conf/network_conf.h | 17 ++++++++++--
src/network/bridge_driver.c | 17 +++++-------
tests/networkxml2confdata/dhcp6-nat-network.conf | 2 --
tests/networkxml2confdata/dhcp6-network.conf | 2 --
.../dhcp6host-routed-network.conf | 2 --
tests/networkxml2confdata/isolated-network.conf | 2 --
.../nat-network-dns-forwarders.conf | 2 --
.../networkxml2confdata/nat-network-dns-hosts.conf | 4 +--
.../nat-network-dns-srv-record-minimal.conf | 2 --
.../nat-network-dns-srv-record.conf | 2 --
.../nat-network-dns-txt-record.conf | 2 --
tests/networkxml2confdata/nat-network.conf | 2 --
tests/networkxml2confdata/netboot-network.conf | 2 --
.../networkxml2confdata/netboot-proxy-network.conf | 2 --
tests/networkxml2confdata/routed-network.conf | 2 --
tests/networkxml2xmlout/nat-network-dns-hosts.xml | 2 +-
.../nat-network-dns-more-hosts.xml | 2 +-
.../nat-network-no-hosts.xml | 1 +
19 files changed, 49 insertions(+), 50 deletions(-)
--
1.8.5.3
10 years, 9 months
[libvirt] [PATCH] Host cpu offline/online removes the cpus available for vms
by Shivaprasad G Bhat
Online/Offline operations on the host cpus removes the machine/cpuset.cpus
which are never added back. The guests with vcpu pinning can fail to boot
unless the xml is edited.
If the possibility that the offlined cpus are onlined back, the cpuset.cpus can be updated upon start of the guest thus allowing the guests to boot back without
erroring out.
Signed-off-by: Shivaprasad G Bhat <sbhat(a)linux.vnet.ibm.com>
---
src/util/vircgroup.c | 27 +++++++++++++++++----------
1 file changed, 17 insertions(+), 10 deletions(-)
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index a6d60c5..52575c9 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -72,6 +72,7 @@ typedef enum {
* before creating subcgroups and
* attaching tasks
*/
+ VIR_CGROUP_CPUS_HIERACHY = 1 << 1, /* call virCgroupCpuSetInherit */
} virCgroupFlags;
@@ -891,6 +892,7 @@ virCgroupMakeGroup(virCgroupPtr parent,
VIR_DEBUG("Make group %s", group->path);
for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) {
char *path = NULL;
+ int inheritCpuset = 0;
/* We must never mkdir() in systemd's hierarchy */
if (i == VIR_CGROUP_CONTROLLER_SYSTEMD) {
@@ -933,15 +935,7 @@ virCgroupMakeGroup(virCgroupPtr parent,
goto cleanup;
}
}
- if (group->controllers[VIR_CGROUP_CONTROLLER_CPUSET].mountPoint != NULL &&
- (i == VIR_CGROUP_CONTROLLER_CPUSET ||
- STREQ(group->controllers[i].mountPoint,
- group->controllers[VIR_CGROUP_CONTROLLER_CPUSET].mountPoint))) {
- if (virCgroupCpuSetInherit(parent, group) < 0) {
- VIR_FREE(path);
- goto cleanup;
- }
- }
+ inheritCpuset = 1;
/*
* Note that virCgroupSetMemoryUseHierarchy should always be
* called prior to creating subcgroups and attaching tasks.
@@ -958,6 +952,19 @@ virCgroupMakeGroup(virCgroupPtr parent,
}
}
+ if (inheritCpuset || (flags & VIR_CGROUP_CPUS_HIERACHY))
+ {
+ if (group->controllers[VIR_CGROUP_CONTROLLER_CPUSET].mountPoint != NULL &&
+ (i == VIR_CGROUP_CONTROLLER_CPUSET ||
+ STREQ(group->controllers[i].mountPoint,
+ group->controllers[VIR_CGROUP_CONTROLLER_CPUSET].mountPoint))) {
+ if (virCgroupCpuSetInherit(parent, group) < 0) {
+ VIR_FREE(path);
+ goto cleanup;
+ }
+ }
+ }
+
VIR_FREE(path);
}
@@ -1275,7 +1282,7 @@ virCgroupNewPartition(const char *path,
if (virCgroupNew(-1, parentPath, NULL, controllers, &parent) < 0)
goto cleanup;
- if (virCgroupMakeGroup(parent, *group, create, VIR_CGROUP_NONE) < 0) {
+ if (virCgroupMakeGroup(parent, *group, create, VIR_CGROUP_CPUS_HIERACHY) < 0) {
virCgroupRemove(*group);
goto cleanup;
}
10 years, 9 months
[libvirt] [PATCH] man: shm-merge-across-nodes is optional
by Ján Tomko
Mark the shm-merge-across-nodes parameter of node-memory-tune command
as optional in the virsh man page.
---
tools/virsh.pod | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Pushed as trivial.
diff --git a/tools/virsh.pod b/tools/virsh.pod
index 9e670da..f221475 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -307,7 +307,7 @@ in seconds for which the host has to be suspended, it should be at least
60 seconds.
=item B<node-memory-tune> [I<shm-pages-to-scan>] [I<shm-sleep-millisecs>]
-I<shm-merge-across-nodes>
+[I<shm-merge-across-nodes>]
Allows you to display or set the node memory parameters.
I<shm-pages-to-scan> can be used to set the number of pages to scan
--
1.8.3.2
10 years, 9 months
[libvirt] 'make rpm' failing in VPATH build because of wireshark
by Eric Blake
I'm out of time to investigate today, but inside a VPATH build
directory, 'make rpm' fails with:
Making all in src
make[4]: Entering directory
`/home/eblake/rpmbuild/BUILD/libvirt-1.2.2/tools/wireshark/src'
make[4]: *** No rule to make target `packet-libvirt.h', needed by
`packet-libvirt.c'. Stop.
If no one beats me to it, I'll try and fix that tomorrow.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
10 years, 9 months
[libvirt] [PATCH] qemu: minor cleanups
by Martin Kletzander
Some cleanups around serial chardevs and miscellaneous things I've
found inconsistent or not very clean.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/conf/domain_conf.c | 43 ++++++++++++++++++++++++++-----------------
src/qemu/qemu_capabilities.c | 4 ++--
src/qemu/qemu_command.c | 10 ++++++++--
3 files changed, 36 insertions(+), 21 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 28e24f9..fa1ecb5 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1559,7 +1559,7 @@ virDomainChrSourceDefIsEqual(const virDomainChrSourceDef *src,
if (tgt->type != src->type)
return false;
- switch (src->type) {
+ switch ((enum virDomainChrType)src->type) {
case VIR_DOMAIN_CHR_TYPE_PTY:
case VIR_DOMAIN_CHR_TYPE_DEV:
case VIR_DOMAIN_CHR_TYPE_FILE:
@@ -1583,16 +1583,22 @@ virDomainChrSourceDefIsEqual(const virDomainChrSourceDef *src,
STREQ_NULLABLE(src->data.nix.path, tgt->data.nix.path);
break;
+ case VIR_DOMAIN_CHR_TYPE_NULL:
case VIR_DOMAIN_CHR_TYPE_VC:
case VIR_DOMAIN_CHR_TYPE_STDIO:
case VIR_DOMAIN_CHR_TYPE_SPICEVMC:
+ case VIR_DOMAIN_CHR_TYPE_LAST:
/* nada */
return true;
}
- /* This should happen only on new,
- * yet unhandled type */
+ /* Even though gcc is able to detect that all possible values are
+ * handled in the switch above, it is not capable of realizing
+ * there isn't any possibility of escaping that switch without
+ * return. So for the sake of clean compilation, there has to be
+ * a return here */
+ /* coverity[dead_error_begin] */
return false;
}
@@ -6415,7 +6421,7 @@ error:
}
#define NET_MODEL_CHARS \
- "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ091234567890_-"
+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-"
/* Parse the XML definition for a network interface
* @param node XML nodeset to parse for net definition
@@ -7182,11 +7188,11 @@ virDomainChrSourceDefParseXML(virDomainChrSourceDefPtr def,
}
switch ((enum virDomainChrType) def->type) {
- case VIR_DOMAIN_CHR_TYPE_LAST:
case VIR_DOMAIN_CHR_TYPE_NULL:
+ case VIR_DOMAIN_CHR_TYPE_VC:
case VIR_DOMAIN_CHR_TYPE_STDIO:
case VIR_DOMAIN_CHR_TYPE_SPICEVMC:
- case VIR_DOMAIN_CHR_TYPE_VC:
+ case VIR_DOMAIN_CHR_TYPE_LAST:
break;
case VIR_DOMAIN_CHR_TYPE_PTY:
@@ -15573,11 +15579,13 @@ virDomainChrSourceDefFormat(virBufferPtr buf,
}
virBufferAddLit(buf, ">\n");
- switch (def->type) {
+ virBufferAdjustIndent(buf, 6);
+ switch ((enum virDomainChrType)def->type) {
case VIR_DOMAIN_CHR_TYPE_NULL:
case VIR_DOMAIN_CHR_TYPE_VC:
case VIR_DOMAIN_CHR_TYPE_STDIO:
case VIR_DOMAIN_CHR_TYPE_SPICEVMC:
+ case VIR_DOMAIN_CHR_TYPE_LAST:
/* nada */
break;
@@ -15588,7 +15596,7 @@ virDomainChrSourceDefFormat(virBufferPtr buf,
if (def->type != VIR_DOMAIN_CHR_TYPE_PTY ||
(def->data.file.path &&
!(flags & VIR_DOMAIN_XML_INACTIVE))) {
- virBufferEscapeString(buf, " <source path='%s'/>\n",
+ virBufferEscapeString(buf, "<source path='%s'/>\n",
def->data.file.path);
}
break;
@@ -15597,53 +15605,54 @@ virDomainChrSourceDefFormat(virBufferPtr buf,
if (def->data.udp.bindService &&
def->data.udp.bindHost) {
virBufferAsprintf(buf,
- " <source mode='bind' host='%s' "
+ "<source mode='bind' host='%s' "
"service='%s'/>\n",
def->data.udp.bindHost,
def->data.udp.bindService);
} else if (def->data.udp.bindHost) {
- virBufferAsprintf(buf, " <source mode='bind' host='%s'/>\n",
+ virBufferAsprintf(buf, "<source mode='bind' host='%s'/>\n",
def->data.udp.bindHost);
} else if (def->data.udp.bindService) {
- virBufferAsprintf(buf, " <source mode='bind' service='%s'/>\n",
+ virBufferAsprintf(buf, "<source mode='bind' service='%s'/>\n",
def->data.udp.bindService);
}
if (def->data.udp.connectService &&
def->data.udp.connectHost) {
virBufferAsprintf(buf,
- " <source mode='connect' host='%s' "
+ "<source mode='connect' host='%s' "
"service='%s'/>\n",
def->data.udp.connectHost,
def->data.udp.connectService);
} else if (def->data.udp.connectHost) {
- virBufferAsprintf(buf, " <source mode='connect' host='%s'/>\n",
+ virBufferAsprintf(buf, "<source mode='connect' host='%s'/>\n",
def->data.udp.connectHost);
} else if (def->data.udp.connectService) {
virBufferAsprintf(buf,
- " <source mode='connect' service='%s'/>\n",
+ "<source mode='connect' service='%s'/>\n",
def->data.udp.connectService);
}
break;
case VIR_DOMAIN_CHR_TYPE_TCP:
virBufferAsprintf(buf,
- " <source mode='%s' host='%s' service='%s'/>\n",
+ "<source mode='%s' host='%s' service='%s'/>\n",
def->data.tcp.listen ? "bind" : "connect",
def->data.tcp.host,
def->data.tcp.service);
- virBufferAsprintf(buf, " <protocol type='%s'/>\n",
+ virBufferAsprintf(buf, "<protocol type='%s'/>\n",
virDomainChrTcpProtocolTypeToString(
def->data.tcp.protocol));
break;
case VIR_DOMAIN_CHR_TYPE_UNIX:
- virBufferAsprintf(buf, " <source mode='%s'",
+ virBufferAsprintf(buf, "<source mode='%s'",
def->data.nix.listen ? "bind" : "connect");
virBufferEscapeString(buf, " path='%s'", def->data.nix.path);
virBufferAddLit(buf, "/>\n");
break;
}
+ virBufferAdjustIndent(buf, -6);
return 0;
}
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 8420047..8aec293 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1,7 +1,7 @@
/*
* qemu_capabilities.c: QEMU capabilities generation
*
- * Copyright (C) 2006-2013 Red Hat, Inc.
+ * Copyright (C) 2006-2014 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@@ -247,7 +247,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
"boot-strict", /* 160 */
"pvpanic",
"enable-fips",
- "spice-file-xfer-disable"
+ "spice-file-xfer-disable",
);
struct _virQEMUCaps {
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 96b8825..2db745a 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1,7 +1,7 @@
/*
* qemu_command.c: QEMU command generation
*
- * Copyright (C) 2006-2013 Red Hat, Inc.
+ * Copyright (C) 2006-2014 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@@ -6004,7 +6004,7 @@ qemuBuildChrArgStr(virDomainChrSourceDefPtr dev, const char *prefix)
if (prefix)
virBufferAdd(&buf, prefix, strlen(prefix));
- switch (dev->type) {
+ switch ((enum virDomainChrType)dev->type) {
case VIR_DOMAIN_CHR_TYPE_NULL:
virBufferAddLit(&buf, "null");
break;
@@ -6071,6 +6071,12 @@ qemuBuildChrArgStr(virDomainChrSourceDefPtr dev, const char *prefix)
dev->data.nix.path,
dev->data.nix.listen ? ",server,nowait" : "");
break;
+
+ case VIR_DOMAIN_CHR_TYPE_SPICEVMC:
+ /* spicevmc doesn't have any '-serial' compatible option */
+ case VIR_DOMAIN_CHR_TYPE_LAST:
+ /* coverity[dead_error_begin] */
+ break;
}
if (virBufferError(&buf)) {
--
1.8.5.3
10 years, 9 months