[libvirt] [PATCH] hostdev: Fix build with GCC's static analysis in mdev
by Martin Kletzander
Similarly to eec3b255d26e7b38bdb0830990569fd91aee661f, fix build with
lv_cv_static_analysis=yes.
Caused by a4a39d90ab4930750bcbcfccffdf6bb6d310b5d5
---
src/util/virhostdev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c
index 2c557f5bbc6b..998df5871539 100644
--- a/src/util/virhostdev.c
+++ b/src/util/virhostdev.c
@@ -2060,8 +2060,8 @@ virHostdevReAttachMediatedDevices(virHostdevManagerPtr mgr,
continue;
virMediatedDeviceGetUsedBy(tmp, &used_by_drvname, &used_by_domname);
- if (STREQ_NULLABLE(drv_name, used_by_drvname) &&
- STREQ_NULLABLE(dom_name, used_by_domname)) {
+ if (used_by_drvname && STREQ(drv_name, used_by_drvname) &&
+ used_by_domname && STREQ(dom_name, used_by_domname)) {
VIR_DEBUG("Removing %s dom=%s from activeMediatedHostdevs",
mdevsrc->uuidstr, dom_name);
virMediatedDeviceListDel(mgr->activeMediatedHostdevs, tmp);
--
2.12.1
7 years, 8 months
[libvirt] [PATCH] storage: Better describe logical pool creation/definition parameters
by John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=1398087
Clean up the virsh man page description for --pool-create-as in order
to better describe how the various arguments are used when creating
(or defining) a logical pool.
Also move the --print-xml to the end of the qualifiers since it's not
properly positionally situated for both --pool-create-as and --pool-define-as.
Finally modify the storage pool XML parsing algorithm to check for the
mismatched "name" and "source-name" as well as a more general if not
provided, then set the default source format.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
src/conf/storage_conf.c | 11 +++++++++++
tools/virsh.pod | 15 +++++++++++----
2 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index 6b34cea..6ca4949 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -703,6 +703,9 @@ virStoragePoolDefParseXML(xmlXPathContextPtr ctxt)
if (virStoragePoolDefParseSource(ctxt, &ret->source, ret->type,
source_node) < 0)
goto error;
+ } else {
+ if (options->formatFromString)
+ ret->source.format = options->defaultFormat;
}
ret->name = virXPathString("string(./name)", ctxt);
@@ -757,6 +760,14 @@ virStoragePoolDefParseXML(xmlXPathContextPtr ctxt)
if (VIR_STRDUP(ret->source.name, ret->name) < 0)
goto error;
}
+ if (ret->type == VIR_STORAGE_POOL_LOGICAL &&
+ STRNEQ(ret->name, ret->source.name)) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("for a logical pool, the pool name='%s' "
+ "must match the pool source name='%s'"),
+ ret->name, ret->source.name);
+ goto error;
+ }
}
if ((options->flags & VIR_STORAGE_POOL_SOURCE_ADAPTER) &&
diff --git a/tools/virsh.pod b/tools/virsh.pod
index ee79046..a1b4086 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -3572,13 +3572,13 @@ follow-up command to build the pool. The I<--overwrite> and
I<--no-overwrite> flags follow the same rules as B<pool-build>. If
just I<--build> is provided, then B<pool-build> is called with no flags.
-=item B<pool-create-as> I<name> I<type> [I<--print-xml>]
+=item B<pool-create-as> I<name> I<type>
[I<--source-host hostname>] [I<--source-path path>] [I<--source-dev path>]
[I<--source-name name>] [I<--target path>] [I<--source-format format>]
[I<--auth-type authtype> I<--auth-username username> I<--secret-usage usage>]
[[I<--adapter-name name>] | [I<--adapter-wwnn> I<--adapter-wwpn>]
[I<--adapter-parent parent>]]
-[I<--build>] [[I<--overwrite>] | [I<--no-overwrite>]]
+[I<--build>] [[I<--overwrite>] | [I<--no-overwrite>]] [I<--print-xml>]
Create and start a pool object I<name> from the raw parameters. If
@@ -3628,17 +3628,24 @@ follow-up command to build the pool. The I<--overwrite> and
I<--no-overwrite> flags follow the same rules as B<pool-build>. If
just I<--build> is provided, then B<pool-build> is called with no flags.
+For a "logical" pool only [I<--name>] needs to be provided. The [I<--name>]
+must match the Volume Group name for which the pool is being defined or
+created. The [I<--source-name>] if provided must match the Volume Group
+name. If not provided, one will be generated using the [I<--name>]. If
+provided the [I<--target>] is ignored and a target source is generated
+using the [I<--source-name>] (or as generated from the [I<--name>]).
+
=item B<pool-define> I<file>
Define an inactive persistent storage pool or modify an existing persistent one
from the XML I<file>.
-=item B<pool-define-as> I<name> I<type> [I<--print-xml>]
+=item B<pool-define-as> I<name> I<type>
[I<--source-host hostname>] [I<--source-path path>] [I<--source-dev path>]
[I<--source-name name>] [I<--target path>] [I<--source-format format>]
[I<--auth-type authtype> I<--auth-username username> I<--secret-usage usage>]
[[I<--adapter-name name>] | [I<--adapter-wwnn> I<--adapter-wwpn>]
-[I<--adapter-parent parent>]]
+[I<--adapter-parent parent>]] [I<--print-xml>]
Create, but do not start, a pool object I<name> from the raw parameters. If
I<--print-xml> is specified, then print the XML of the pool object
--
2.9.3
7 years, 8 months
[libvirt] [PATCH] news: Move recent bug fixes into 3.2.0 release
by Jiri Denemark
Commits 29f7b5ea6a and 5edf9aaf54 pushed them incorrectly at the end of
the file in the bug fixes section for libvirt 2.5.0.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
Pushed as trivial.
docs/news.xml | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/docs/news.xml b/docs/news.xml
index 494c6489b..85a1d4d97 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -120,7 +120,17 @@
zero out pages for qemu. The timeout is now flexible and computed by
libvirt at domain startup.
</description>
- </change>
+ </change>
+ <change>
+ <summary>
+ Overwrite (clear) 2 KB instead of just 512 bytes when initializing logical device
+ </summary>
+ </change>
+ <change>
+ <summary>
+ Describe the logical backend requirements better for pool-create-as
+ </summary>
+ </change>
</section>
</release>
<release version="v3.1.0" date="2017-03-03">
@@ -704,16 +714,6 @@
Fix compilation on macOS
</summary>
</change>
- <change>
- <summary>
- Overwrite (clear) 2 KB instead of just 512 bytes when initializing logical device
- </summary>
- </change>
- <change>
- <summary>
- Describe the logical backend requirements better for pool-create-as
- </summary>
- </change>
</section>
</release>
</libvirt>
--
2.12.0
7 years, 8 months
[libvirt] [PATCH 0/2] build: Fix build on mingw
by Martin Kletzander
Fixes pushed under build-breaker rule.
Martin Kletzander (2):
Use stub for virNetDevGetName on mingw
Build vircaps2xmltest and requirements only on Linux
configure.ac | 7 ++++---
src/util/virnetdev.c | 10 ++++++++++
tests/Makefile.am | 17 ++++++++++-------
tests/vircaps2xmltest.c | 16 ++--------------
4 files changed, 26 insertions(+), 24 deletions(-)
--
2.12.2
7 years, 8 months
[libvirt] [PATCH 0/4] Start refactoring migration cookies
by Jiri Denemark
This series is a first step in refactoring migration cookies. The rest
will take some time until it's done, but I figured the part which moves
the code is very fragile and I don't really want to keep rebasing it
until the refactoring is finished.
Jiri Denemark (4):
qemu: Move migration cookies to a separate file
qemu: Fix formatting in qemu_migration_cookie.c
qemu: Typedef migration cookie enums
qemu: Free persistent def inside qemuMigrationCookieFree
po/POTFILES.in | 1 +
src/Makefile.am | 1 +
src/qemu/qemu_migration.c | 1425 +-------------------------------------
src/qemu/qemu_migration_cookie.c | 1348 ++++++++++++++++++++++++++++++++++++
src/qemu/qemu_migration_cookie.h | 153 ++++
5 files changed, 1512 insertions(+), 1416 deletions(-)
create mode 100644 src/qemu/qemu_migration_cookie.c
create mode 100644 src/qemu/qemu_migration_cookie.h
--
2.12.1
7 years, 8 months
[libvirt] [PATCH] news: Add support for setting TSC frequency
by Jiri Denemark
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
docs/news.xml | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/docs/news.xml b/docs/news.xml
index a77279948..3f3821a16 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -72,6 +72,15 @@
introducing a new host device type in the XML.
</description>
</change>
+ <changes>
+ <summary>
+ qemu: Add support for setting TSC frequency
+ </summary>
+ <description>
+ Setting TSC frequency is required to enable migration for domains
+ with 'invtsc' CPU feature turned on.
+ </description>
+ </changes>
</section>
<section title="Improvements">
<change>
--
2.12.0
7 years, 8 months
[libvirt] [PATCH 0/4] qemu: Add support for setting TSC frequency to enable migration with invtsc
by Jiri Denemark
QEMU allows for TSC frequency to be explicitly set to enable migration
with invtsc (migration fails if the destination QEMU cannot set the
exact same frequency used when starting the domain on the source host).
Jiri Denemark (4):
conf: Fix XML parser for timer frequency
qemu: Add support for setting TSC frequency
qemu: Use virCPUCheckFeature in qemuMigrationIsAllowed
qemu: Allow migration with invtsc if tsc frequency is set
src/conf/domain_conf.c | 2 +-
src/qemu/qemu_command.c | 16 ++++++----
src/qemu/qemu_migration.c | 28 +++++++++++------
.../qemuxml2argv-cpu-tsc-frequency.args | 23 ++++++++++++++
.../qemuxml2argv-cpu-tsc-frequency.xml | 35 ++++++++++++++++++++++
tests/qemuxml2argvtest.c | 1 +
6 files changed, 89 insertions(+), 16 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-tsc-frequency.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-tsc-frequency.xml
--
2.12.1
7 years, 8 months
[libvirt] [PATCH v2] virmdev: fix build on non-Linux
by Roman Bogorodskiy
- Make virMediatedDeviceNew() stub args match its prototype
- Fix typo: virRerportError -> virReportError
- Move MDEV_SYSFS_DEVICES definition out of the #ifdef __linux__ block
so we don't have to stub virMediatedDeviceGetSysfsPath()
---
Changes from v1: instead of adding a stub for virMediatedDeviceGetSysfsPath(),
just unconditionally define MDEV_SYSFS_DEVICES as it makes things easier for
the tests.
src/util/virmdev.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/util/virmdev.c b/src/util/virmdev.c
index e924af3c1..2a1ade739 100644
--- a/src/util/virmdev.c
+++ b/src/util/virmdev.c
@@ -28,6 +28,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+#define MDEV_SYSFS_DEVICES "/sys/bus/mdev/devices/"
+
VIR_LOG_INIT("util.mdev");
struct _virMediatedDevice {
@@ -68,7 +70,6 @@ virMediatedOnceInit(void)
VIR_ONCE_GLOBAL_INIT(virMediated)
#ifdef __linux__
-# define MDEV_SYSFS_DEVICES "/sys/bus/mdev/devices/"
static int
virMediatedDeviceGetSysfsDeviceAPI(virMediatedDevicePtr dev,
@@ -173,12 +174,12 @@ virMediatedDeviceNew(const char *uuidstr, virMediatedDeviceModelType model)
#else
virMediatedDevicePtr
-virMediatedDeviceNew(virPCIDeviceAddressPtr pciaddr ATTRIBUTE_UNUSED,
- const char *uuidstr ATTRIBUTE_UNUSED)
+virMediatedDeviceNew(const char *uuidstr ATTRIBUTE_UNUSED,
+ virMediatedDeviceModelType model ATTRIBUTE_UNUSED)
{
- virRerportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("mediated devices are not supported on non-linux "
- "platforms"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("mediated devices are not supported on non-linux "
+ "platforms"));
return NULL;
}
--
2.11.0
7 years, 8 months
[libvirt] [PATCH] util: Fix build on FreeBSD
by Jiri Denemark
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
Pushed as a trivial build-braker.
src/util/virnetdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index 598d1c61a..486fe4cd1 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -316,7 +316,7 @@ virNetDevSetMACInternal(const char *ifname,
ret = 0;
cleanup:
- VIR_DEBUG("SIOCSIFLLADDR %s MAC=%s - %s", ifname, mac + 1),
+ VIR_DEBUG("SIOCSIFLLADDR %s MAC=%s - %s", ifname, mac + 1,
ret < 0 ? "Fail" : "Success");
VIR_FORCE_CLOSE(s);
--
2.12.0
7 years, 8 months