[libvirt] [PATCH 0/2] Fix issues getting voldef capacity value
by John Ferlan
Details in each patch - essentially trying to get "more correct" values.
John Ferlan (2):
storage: Fix virStorageBackendUpdateVolTargetInfo type check
storage: Allow probe of volume capacity for BLOCK type
src/storage/storage_backend.c | 12 ++++++++----
src/storage/storage_backend.h | 3 ++-
src/storage/storage_backend_fs.c | 3 ++-
3 files changed, 12 insertions(+), 6 deletions(-)
--
2.7.4
7 years, 11 months
[libvirt] [PATCH] nodedev: Fabric name must not be required for fc_host capability
by Boris Fiuczynski
fabric_name is one of many fc_host attributes in Linux that is optional
and left to the low-level driver to decide if it is implemented.
The zfcp device driver does not provide a fabric name for an fcp host.
This patch removes the requirement for a fabric name by making it optional.
Signed-off-by: Boris Fiuczynski <fiuczy(a)linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk(a)linux.vnet.ibm.com>
---
docs/formatnode.html.in | 2 +-
docs/schemas/nodedev.rng | 8 +++---
src/node_device/node_device_linux_sysfs.c | 3 +--
src/util/virutil.c | 4 +--
tests/fchostdata/fc_host/host7/node_name | 1 +
tests/fchostdata/fc_host/host7/port_name | 1 +
tests/fchostdata/fc_host/host7/port_state | 1 +
tests/fchosttest.c | 44 ++++++++++++++++++++++++++++---
8 files changed, 53 insertions(+), 11 deletions(-)
create mode 100644 tests/fchostdata/fc_host/host7/node_name
create mode 100644 tests/fchostdata/fc_host/host7/port_name
create mode 100644 tests/fchostdata/fc_host/host7/port_state
diff --git a/docs/formatnode.html.in b/docs/formatnode.html.in
index e7b1140..f8d0e12 100644
--- a/docs/formatnode.html.in
+++ b/docs/formatnode.html.in
@@ -254,7 +254,7 @@
number of vport in use. <code>max_vports</code> shows the
maximum vports the HBA supports. "fc_host" implies following
sub-elements: <code>wwnn</code>, <code>wwpn</code>, and
- <code>fabric_wwn</code>.
+ optionally <code>fabric_wwn</code>.
</dd>
</dl>
</dd>
diff --git a/docs/schemas/nodedev.rng b/docs/schemas/nodedev.rng
index 9c98402..b100a6e 100644
--- a/docs/schemas/nodedev.rng
+++ b/docs/schemas/nodedev.rng
@@ -367,9 +367,11 @@
<ref name='wwn'/>
</element>
- <element name='fabric_wwn'>
- <ref name='wwn'/>
- </element>
+ <optional>
+ <element name='fabric_wwn'>
+ <ref name='wwn'/>
+ </element>
+ </optional>
</define>
<define name='capsvports'>
diff --git a/src/node_device/node_device_linux_sysfs.c b/src/node_device/node_device_linux_sysfs.c
index be99c41..e043744 100644
--- a/src/node_device/node_device_linux_sysfs.c
+++ b/src/node_device/node_device_linux_sysfs.c
@@ -73,9 +73,8 @@ nodeDeviceSysfsGetSCSIHostCaps(virNodeDevCapDataPtr d)
VIR_STEAL_PTR(d->scsi_host.wwnn, tmp);
if (!(tmp = virReadFCHost(NULL, d->scsi_host.host, "fabric_name"))) {
- VIR_WARN("Failed to read fabric WWN for host%d",
+ VIR_INFO("Optional fabric WWN for host%d not available",
d->scsi_host.host);
- goto cleanup;
}
VIR_FREE(d->scsi_host.fabric_wwn);
VIR_STEAL_PTR(d->scsi_host.fabric_wwn, tmp);
diff --git a/src/util/virutil.c b/src/util/virutil.c
index aeaa7f9..ab61302 100644
--- a/src/util/virutil.c
+++ b/src/util/virutil.c
@@ -2011,7 +2011,7 @@ virGetSCSIHostNameByParentaddr(unsigned int domain,
*
* Read the value of sysfs "fc_host" entry.
*
- * Returns result as a stringon success, caller must free @result after
+ * Returns result as a string on success, caller must free @result after
* Otherwise returns NULL.
*/
char *
@@ -2029,7 +2029,7 @@ virReadFCHost(const char *sysfs_prefix,
host, entry) < 0)
goto cleanup;
- if (virFileReadAll(sysfs_path, 1024, &buf) < 0)
+ if (virFileReadAllQuiet(sysfs_path, 1024, &buf) < 0)
goto cleanup;
if ((p = strchr(buf, '\n')))
diff --git a/tests/fchostdata/fc_host/host7/node_name b/tests/fchostdata/fc_host/host7/node_name
new file mode 100644
index 0000000..73a91bd
--- /dev/null
+++ b/tests/fchostdata/fc_host/host7/node_name
@@ -0,0 +1 @@
+0x2002001b32a9da4e
diff --git a/tests/fchostdata/fc_host/host7/port_name b/tests/fchostdata/fc_host/host7/port_name
new file mode 100644
index 0000000..f25abeb
--- /dev/null
+++ b/tests/fchostdata/fc_host/host7/port_name
@@ -0,0 +1 @@
+0x2102001b32a9da4e
diff --git a/tests/fchostdata/fc_host/host7/port_state b/tests/fchostdata/fc_host/host7/port_state
new file mode 100644
index 0000000..b73dd46
--- /dev/null
+++ b/tests/fchostdata/fc_host/host7/port_state
@@ -0,0 +1 @@
+Online
diff --git a/tests/fchosttest.c b/tests/fchosttest.c
index a08a2e8..ba580aa 100644
--- a/tests/fchosttest.c
+++ b/tests/fchosttest.c
@@ -29,13 +29,16 @@ static char *fchost_prefix;
#define TEST_FC_HOST_PREFIX fchost_prefix
#define TEST_FC_HOST_NUM 5
+#define TEST_FC_HOST_NUM_NO_FAB 7
/* Test virIsCapableFCHost */
static int
test1(const void *data ATTRIBUTE_UNUSED)
{
if (virIsCapableFCHost(TEST_FC_HOST_PREFIX,
- TEST_FC_HOST_NUM))
+ TEST_FC_HOST_NUM) &&
+ virIsCapableFCHost(TEST_FC_HOST_PREFIX,
+ TEST_FC_HOST_NUM_NO_FAB))
return 0;
return -1;
@@ -106,10 +109,43 @@ test3(const void *data ATTRIBUTE_UNUSED)
return ret;
}
-/* Test virGetFCHostNameByWWN */
+/* Test virReadFCHost fabric name optional */
static int
test4(const void *data ATTRIBUTE_UNUSED)
{
+ const char *expect_wwnn = "2002001b32a9da4e";
+ const char *expect_wwpn = "2102001b32a9da4e";
+ char *wwnn = NULL;
+ char *wwpn = NULL;
+ int ret = -1;
+
+ if (!(wwnn = virReadFCHost(TEST_FC_HOST_PREFIX, TEST_FC_HOST_NUM_NO_FAB,
+ "node_name")))
+ return -1;
+
+ if (!(wwpn = virReadFCHost(TEST_FC_HOST_PREFIX, TEST_FC_HOST_NUM_NO_FAB,
+ "port_name")))
+ goto cleanup;
+
+ if (virReadFCHost(TEST_FC_HOST_PREFIX, TEST_FC_HOST_NUM_NO_FAB,
+ "fabric_name"))
+ goto cleanup;
+
+ if (STRNEQ(expect_wwnn, wwnn) ||
+ STRNEQ(expect_wwpn, wwpn))
+ goto cleanup;
+
+ ret = 0;
+ cleanup:
+ VIR_FREE(wwnn);
+ VIR_FREE(wwpn);
+ return ret;
+}
+
+/* Test virGetFCHostNameByWWN */
+static int
+test5(const void *data ATTRIBUTE_UNUSED)
+{
const char *expect_hostname = "host5";
char *hostname = NULL;
int ret = -1;
@@ -130,7 +166,7 @@ test4(const void *data ATTRIBUTE_UNUSED)
/* Test virFindFCHostCapableVport (host4 is not Online) */
static int
-test5(const void *data ATTRIBUTE_UNUSED)
+test6(const void *data ATTRIBUTE_UNUSED)
{
const char *expect_hostname = "host5";
char *hostname = NULL;
@@ -169,6 +205,8 @@ mymain(void)
ret = -1;
if (virTestRun("test5", test5, NULL) < 0)
ret = -1;
+ if (virTestRun("test6", test6, NULL) < 0)
+ ret = -1;
cleanup:
VIR_FREE(fchost_prefix);
--
2.5.5
7 years, 11 months
[libvirt] [PATCH] disk: Fixup error handling path for devmapper when part_separator='yes'
by John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=1346566
If libvirt_parthelper is erroneously told to append the partition
separator 'p' onto the generated output for a disk pool using device
mapper that has 'user_friendly_names' set to true, then the error
recovery path will fail to find volume resulting in the pool being
in an unusable state.
So, augment the documentation to provide the better hint that the
part_separator='yes' should be set when user_friendly_names are not
being used. Additionally, once we're in the error path where the
returned name doesn't match the expected partition name try to see
if the reason is because the 'p' was erroneosly added. If so alter
the about to be removed vol->target.path so that the DiskDeleteVol
code can find the partition that was created and remove it.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
docs/formatstorage.html.in | 5 ++++-
src/storage/storage_backend_disk.c | 23 +++++++++++++++++++++++
2 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/docs/formatstorage.html.in b/docs/formatstorage.html.in
index ed1f0d1..7690114 100644
--- a/docs/formatstorage.html.in
+++ b/docs/formatstorage.html.in
@@ -138,7 +138,10 @@
causes libvirt to attempt to generate and find target volume path's
using a "p" separator. The default algorithm used by device mapper
is to add the "p" separator only when the source device path ends
- with a number.
+ with a number; however, it's possible to configure the devmapper
+ device to not use 'user_friendly_names' thus creating partitions
+ with the "p" separator even when the device source path does not
+ end with a number.
<span class="since">Since 1.3.1</span></p></dd>
<dt><code>dir</code></dt>
<dd>Provides the source for pools backed by directories (pool
diff --git a/src/storage/storage_backend_disk.c b/src/storage/storage_backend_disk.c
index 666ad03..07a04f1 100644
--- a/src/storage/storage_backend_disk.c
+++ b/src/storage/storage_backend_disk.c
@@ -95,6 +95,29 @@ virStorageBackendDiskMakeDataVol(virStoragePoolObjPtr pool,
virReportError(VIR_ERR_INVALID_ARG,
_("invalid partition name '%s', expected '%s'"),
vol->name, partname);
+
+ /* Let's see if we by chance parthelper created a name that won't be
+ * found later when we try to delete. We tell parthelper to add a 'p'
+ * to the output via the part_separator flag, but if devmapper has
+ * user_friendly_names set, the creation won't happen that way, thus
+ * our deletion will fail because the name we generated is wrong.
+ * Check for our conditions and see if the generated name is the
+ * same as StablePath returns and has the 'p' in it */
+ if (pool->def->source.devices[0].part_separator ==
+ VIR_TRISTATE_BOOL_YES &&
+ !virIsDevMapperDevice(vol->target.path) &&
+ STREQ(groups[0], vol->target.path) &&
+ (tmp = strrchr(groups[0], 'p'))) {
+
+ /* If we remove the 'p' from groups[0] and the resulting
+ * device is a devmapper device, then we know parthelper
+ * was told to create the wrong name based on the results.
+ * So just remove the 'p' from the vol->target.path too. */
+ memmove(tmp, tmp + 1, strlen(tmp));
+ if (virIsDevMapperDevice(groups[0]) &&
+ (tmp = strrchr(vol->target.path, 'p')))
+ memmove(tmp, tmp + 1, strlen(tmp));
+ }
return -1;
}
--
2.7.4
7 years, 11 months
[libvirt] [PATCH] docs: Document <sndbuf/>
by Michal Privoznik
This element has been introduced in fe053dbea7, but isn't
documented yet. After exactly 6 years I guess we can finally
document it.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
docs/formatdomain.html.in | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 39f5a8823..30cb19626 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -4975,6 +4975,9 @@ qemu-kvm -net nic,model=? /dev/null
<model type='virtio'/>
<b><backend tap='/dev/net/tun' vhost='/dev/vhost-net'/></b>
<driver name='vhost' txmode='iothread' ioeventfd='on' event_idx='off' queues='5'/>
+ <b><tune>
+ <sndbuf>1600</sndbuf>
+ </tune></b>
</interface>
</devices>
...</pre>
@@ -4985,7 +4988,12 @@ qemu-kvm -net nic,model=? /dev/null
device path (<code>/dev/vhost-net</code>) for devices with <code>virtio</code> model.
The <code>tap</code> attribute overrides the tun/tap device path (default:
<code>/dev/net/tun</code>) for network and bridge interfaces. This does not work
- in session mode.
+ in session mode. <span class="since">Since 1.2.9</span>
+ </p>
+ <p>
+ For tap devices there is also <code>sndbuf</code> element which can
+ adjust the size of send buffer in the host. <span class="since">Since
+ 0.8.8</span>
</p>
<h5><a name="elementsNICSTargetOverride">Overriding the target element</a></h5>
--
2.11.0
7 years, 11 months
[libvirt] [PATCH v2 00/11] tests: qemu: Add cpu hotplug testing
by Peter Krempa
This is a repost of
https://www.redhat.com/archives/libvir-list/2016-December/msg00420.html
after a recent rebase conflict.
Add some useful monitor infrastructure to simplify testing and add testing for
the cpu hotplug code. The code has some complex logic which was not covered
by current test suite.
Peter Krempa (11):
qemu: monitor: More strict checking of 'query-cpus' if hotplug is
supported
util: json: Add helper to reformat JSON strings
tests: qemu: Document qemuMonitorTestNewFromFile
qemu: Prepare for reuse of qemuDomainSetVcpusLive
qemu: Move cpu hotplug code into qemu_hotplug.c
tests: qemumonitor: Propagate better error messages
tests: qemu: monitor: Add helpers to test full command syntax
tests: qemu: Add helper to load full monitor conversation from file
tests: hotplug: Add test infrastructure for testing qemu CPU hotplug
code
tests: hotplug: Add test data for legacy cpu hotplug
tests: hotplug: Test CPU hotplug with ppc64 data
src/libvirt_private.syms | 1 +
src/qemu/qemu_driver.c | 328 ------------
src/qemu/qemu_hotplug.c | 339 ++++++++++++
src/qemu/qemu_hotplug.h | 7 +
src/qemu/qemu_monitor.c | 6 +-
src/qemu/qemu_monitor_json.c | 6 +-
src/qemu/qemu_monitor_json.h | 3 +-
src/util/virjson.c | 29 +
src/util/virjson.h | 2 +
tests/qemuagenttest.c | 3 +-
tests/qemuhotplugtest.c | 194 +++++++
tests/qemuhotplugtestcpus/ppc64-bulk-domain.xml | 20 +
tests/qemuhotplugtestcpus/ppc64-bulk-monitor.json | 593 +++++++++++++++++++++
.../qemuhotplugtestcpus/ppc64-bulk-result-conf.xml | 64 +++
.../qemuhotplugtestcpus/ppc64-bulk-result-live.xml | 72 +++
.../qemuhotplugtestcpus/x86-modern-bulk-domain.xml | 21 +
.../x86-modern-bulk-monitor.json | 471 ++++++++++++++++
.../x86-modern-bulk-result-conf.xml | 40 ++
.../x86-modern-bulk-result-live.xml | 48 ++
tests/qemuhotplugtestcpus/x86-old-bulk-domain.xml | 21 +
.../qemuhotplugtestcpus/x86-old-bulk-monitor.json | 193 +++++++
.../x86-old-bulk-result-conf.xml | 30 ++
.../x86-old-bulk-result-live.xml | 38 ++
tests/qemumonitorjsontest.c | 2 +-
tests/qemumonitortestutils.c | 322 ++++++++++-
tests/qemumonitortestutils.h | 12 +-
26 files changed, 2516 insertions(+), 349 deletions(-)
create mode 100644 tests/qemuhotplugtestcpus/ppc64-bulk-domain.xml
create mode 100644 tests/qemuhotplugtestcpus/ppc64-bulk-monitor.json
create mode 100644 tests/qemuhotplugtestcpus/ppc64-bulk-result-conf.xml
create mode 100644 tests/qemuhotplugtestcpus/ppc64-bulk-result-live.xml
create mode 100644 tests/qemuhotplugtestcpus/x86-modern-bulk-domain.xml
create mode 100644 tests/qemuhotplugtestcpus/x86-modern-bulk-monitor.json
create mode 100644 tests/qemuhotplugtestcpus/x86-modern-bulk-result-conf.xml
create mode 100644 tests/qemuhotplugtestcpus/x86-modern-bulk-result-live.xml
create mode 100644 tests/qemuhotplugtestcpus/x86-old-bulk-domain.xml
create mode 100644 tests/qemuhotplugtestcpus/x86-old-bulk-monitor.json
create mode 100644 tests/qemuhotplugtestcpus/x86-old-bulk-result-conf.xml
create mode 100644 tests/qemuhotplugtestcpus/x86-old-bulk-result-live.xml
--
2.11.0
7 years, 11 months
[libvirt] [PATCH] news: document libxl HVM network attach fix
by Joao Martins
Signed-off-by: Joao Martins <joao.m.martins(a)oracle.com>
---
docs/news.xml | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/docs/news.xml b/docs/news.xml
index 92e39f9..c19bbbb 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -204,6 +204,16 @@
domain definition.
</description>
</change>
+ <change>
+ <summary>
+ libxl: reverse defaults on HVM net device attach
+ </summary>
+ <description>
+ Fixes network interface attach for HVM domains when no model is
+ specified. Emulated hotplug isn't yet supported and hence we should
+ default to the general working scenario.
+ </description>
+ </change>
</section>
</release>
<release version="v2.5.0" date="2016-12-04">
--
2.1.4
7 years, 11 months
[libvirt] [PATCH 0/5] Use non-blacklisted family/model/stepping for Haswell CPU model
by Eduardo Habkost
A recent glibc commit[1] added a blacklist to ensure it won't use
TSX on hosts that are known to have a broken TSX implementation.
Our existing Haswell CPU model has a blacklisted
family/model/stepping combination, so it has to be updated to
make sure guests will really use TSX. This is done by patch 5/5.
However, to do this safely we need to ensure the host CPU is not
a blacklisted one, so we won't mislead guests by exposing
known-to-be-good FMS values on a known-to-be-broken host. This is
done by patch 3/5.
[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=2702856bf45c82cf8e69f2...
---
Cc: dgilbert(a)redhat.com
Cc: fweimer(a)redhat.com
Cc: carlos(a)redhat.com
Cc: triegel(a)redhat.com
Cc: berrange(a)redhat.com
Cc: jdenemar(a)redhat.com
Cc: pbonzini(a)redhat.com
Eduardo Habkost (5):
i386: Add explicit array size to x86_cpu_vendor_words2str()
i386: host_vendor_fms() helper function
i386/kvm: Blacklist TSX on known broken hosts
pc: Add 2.9 machine-types
i386: Change stepping of Haswell to non-blacklisted value
include/hw/i386/pc.h | 6 ++++++
target/i386/cpu.h | 1 +
hw/i386/pc_piix.c | 15 ++++++++++++---
hw/i386/pc_q35.c | 13 +++++++++++--
target/i386/cpu.c | 32 ++++++++++++++++++++++----------
target/i386/kvm.c | 17 +++++++++++++++++
6 files changed, 69 insertions(+), 15 deletions(-)
--
2.11.0.259.g40922b1
7 years, 11 months
Re: [libvirt] "[V3] RFC for support cache tune in libvirt"
by Marcelo Tosatti
Hi,
Comments/questions related to:
https://www.redhat.com/archives/libvir-list/2017-January/msg00354.html
1) root s2600wt:~/linux# virsh cachetune kvm02 --l3.count 2
How does allocation of code/data look like?
2) 'nodecachestats' command:
3. Add new virsh command 'nodecachestats':
This API is to expose vary cache resouce left on each hardware (cpu
socket).
It will be formated as:
<resource_type>.<resource_id>: left size KiB
Does this take into account that only contiguous regions of cbm masks
can be used for allocations?
Also, it should return the amount of free cache on each cacheid.
3) The interface should support different sizes for different
cache-ids. See the KVM-RT use case at
https://www.redhat.com/archives/libvir-list/2017-January/msg00415.html
"WHAT THE USER NEEDS TO SPECIFY FOR VIRTUALIZATION (KVM-RT)".
4) Usefulness of exposing minimum unit size.
Rather than specify unit sizes (which forces the user
to convert every time the command is executed), why not specify
in kbytes and round up?
<resctrl name='L3' unit='KiB' cache_size='56320'
cache_unit='2816'/>
As noted in item 1 of
https://www.redhat.com/archives/libvir-list/2017-January/msg00494.html,
"1) Convertion of kbytes (user specification) --> number of CBM bits
for host.",
the format where the size is stored is kbytes, so its awkward
to force users and OpenStack to perform the convertion themselves
(and zero benefits... nothing changes if you know the unit size).
Thanks!
7 years, 11 months
[libvirt] [PATCH] news: document drive addresses fix
by Marc Hartmayer
Signed-off-by: Marc Hartmayer <mhartmay(a)linux.vnet.ibm.com>
---
docs/news.xml | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/docs/news.xml b/docs/news.xml
index 8175fd0..92e39f9 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -195,6 +195,15 @@
separate path which is also correctly labeled.
</description>
</change>
+ <change>
+ <summary>
+ conf: Reject domains with duplicate drive addresses
+ </summary>
+ <description>
+ Reject duplicate drive addresses for disks and hostdevs at
+ domain definition.
+ </description>
+ </change>
</section>
</release>
<release version="v2.5.0" date="2016-12-04">
--
2.5.5
7 years, 11 months
[libvirt] [PATCH] news: document events changes and lxc fix
by Daniel P. Berrange
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
docs/news.xml | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/docs/news.xml b/docs/news.xml
index 300e553..23ff40f 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -14,6 +14,25 @@
<section title="New features">
<change>
<summary>
+ Domain events for metadata content changes
+ </summary>
+ <description>
+ The domain events framework has a new event ID that can
+ be used to get notifications when domain metadata content
+ changes.
+ </description>
+ </change>
+ <change>
+ <summary>
+ Event notifications for the secret object
+ </summary>
+ <description>
+ The secret object now supports event notifications, covering
+ lifcycle changes and secret value changes.
+ </description>
+ </change>
+ <change>
+ <summary>
New localPtr attribute for "ip" element in network XML
</summary>
</change>
@@ -67,6 +86,17 @@
<section title="Improvements">
<change>
<summary>
+ lxc: fix accidental killing of containers during libvirtd restart
+ </summary>
+ <description>
+ The libvirt_lxc process was previously not moved into the
+ container scope. As a result, if systemd reloads its config
+ after a container is started, when libvirtd is later restarted
+ it will accidentally kill the containers.
+ </description>
+ </change>
+ <change>
+ <summary>
perf: Add more perf statistics
</summary>
<description>
--
2.9.3
7 years, 11 months