[libvirt] [PATCH v2 0/4] qemu: use arp table of host to get the
by Chen Hanxiao
introduce VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_ARP to get ip address
of VM from the output of /proc/net/arp
Chen Hanxiao (4):
util: introduce helper to parse /proc/net/arp
qemu: introduce qemuARPGetInterfaces to get IP from host's arp table
virsh: add --source arp to domifaddr
news: qemu: use arp table of host to get the IP address of guests
docs/news.xml | 5 +++
include/libvirt/libvirt-domain.h | 1 +
src/libvirt_private.syms | 2 ++
src/qemu/qemu_driver.c | 75 ++++++++++++++++++++++++++++++++++++++++
src/util/virmacaddr.c | 67 +++++++++++++++++++++++++++++++++++
src/util/virmacaddr.h | 18 ++++++++++
tools/virsh-domain-monitor.c | 2 ++
tools/virsh.pod | 7 ++--
8 files changed, 174 insertions(+), 3 deletions(-)
--
2.14.3
6 years, 11 months
[libvirt] [PATCH v3] docs: formatdomain: Document the CPU feature 'name' attribute
by Kashyap Chamarthy
Currently, the CPU feature 'name' XML attribute, as in:
[...]
<cpu match='exact'>
<model fallback='forbid'>IvyBridge</model>
<vendor>Intel</vendor>
<feature policy='require' name='pcid'/>
</cpu>
[...]
isn't explicitly documented in formatdomain.html.
Document it now.
Signed-off-by: Kashyap Chamarthy <kchamart(a)redhat.com>
---
v3:
- Wrap text in paragraph; fix phrasing [John Ferlan]
v2:
- Remove redundant line [Eduardo Habkost]
docs/formatdomain.html.in | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index d272cc1ba..fc0885420 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1454,6 +1454,21 @@
<span class="since">Since 0.8.5</span> the <code>policy</code>
attribute can be omitted and will default to <code>require</code>.
+
+ <p> Individual CPU feature names are specified as part of the
+ <code>name</code> attribute. For example, to explicitly specify
+ the 'pcid' feature with Intel IvyBridge CPU model:
+ </p>
+
+<pre>
+...
+<cpu match='exact'>
+ <model fallback='forbid'>IvyBridge</model>
+ <vendor>Intel</vendor>
+ <feature policy='require' name='pcid'/>
+</cpu>
+...</pre>
+
</dd>
<dt><code>cache</code></dt>
--
2.13.6
6 years, 11 months
[libvirt] [PATCH] libxl: resume lock process after failed migration
by Jim Fehlig
During migration, the lock process is paused in the perform phase
but not resumed if there is a subsequent failure, leaving the locked
resource unprotected.
The perform phase itself can fail, in which case the lock process
should be resumed before returning from perform. The finish phase
could also fail on the destination host, in which case the migration
is canceled in the confirm phase and the VM is resumed. The lock
process needs to be resumed there as well.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
src/libxl/libxl_migration.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/libxl/libxl_migration.c b/src/libxl/libxl_migration.c
index 228c8508c..a7a578c72 100644
--- a/src/libxl/libxl_migration.c
+++ b/src/libxl/libxl_migration.c
@@ -1238,6 +1238,12 @@ libxlDomainMigrationPerform(libxlDriverPrivatePtr driver,
ret = libxlDoMigrateSend(driver, vm, flags, sockfd);
virObjectLock(vm);
+ if (ret < 0)
+ virDomainLockProcessResume(driver->lockManager,
+ "xen:///system",
+ vm,
+ priv->lockState);
+
cleanup:
VIR_FORCE_CLOSE(sockfd);
virURIFree(uri);
@@ -1349,10 +1355,16 @@ libxlDomainMigrationConfirm(libxlDriverPrivatePtr driver,
int cancelled)
{
libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver);
+ libxlDomainObjPrivatePtr priv = vm->privateData;
virObjectEventPtr event = NULL;
int ret = -1;
if (cancelled) {
+ /* Resume lock process that was paused in MigrationPerform */
+ virDomainLockProcessResume(driver->lockManager,
+ "xen:///system",
+ vm,
+ priv->lockState);
if (libxl_domain_resume(cfg->ctx, vm->def->id, 1, 0) == 0) {
ret = 0;
} else {
--
2.16.0
6 years, 11 months
[libvirt] [PATCH v2] docs: formatdomain: Document the CPU feature 'name' attribute
by Kashyap Chamarthy
Currently, the CPU feature 'name' XML attribute, as in:
[...]
<cpu match='exact'>
<model fallback='forbid'>IvyBridge</model>
<vendor>Intel</vendor>
<feature policy='require' name='pcid'/>
</cpu>
[...]
isn't explicitly documented in formatdomain.html.
Document it now.
Signed-off-by: Kashyap Chamarthy <kchamart(a)redhat.com>
---
v2:
- Remove redundant line [Eduardo Habkost]
docs/formatdomain.html.in | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index d272cc1ba..a6d40411c 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1454,6 +1454,20 @@
<span class="since">Since 0.8.5</span> the <code>policy</code>
attribute can be omitted and will default to <code>require</code>.
+
+ Individual CPU feature names can be specified as part of the
+ <code>name</code> attribute. For example, to explicitly specify
+ the 'pcid' feature with Intel IvyBridge CPU model:
+
+<pre>
+...
+<cpu match='exact'>
+ <model fallback='forbid'>IvyBridge</model>
+ <vendor>Intel</vendor>
+ <feature policy='require' name='pcid'/>
+</cpu>
+...</pre>
+
</dd>
<dt><code>cache</code></dt>
--
2.13.6
6 years, 11 months
[libvirt] [PATCH v2 0/2] Support SMBIOS OEM strings
by Daniel P. Berrange
A followup to
https://www.redhat.com/archives/libvir-list/2017-November/msg00720.html
The QEMU patch is now merged (for next 2.12 release).
Since v2:
- Remove redundant error message report
- Split QEMU from XML parts of patch
Daniel P. Berrange (2):
conf: add support for setting OEM strings SMBIOS data fields
qemu: add support for generating SMBIOS OEM strings command line
docs/formatdomain.html.in | 13 ++++++++++
docs/schemas/domaincommon.rng | 9 +++++++
src/conf/domain_conf.c | 47 +++++++++++++++++++++++++++++++++++++
src/qemu/qemu_command.c | 28 ++++++++++++++++++++++
src/util/virsysinfo.c | 33 ++++++++++++++++++++++++++
src/util/virsysinfo.h | 10 ++++++++
tests/qemuxml2argvdata/smbios.args | 2 ++
tests/qemuxml2argvdata/smbios.xml | 5 ++++
tests/qemuxml2xmloutdata/smbios.xml | 5 ++++
9 files changed, 152 insertions(+)
--
2.14.3
6 years, 11 months
[libvirt] [PATCH] vbox: fix SEGV during dumpxml of a serial port
by Laine Stump
commit 77a12987a48 changed the "virDomainChrSourceDef source" inside
virDomainChrDef to "virDomainChrSourceDefPtr source", and started
allocating source inside virDomainChrDefNew(), but vboxDumpSerial()
was allocating a virDomainChrDef with a simple VIR_ALLOC(), so source
was never initialized, leading to a SEGV any time a serial port was
present. The same problem was created in vboxDumpParallel().
This patch changes vboxDumpSerial() and vboxDumpParallel() to use
virDomainChrDefNew() instead of VIR_ALLOC(), and makes a cursory
attempt to "recover" from OOM afterwards (much of the vbox code was
written to assume success, e.g. by having functions return void. Since
I have no way to test a more sweeping change to this code, I chose to
just short-circuit the rest of the function if virDomainChrDefNew()
fails - this is at least one step better than the previous code, which
would otherwise end up trying to dereference a NULL def->serials[i]
and crash libvirtd.
This resolves: https://bugzilla.redhat.com/1536649
---
src/vbox/vbox_common.c | 30 ++++++++++++++++++++++++++----
1 file changed, 26 insertions(+), 4 deletions(-)
diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
index 33aefabe5..c5fa5f08b 100644
--- a/src/vbox/vbox_common.c
+++ b/src/vbox/vbox_common.c
@@ -3887,8 +3887,19 @@ vboxDumpSerial(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine, PRUin
/* Allocate memory for the serial ports which are enabled */
if ((def->nserials > 0) && (VIR_ALLOC_N(def->serials, def->nserials) >= 0)) {
- for (i = 0; i < def->nserials; i++)
- ignore_value(VIR_ALLOC(def->serials[i]));
+ for (i = 0; i < def->nserials; i++) {
+ def->serials[i] = virDomainChrDefNew(NULL);
+ if (!def->serials[i]) {
+ /* there is no provision for returning an error
+ * (although the libvirtd logs will show an OOM error),
+ * but we need to at least prevent dereferencing
+ * def->serials[i] and later (including continuing in
+ * this function), as it will otherwise cause a SEGV.
+ */
+ def->nserials = i;
+ return;
+ }
+ }
}
/* Now get the details about the serial ports here */
@@ -3975,8 +3986,19 @@ vboxDumpParallel(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine, PRU
/* Allocate memory for the parallel ports which are enabled */
if ((def->nparallels > 0) && (VIR_ALLOC_N(def->parallels, def->nparallels) >= 0)) {
- for (i = 0; i < def->nparallels; i++)
- ignore_value(VIR_ALLOC(def->parallels[i]));
+ for (i = 0; i < def->nparallels; i++) {
+ def->parallels[i] = virDomainChrDefNew(NULL);
+ if (!def->parallels[i]) {
+ /* there is no provision for returning an error
+ * (although the libvirtd logs will show an OOM error),
+ * but we need to at least prevent dereferencing
+ * def->parallels[i] and later (including continuing in
+ * this function), as it will otherwise cause a SEGV.
+ */
+ def->nparallels = i;
+ return;
+ }
+ }
}
/* Now get the details about the parallel ports here */
--
2.14.3
6 years, 11 months
[libvirt] [PATCH 00/14] Misc build refactoring / isolation work
by Daniel P. Berrangé
This was triggered by the recent Fedora change to add '-z defs' to RPM
builds by default which breaks libvirt. Various make rule changes can
fix much of the problem, but it also requires source refactoring to get
rid of places where virt drivers directly call into the storage/network
drivers. Co-incidentally this work will also be useful in allowing us to
separate out drivers to distinct daemons.
Daniel P. Berrangé (14):
storage: extract storage file backend from main storage driver backend
storage: move storage file backend framework into util directory
rpc: don't link in second copy of RPC code to libvirtd & lockd plugin
conf: introduce callback registration for domain net device allocation
conf: expand network device callbacks to cover bandwidth updates
qemu: replace networkGetNetworkAddress with public API calls
conf: expand network device callbacks to cover resolving NIC type
network: remove conditional declarations
conf: move virStorageTranslateDiskSourcePool into domain conf
storage: export virStoragePoolLookupByTargetPath as a public API
build: explicitly link all modules with libvirt.so
build: provide a AM_FLAGS_MOD for loadable modules
build: passing the "-z defs" linker flag to prevent undefined symbols
build: link libvirt_lxc against libvirt.so
configure.ac | 1 +
daemon/Makefile.am | 4 +-
include/libvirt/libvirt-storage.h | 2 +
m4/virt-linker-no-undefined.m4 | 32 ++
po/POTFILES.in | 2 +-
src/Makefile.am | 142 ++++----
src/bhyve/bhyve_command.c | 6 +-
src/conf/domain_conf.c | 355 +++++++++++++++++++
src/conf/domain_conf.h | 71 ++++
src/driver-storage.h | 5 +
src/libvirt-storage.c | 40 +++
src/libvirt_private.syms | 29 ++
src/libvirt_public.syms | 6 +
src/libvirt_remote.syms | 11 +-
src/libxl/libxl_domain.c | 4 +-
src/libxl/libxl_driver.c | 6 +-
src/lxc/lxc_driver.c | 4 +-
src/lxc/lxc_process.c | 6 +-
src/network/bridge_driver.c | 144 ++------
src/network/bridge_driver.h | 72 ----
src/qemu/qemu_alias.c | 2 +-
src/qemu/qemu_domain.c | 1 -
src/qemu/qemu_domain_address.c | 2 +-
src/qemu/qemu_driver.c | 13 +-
src/qemu/qemu_hotplug.c | 16 +-
src/qemu/qemu_migration.c | 2 +-
src/qemu/qemu_process.c | 113 +++++-
src/remote/remote_driver.c | 1 +
src/remote/remote_protocol.x | 17 +-
src/remote_protocol-structs | 7 +
src/security/virt-aa-helper.c | 2 -
src/storage/storage_backend.c | 66 ----
src/storage/storage_backend.h | 75 ----
src/storage/storage_backend_fs.c | 8 +-
src/storage/storage_backend_gluster.c | 4 +-
src/storage/storage_driver.c | 256 +-------------
src/storage/storage_driver.h | 3 -
src/storage/storage_source.c | 645 ----------------------------------
src/storage/storage_source.h | 59 ----
src/util/virstoragefile.c | 609 +++++++++++++++++++++++++++++++-
src/util/virstoragefile.h | 32 ++
src/util/virstoragefilebackend.c | 108 ++++++
src/util/virstoragefilebackend.h | 104 ++++++
tests/virstoragetest.c | 1 -
tools/Makefile.am | 1 +
45 files changed, 1668 insertions(+), 1421 deletions(-)
create mode 100644 m4/virt-linker-no-undefined.m4
delete mode 100644 src/storage/storage_source.c
delete mode 100644 src/storage/storage_source.h
create mode 100644 src/util/virstoragefilebackend.c
create mode 100644 src/util/virstoragefilebackend.h
--
2.14.3
6 years, 11 months
[libvirt] [PATCH 00/10] Cache Allocation Technology support, this time for real (??)
by Martin Kletzander
So again all the reviews are incorporated. I managed to get my hands on
a machine with CAT support, so I also found out some things that needed
tweaking.
@Eli: I would still appreciate you helping with some testing as I wasn't
able to find a machine with multiple caches (sockets) and I
couldn't test that properly (mainly the fact that full mask needs
to be specified for caches for which we don't want any allocation
to happen).
Martin Kletzander (10):
Rename virResctrlInfo to virResctrlInfoPerCache
util: Add virResctrlInfo
conf: Use virResctrlInfo in capabilities
util: Remove now-unneeded resctrl functions
resctrl: Add functions to work with resctrl allocations
conf: Add support for cputune/cachetune
tests: Add virresctrltest
qemu: Add support for resctrl
docs: Add CAT (resctrl) support into news.xml
tests: Clean up and modify some vircaps2xmldata
docs/formatdomain.html.in | 54 +
docs/news.xml | 9 +
docs/schemas/domaincommon.rng | 32 +
po/POTFILES.in | 1 +
src/Makefile.am | 2 +-
src/conf/capabilities.c | 55 +-
src/conf/capabilities.h | 4 +-
src/conf/domain_conf.c | 295 +++-
src/conf/domain_conf.h | 13 +
src/libvirt_private.syms | 15 +-
src/qemu/qemu_process.c | 60 +-
src/util/virresctrl.c | 1542 ++++++++++++++++++--
src/util/virresctrl.h | 73 +-
src/util/virresctrlpriv.h | 27 +
tests/Makefile.am | 9 +-
tests/genericxml2xmlindata/cachetune-cdp.xml | 36 +
.../cachetune-colliding-allocs.xml | 30 +
.../cachetune-colliding-tunes.xml | 32 +
.../cachetune-colliding-types.xml | 30 +
tests/genericxml2xmlindata/cachetune-small.xml | 29 +
tests/genericxml2xmlindata/cachetune.xml | 33 +
tests/genericxml2xmltest.c | 10 +
.../vircaps2xmldata/linux-resctrl-cdp/resctrl/cpus | 1 -
.../linux-resctrl-cdp/resctrl/tasks | 0
.../linux-resctrl-skx-twocaches/resctrl/schemata | 2 +-
tests/vircaps2xmldata/linux-resctrl/resctrl/cpus | 1 -
.../vircaps2xmldata/linux-resctrl/resctrl/schemata | 2 +-
tests/vircaps2xmldata/linux-resctrl/resctrl/tasks | 0
tests/virresctrldata/resctrl-cdp.schemata | 2 +
.../virresctrldata/resctrl-skx-twocaches.schemata | 1 +
tests/virresctrldata/resctrl-skx.schemata | 1 +
tests/virresctrldata/resctrl.schemata | 1 +
tests/virresctrltest.c | 102 ++
33 files changed, 2363 insertions(+), 141 deletions(-)
create mode 100644 src/util/virresctrlpriv.h
create mode 100644 tests/genericxml2xmlindata/cachetune-cdp.xml
create mode 100644 tests/genericxml2xmlindata/cachetune-colliding-allocs.xml
create mode 100644 tests/genericxml2xmlindata/cachetune-colliding-tunes.xml
create mode 100644 tests/genericxml2xmlindata/cachetune-colliding-types.xml
create mode 100644 tests/genericxml2xmlindata/cachetune-small.xml
create mode 100644 tests/genericxml2xmlindata/cachetune.xml
delete mode 100644 tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/cpus
delete mode 100644 tests/vircaps2xmldata/linux-resctrl-cdp/resctrl/tasks
delete mode 100644 tests/vircaps2xmldata/linux-resctrl/resctrl/cpus
delete mode 100644 tests/vircaps2xmldata/linux-resctrl/resctrl/tasks
create mode 100644 tests/virresctrldata/resctrl-cdp.schemata
create mode 100644 tests/virresctrldata/resctrl-skx-twocaches.schemata
create mode 100644 tests/virresctrldata/resctrl-skx.schemata
create mode 100644 tests/virresctrldata/resctrl.schemata
create mode 100644 tests/virresctrltest.c
--
2.16.1
6 years, 11 months
[libvirt] [PATCH] docs: document requirement to provide Signed-off-by lines for DCO
by Daniel P. Berrange
Document that contributors are required to assert compliance with the
Developers Certification of Origin 1.1, by providing Signed-off-by tags
for all commit messages. The DCO is formally stating what we have long
implicitly expected of contributors in terms of their legal rights to
make the contribution. This puts the project in a stronger position
should any questions around contributions be raised going forward in the
future.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
docs/hacking.html.in | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/docs/hacking.html.in b/docs/hacking.html.in
index 6cadfb8343..98a24d785c 100644
--- a/docs/hacking.html.in
+++ b/docs/hacking.html.in
@@ -108,12 +108,18 @@
of the bug number is useful; but also summarize the issue
rather than making all readers follow the link. You can use
'git shortlog -30' to get an idea of typical summary lines.
- Libvirt does not currently attach any meaning to
- Signed-off-by: lines, so it is up to you if you want to
- include or omit them in the commit message.
</p>
</li>
+ <li><p>Contributors to libvirt projects <strong>must</strong>
+ assert that they are in compliance with the
+ <a href="https://developercertificate.org/">Developers
+ Certificate of Origin 1.1</a>. This is achieved by adding
+ a "Signed-off-by" line to every commit message. The presence
+ of this line attests that the contributor has read the
+ above lined DCO and agrees with its statements.
+ </p></li>
+
<li><p>Split large changes into a series of smaller patches,
self-contained if possible, with an explanation of each patch
and an explanation of how the sequence of patches fits
--
2.14.3
6 years, 11 months
[libvirt] [PATCH v3 0/3] nodedev: update caps before quering nodedev infos
by Wu Zongyong
Some capabilities of node devices rely on what driver they bound to,
and therefore, these capabilities may change when the driver change.
In current implemention, it is not consistent between real status and
the status we get by invoking nodedev interfaces.
So, this series of patches try to manually update devices' capabilities
each time before nodedev driver interfaces invoked.
Wu Zongyong (3):
v2->v3:
1. split a single patch to three part
2. fix memory leak and lock problems
3. update caps before invoking nodedev driver interfaces (refer to patch 3/3)
nodedev: add macro guard to node_device_udev header file
nodedev: update mdev_types caps before dumpxml
nodedev: update caps before invoking nodedev driver interfaces
src/node_device/node_device_driver.c | 55 +++++++++++++++++++++++++++++++
src/node_device/node_device_linux_sysfs.c | 22 +++++++++++++
src/node_device/node_device_udev.c | 37 +++++++++++++++++----
src/node_device/node_device_udev.h | 18 +++++++---
4 files changed, 121 insertions(+), 11 deletions(-)
--
1.9.1
6 years, 11 months