[libvirt] [PATCH v4] qemu: Introduce state_lock_timeout to qemu.conf
by Yi Wang
When doing some job holding state lock for a long time,
we may come across error:
"Timed out during operation: cannot acquire state change lock"
Well, sometimes it's not a problem and users wanner continue
to wait, and this patch allow users decide how long time they
can wait the state lock.
Signed-off-by: Yi Wang <wang.yi59(a)zte.com.cn>
Reviewed-by: Xi Xu <xu.xi8(a)zte.com.cn>
---
changes in v4:
- fox syntax-check error
changes in v3:
- add user-friendly description and nb of state lock
- check validity of stateLockTimeout
changes in v2:
- change default value to 30 in qemu.conf
- set the default value in virQEMUDriverConfigNew()
v4
Signed-off-by: Yi Wang <wang.yi59(a)zte.com.cn>
---
src/qemu/libvirtd_qemu.aug | 1 +
src/qemu/qemu.conf | 10 ++++++++++
src/qemu/qemu_conf.c | 14 ++++++++++++++
src/qemu/qemu_conf.h | 2 ++
src/qemu/qemu_domain.c | 5 +----
src/qemu/test_libvirtd_qemu.aug.in | 1 +
6 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/src/qemu/libvirtd_qemu.aug b/src/qemu/libvirtd_qemu.aug
index ddc4bbf..f7287ae 100644
--- a/src/qemu/libvirtd_qemu.aug
+++ b/src/qemu/libvirtd_qemu.aug
@@ -93,6 +93,7 @@ module Libvirtd_qemu =
| limits_entry "max_core"
| bool_entry "dump_guest_core"
| str_entry "stdio_handler"
+ | int_entry "state_lock_timeout"
let device_entry = bool_entry "mac_filter"
| bool_entry "relaxed_acs_check"
diff --git a/src/qemu/qemu.conf b/src/qemu/qemu.conf
index cd57b3c..8920a1a 100644
--- a/src/qemu/qemu.conf
+++ b/src/qemu/qemu.conf
@@ -667,6 +667,16 @@
#
#max_queued = 0
+
+# When two or more threads want to work with the same domain they use a
+# job lock to mutually exclude each other. However, waiting for the lock
+# is limited up to state_lock_timeout seconds.
+# NB, strong recommendation to set the timeout longer than 30 seconds.
+#
+# Default is 30
+#
+#state_lock_timeout = 60
+
###################################################################
# Keepalive protocol:
# This allows qemu driver to detect broken connections to remote
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index a4f545e..c761cae 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -129,6 +129,9 @@ void qemuDomainCmdlineDefFree(qemuDomainCmdlineDefPtr def)
#endif
+/* Give up waiting for mutex after 30 seconds */
+#define QEMU_JOB_WAIT_TIME (1000ull * 30)
+
virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged)
{
virQEMUDriverConfigPtr cfg;
@@ -346,6 +349,8 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged)
cfg->glusterDebugLevel = 4;
cfg->stdioLogD = true;
+ cfg->stateLockTimeout = QEMU_JOB_WAIT_TIME;
+
if (!(cfg->namespaces = virBitmapNew(QEMU_DOMAIN_NS_LAST)))
goto error;
@@ -863,6 +868,9 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
if (virConfGetValueUInt(conf, "keepalive_count", &cfg->keepAliveCount) < 0)
goto cleanup;
+ if (virConfGetValueInt(conf, "state_lock_timeout", &cfg->stateLockTimeout) < 0)
+ goto cleanup;
+
if (virConfGetValueInt(conf, "seccomp_sandbox", &cfg->seccompSandbox) < 0)
goto cleanup;
@@ -1055,6 +1063,12 @@ virQEMUDriverConfigValidate(virQEMUDriverConfigPtr cfg)
return -1;
}
+ if (cfg->stateLockTimeout <= 0) {
+ virReportError(VIR_ERR_CONF_SYNTAX, "%s",
+ _("state_lock_timeout should larger than zero"));
+ return -1;
+ }
+
return 0;
}
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index a8d84ef..97cf2e1 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -190,6 +190,8 @@ struct _virQEMUDriverConfig {
int keepAliveInterval;
unsigned int keepAliveCount;
+ int stateLockTimeout;
+
int seccompSandbox;
char *migrateHost;
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 886e3fb..5a2ca52 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -6652,9 +6652,6 @@ qemuDomainObjCanSetJob(qemuDomainObjPrivatePtr priv,
priv->job.agentActive == QEMU_AGENT_JOB_NONE));
}
-/* Give up waiting for mutex after 30 seconds */
-#define QEMU_JOB_WAIT_TIME (1000ull * 30)
-
/**
* qemuDomainObjBeginJobInternal:
* @driver: qemu driver
@@ -6714,7 +6711,7 @@ qemuDomainObjBeginJobInternal(virQEMUDriverPtr driver,
}
priv->jobs_queued++;
- then = now + QEMU_JOB_WAIT_TIME;
+ then = now + cfg->stateLockTimeout;
retry:
if ((!async && job != QEMU_JOB_DESTROY) &&
diff --git a/src/qemu/test_libvirtd_qemu.aug.in b/src/qemu/test_libvirtd_qemu.aug.in
index f1e8806..dc5de96 100644
--- a/src/qemu/test_libvirtd_qemu.aug.in
+++ b/src/qemu/test_libvirtd_qemu.aug.in
@@ -105,3 +105,4 @@ module Test_libvirtd_qemu =
{ "pr_helper" = "/usr/bin/qemu-pr-helper" }
{ "swtpm_user" = "tss" }
{ "swtpm_group" = "tss" }
+{ "state_lock_timeout" = "60" }
--
1.8.3.1
6 years, 3 months
Re: [libvirt] [PATCH] qga: ignore non present cpus when handling qmp_guest_get_vcpus()
by Igor Mammedov
On Thu, 30 Aug 2018 17:51:13 +0200
Laszlo Ersek <lersek(a)redhat.com> wrote:
> +Drew
>
> On 08/30/18 14:08, Igor Mammedov wrote:
> > If VM has VCPUs plugged sparselly (for example a VM started with
> > 3 VCPUs (cpu0, cpu1 and cpu2) and then cpu1 was hotunplugged so
> > only cpu0 and cpu2 are present), QGA will rise a error
> > error: internal error: unable to execute QEMU agent command 'guest-get-vcpus':
> > open("/sys/devices/system/cpu/cpu1/"): No such file or directory
> > when
> > virsh vcpucount FOO --guest
> > is executed.
> > Fix it by ignoring non present CPUs when fetching CPUs status from sysfs.
> >
> > Signed-off-by: Igor Mammedov <imammedo(a)redhat.com>
> > ---
> > qga/commands-posix.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/qga/commands-posix.c b/qga/commands-posix.c
> > index 37e8a2d..2929872 100644
> > --- a/qga/commands-posix.c
> > +++ b/qga/commands-posix.c
> > @@ -2044,7 +2044,9 @@ static void transfer_vcpu(GuestLogicalProcessor *vcpu, bool sys2vcpu,
> > vcpu->logical_id);
> > dirfd = open(dirpath, O_RDONLY | O_DIRECTORY);
> > if (dirfd == -1) {
> > - error_setg_errno(errp, errno, "open(\"%s\")", dirpath);
> > + if (!(sys2vcpu && errno == ENOENT)) {
> > + error_setg_errno(errp, errno, "open(\"%s\")", dirpath);
> > + }
> > } else {
> > static const char fn[] = "online";
> > int fd;
> >
>
> Originally these guest agent commands (both getting and setting) were
> meant to be used in the absence of real VCPU hot[un]plug, as a fallback
> / place-holder.
>
> If the latter (= real VCPU hot(un)plug) works, then these guest agent
> commands shouldn't be used at all.
Technically there isn't reasons for "get" not to work in sparse usecase
hence the patch.
> Drew, do I remember correctly? ... The related RHBZ is
> <https://bugzilla.redhat.com/show_bug.cgi?id=924684>. (It's a private
> one, and I'm not at liberty to open it up, so my apologies to non-RH folks.)
>
> Anyway, given that "set" should be a subset of the "get" return value
> (as documented in the command schema), if we fix up "get" to work with
> sparse topologies, then "set" should work at once.
>
> However... as far as I understand, this change will allow
> qmp_guest_get_vcpus() to produce a GuestLogicalProcessor object for the
> missing (hot-unplugged) VCPU, with the following contents:
> - @logical-id: populated by the loop,
> - @online: false (from g_malloc0()),
> - @can-offline: present (from the loop), and false (from g_malloc0()).
>
> The smaller problem with this might be that "online==false &&
> can-offline==false" is nonsensical and has never been returned before. I
> don't know how higher level apps will react.
>
> The larger problem might be that a higher level app could simply copy
> this output structure into the next "set" call unchanged, and then that
> "set" call will fail.
Libvirt it seems that survives such outrageous output
> I wonder if, instead of this patch, we should rework
> qmp_guest_get_vcpus(), to silently skip processors for which this
> dirpath ENOENT condition arises (i.e., return a shorter list of
> GuestLogicalProcessor objects).
> But, again, I wouldn't mix this guest agent command with real VCPU
> hot(un)plug in the first place. The latter is much-much better, so if
> it's available, use that exclusively?
Agreed,
Maybe we can block invalid usecase on libvirt side with a more clear
error message as libvirt sort of knows that sparse cpus are supported.
>
> Thanks,
> Laszlo
6 years, 3 months
[libvirt] [PATCH] docs: Typo fix in virDomainGetJobStats
by Eric Blake
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Pushing under the trivial rule.
src/libvirt-domain.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 63addbc470..8e91db31f6 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -8707,7 +8707,7 @@ virDomainGetJobInfo(virDomainPtr domain, virDomainJobInfoPtr info)
* return statistics about a recently completed job. Specifically, this
* flag may be used to query statistics of a completed incoming pre-copy
* migration (statistics for post-copy migration are only available on the
- * source hsot). Statistics of a completed job are automatically destroyed
+ * source host). Statistics of a completed job are automatically destroyed
* once read or when libvirtd is restarted. Note that time information
* returned for completed migrations may be completely irrelevant unless both
* source and destination hosts have synchronized time (i.e., NTP daemon is
--
2.17.1
6 years, 3 months
[libvirt] [jenkins-ci PATCH 0/3] Split off MinGW builds
by Andrea Bolognani
See patch 2/3 for the rationale.
Andrea Bolognani (3):
guests: Split MinGW projects
Split off MinGW builds
Remove 'variant'
.../host_vars/libvirt-fedora-rawhide/main.yml | 15 ++++++++-----
.../build/jobs/autotools-build-job.yml | 4 ++--
.../build/jobs/autotools-check-job.yml | 4 ++--
.../build/jobs/autotools-rpm-job.yml | 4 ++--
.../build/jobs/autotools-syntax-check-job.yml | 4 ++--
guests/playbooks/build/jobs/defaults.yml | 1 -
.../build/jobs/generic-build-job.yml | 4 ++--
.../build/jobs/generic-check-job.yml | 4 ++--
.../playbooks/build/jobs/generic-rpm-job.yml | 4 ++--
.../build/jobs/generic-syntax-check-job.yml | 4 ++--
guests/playbooks/build/jobs/go-build-job.yml | 4 ++--
guests/playbooks/build/jobs/go-check-job.yml | 4 ++--
.../build/jobs/perl-modulebuild-build-job.yml | 4 ++--
.../build/jobs/perl-modulebuild-check-job.yml | 4 ++--
.../build/jobs/perl-modulebuild-rpm-job.yml | 4 ++--
guests/playbooks/build/jobs/prepare.yml | 8 +++----
.../build/jobs/python-distutils-build-job.yml | 4 ++--
.../build/jobs/python-distutils-check-job.yml | 4 ++--
.../build/jobs/python-distutils-rpm-job.yml | 4 ++--
.../build/projects/libosinfo+mingw32.yml | 12 ++++++++++
.../build/projects/libosinfo+mingw64.yml | 12 ++++++++++
guests/playbooks/build/projects/libosinfo.yml | 22 -------------------
.../build/projects/libvirt+mingw32.yml | 12 ++++++++++
.../build/projects/libvirt+mingw64.yml | 12 ++++++++++
.../build/projects/libvirt-glib+mingw32.yml | 12 ++++++++++
.../build/projects/libvirt-glib+mingw64.yml | 12 ++++++++++
.../playbooks/build/projects/libvirt-glib.yml | 22 -------------------
guests/playbooks/build/projects/libvirt.yml | 22 -------------------
.../projects/osinfo-db-tools+mingw32.yml | 12 ++++++++++
.../projects/osinfo-db-tools+mingw64.yml | 13 +++++++++++
.../build/projects/osinfo-db-tools.yml | 22 -------------------
.../build/projects/virt-viewer+mingw32.yml | 12 ++++++++++
.../build/projects/virt-viewer+mingw64.yml | 12 ++++++++++
.../playbooks/build/projects/virt-viewer.yml | 22 -------------------
...osinfo+mingw.yml => libosinfo+mingw32.yml} | 4 ----
...osinfo+mingw.yml => libosinfo+mingw64.yml} | 4 ----
...{libvirt+mingw.yml => libvirt+mingw32.yml} | 12 ----------
...{libvirt+mingw.yml => libvirt+mingw64.yml} | 12 ----------
...lib+mingw.yml => libvirt-glib+mingw32.yml} | 2 --
...lib+mingw.yml => libvirt-glib+mingw64.yml} | 2 --
...+mingw.yml => osinfo-db-tools+mingw32.yml} | 4 ----
...+mingw.yml => osinfo-db-tools+mingw64.yml} | 4 ++--
...ewer+mingw.yml => virt-viewer+mingw32.yml} | 11 ----------
...ewer+mingw.yml => virt-viewer+mingw64.yml} | 11 ----------
jobs/autotools.yaml | 16 +++++++-------
jobs/defaults.yaml | 1 -
jobs/generic.yaml | 16 +++++++-------
jobs/go.yaml | 8 +++----
jobs/perl-modulebuild.yaml | 12 +++++-----
jobs/python-distutils.yaml | 12 +++++-----
projects/libosinfo+mingw32.yaml | 12 ++++++++++
projects/libosinfo+mingw64.yaml | 12 ++++++++++
projects/libosinfo.yaml | 12 ----------
projects/libvirt+mingw32.yaml | 12 ++++++++++
projects/libvirt+mingw64.yaml | 12 ++++++++++
projects/libvirt-glib+mingw32.yaml | 12 ++++++++++
projects/libvirt-glib+mingw64.yaml | 12 ++++++++++
projects/libvirt-glib.yaml | 12 ----------
projects/libvirt.yaml | 12 ----------
projects/osinfo-db-tools+mingw32.yaml | 12 ++++++++++
projects/osinfo-db-tools+mingw64.yaml | 12 ++++++++++
projects/osinfo-db-tools.yaml | 12 ----------
projects/virt-viewer+mingw32.yaml | 12 ++++++++++
projects/virt-viewer+mingw64.yaml | 12 ++++++++++
projects/virt-viewer.yaml | 12 ----------
65 files changed, 321 insertions(+), 309 deletions(-)
create mode 100644 guests/playbooks/build/projects/libosinfo+mingw32.yml
create mode 100644 guests/playbooks/build/projects/libosinfo+mingw64.yml
create mode 100644 guests/playbooks/build/projects/libvirt+mingw32.yml
create mode 100644 guests/playbooks/build/projects/libvirt+mingw64.yml
create mode 100644 guests/playbooks/build/projects/libvirt-glib+mingw32.yml
create mode 100644 guests/playbooks/build/projects/libvirt-glib+mingw64.yml
create mode 100644 guests/playbooks/build/projects/osinfo-db-tools+mingw32.yml
create mode 100644 guests/playbooks/build/projects/osinfo-db-tools+mingw64.yml
create mode 100644 guests/playbooks/build/projects/virt-viewer+mingw32.yml
create mode 100644 guests/playbooks/build/projects/virt-viewer+mingw64.yml
copy guests/vars/projects/{libosinfo+mingw.yml => libosinfo+mingw32.yml} (56%)
rename guests/vars/projects/{libosinfo+mingw.yml => libosinfo+mingw64.yml} (56%)
copy guests/vars/projects/{libvirt+mingw.yml => libvirt+mingw32.yml} (51%)
rename guests/vars/projects/{libvirt+mingw.yml => libvirt+mingw64.yml} (51%)
copy guests/vars/projects/{libvirt-glib+mingw.yml => libvirt-glib+mingw32.yml} (57%)
copy guests/vars/projects/{libvirt-glib+mingw.yml => libvirt-glib+mingw64.yml} (57%)
rename guests/vars/projects/{osinfo-db-tools+mingw.yml => osinfo-db-tools+mingw32.yml} (53%)
rename guests/vars/projects/{libvirt-glib+mingw.yml => osinfo-db-tools+mingw64.yml} (54%)
copy guests/vars/projects/{virt-viewer+mingw.yml => virt-viewer+mingw32.yml} (52%)
rename guests/vars/projects/{virt-viewer+mingw.yml => virt-viewer+mingw64.yml} (52%)
create mode 100644 projects/libosinfo+mingw32.yaml
create mode 100644 projects/libosinfo+mingw64.yaml
create mode 100644 projects/libvirt+mingw32.yaml
create mode 100644 projects/libvirt+mingw64.yaml
create mode 100644 projects/libvirt-glib+mingw32.yaml
create mode 100644 projects/libvirt-glib+mingw64.yaml
create mode 100644 projects/osinfo-db-tools+mingw32.yaml
create mode 100644 projects/osinfo-db-tools+mingw64.yaml
create mode 100644 projects/virt-viewer+mingw32.yaml
create mode 100644 projects/virt-viewer+mingw64.yaml
--
2.17.1
6 years, 3 months
[libvirt] [PATCH] qemuBuildMemPathStr: Produce -mem-path more frequently
by Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1622455
If a domain is configured to use <source type='file'/> under
<memoryBacking/> we have to honour that setting and produce
-mem-path on the command line. We are not doing so if domain has
no guest NUMA nodes nor hugepages.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_command.c | 29 +++++++++++-----------
.../fd-memory-no-numa-topology.args | 1 +
2 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 8aa20496bc..df5e5841c2 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -7531,21 +7531,22 @@ qemuBuildMemPathStr(virQEMUDriverConfigPtr cfg,
const long system_page_size = virGetSystemPageSizeKB();
char *mem_path = NULL;
- /*
- * No-op if hugepages were not requested.
- */
- if (!def->mem.nhugepages)
+ /* There are two cases where we want to put -mem-path onto
+ * the command line: First one is when there are no guest
+ * NUMA nodes and hugepages are configured. The second one is
+ * if user requested file allocation. */
+ if (def->mem.nhugepages &&
+ def->mem.hugepages[0].size != system_page_size) {
+ if (qemuGetDomainHupageMemPath(def, cfg,
+ def->mem.hugepages[0].size,
+ &mem_path) < 0)
+ return -1;
+ } else if (def->mem.source == VIR_DOMAIN_MEMORY_SOURCE_FILE) {
+ if (qemuGetMemoryBackingPath(def, cfg, "ram", &mem_path) < 0)
+ return -1;
+ } else {
return 0;
-
- /* There is one special case: if user specified "huge"
- * pages of regular system pages size.
- * And there is nothing to do in this case.
- */
- if (def->mem.hugepages[0].size == system_page_size)
- return 0;
-
- if (qemuGetDomainHupageMemPath(def, cfg, def->mem.hugepages[0].size, &mem_path) < 0)
- return -1;
+ }
if (def->mem.allocation != VIR_DOMAIN_MEMORY_ALLOCATION_IMMEDIATE)
virCommandAddArgList(cmd, "-mem-prealloc", NULL);
diff --git a/tests/qemuxml2argvdata/fd-memory-no-numa-topology.args b/tests/qemuxml2argvdata/fd-memory-no-numa-topology.args
index 0e0d0830e8..76c7556468 100644
--- a/tests/qemuxml2argvdata/fd-memory-no-numa-topology.args
+++ b/tests/qemuxml2argvdata/fd-memory-no-numa-topology.args
@@ -10,6 +10,7 @@ QEMU_AUDIO_DRV=none \
-machine pc-i440fx-wily,accel=kvm,usb=off,dump-guest-core=off \
-m 14336 \
-mem-prealloc \
+-mem-path /var/lib/libvirt/qemu/ram/libvirt/qemu/-1-instance-00000092/ram \
-smp 8,sockets=8,cores=1,threads=1 \
-uuid 126f2720-6f8e-45ab-a886-ec9277079a67 \
-display none \
--
2.16.4
6 years, 3 months
[libvirt] [PATCH 0/2] tests: Use DO_TEST_CAPS_ARCH_LATEST() more
by Andrea Bolognani
As politely
Requested-by: Ján Tomko <jtomko(a)redhat.com>
Andrea Bolognani (2):
tests: Prepare to use DO_TEST_CAPS_ARCH_LATEST() more
tests: Add simple headless guests using latest caps
.../aarch64-virt-headless.aarch64-latest.args | 51 ++++++++++++++++++
.../aarch64-virt-headless.xml | 29 ++++++++++
.../ppc64-pseries-headless.ppc64-latest.args | 44 +++++++++++++++
.../ppc64-pseries-headless.xml | 29 ++++++++++
.../riscv64-virt-headless.riscv64-latest.args | 41 ++++++++++++++
.../riscv64-virt-headless.xml | 29 ++++++++++
.../s390x-ccw-headless.s390x-latest.args | 43 +++++++++++++++
tests/qemuxml2argvdata/s390x-ccw-headless.xml | 29 ++++++++++
.../x86_64-pc-headless.x86_64-latest.args | 45 ++++++++++++++++
tests/qemuxml2argvdata/x86_64-pc-headless.xml | 29 ++++++++++
.../x86_64-q35-headless.x86_64-latest.args | 53 +++++++++++++++++++
.../qemuxml2argvdata/x86_64-q35-headless.xml | 29 ++++++++++
tests/qemuxml2argvtest.c | 16 +++++-
13 files changed, 466 insertions(+), 1 deletion(-)
create mode 100644 tests/qemuxml2argvdata/aarch64-virt-headless.aarch64-latest.args
create mode 100644 tests/qemuxml2argvdata/aarch64-virt-headless.xml
create mode 100644 tests/qemuxml2argvdata/ppc64-pseries-headless.ppc64-latest.args
create mode 100644 tests/qemuxml2argvdata/ppc64-pseries-headless.xml
create mode 100644 tests/qemuxml2argvdata/riscv64-virt-headless.riscv64-latest.args
create mode 100644 tests/qemuxml2argvdata/riscv64-virt-headless.xml
create mode 100644 tests/qemuxml2argvdata/s390x-ccw-headless.s390x-latest.args
create mode 100644 tests/qemuxml2argvdata/s390x-ccw-headless.xml
create mode 100644 tests/qemuxml2argvdata/x86_64-pc-headless.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/x86_64-pc-headless.xml
create mode 100644 tests/qemuxml2argvdata/x86_64-q35-headless.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/x86_64-q35-headless.xml
--
2.17.1
6 years, 3 months
[libvirt] [libvirt-snmp][PATCH 0/3] Couple of build improvements
by Michal Privoznik
I'd like to get some review for these actually.
Michal Privoznik (3):
Generate AUTHORS from git log
Makefile: Introduce srpm target
configure: Prevent autoreconf from installing `compile' file
.gitignore | 4 ++--
AUTHORS => AUTHORS.in | 12 +++++-------
Makefile.am | 38 +++++++++++++++++++++++++++-----------
autogen.sh | 10 ++++++----
configure.ac | 8 ++++++--
5 files changed, 46 insertions(+), 26 deletions(-)
rename AUTHORS => AUTHORS.in (44%)
--
2.16.4
6 years, 3 months
[libvirt] [PATCH v2 0/3] conf: Move stuff out of domain_addr
by Andrea Bolognani
$ mv blurb here/
Andrea Bolognani (3):
conf: Move virDomainPCIAddressAsString() to util/virpci
conf: Rename virDomainPCIAddressAsString()
util: Drop virPCIGetAddrString()
src/conf/domain_addr.c | 20 +++-----------------
src/conf/domain_addr.h | 4 ----
src/libvirt_private.syms | 2 +-
src/qemu/qemu_command.c | 2 +-
src/qemu/qemu_domain_address.c | 6 +++---
src/util/virnetdev.c | 6 +-----
src/util/virpci.c | 21 +++++++++------------
src/util/virpci.h | 8 ++------
8 files changed, 20 insertions(+), 49 deletions(-)
--
2.17.1
6 years, 3 months
[libvirt] [jenkins-ci PATCH] lcitool: Don't encrypt password manually
by Martin Kletzander
Since version 1.9 ansible supports password_hash filter that can do that for us.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
guests/lcitool | 29 +------------------------
guests/playbooks/update/tasks/users.yml | 2 +-
2 files changed, 2 insertions(+), 29 deletions(-)
diff --git a/guests/lcitool b/guests/lcitool
index 2901a92c507b..ad1eee288620 100755
--- a/guests/lcitool
+++ b/guests/lcitool
@@ -151,34 +151,7 @@ class Config:
return vault_pass_file
def get_root_password_file(self):
- root_pass_file = self._get_config_file("root-password")
- root_hash_file = self._get_config_file(".root-password.hash")
-
- try:
- with open(root_pass_file, "r") as infile:
- root_pass = infile.readline().strip()
- except Exception:
- raise Error(
- "Missing or invalid root password file ({})".format(
- root_pass_file,
- )
- )
-
- # The hash will be different every time we run, but that doesn't
- # matter - it will still validate the correct root password
- root_hash = crypt.crypt(root_pass, Util.mksalt())
-
- try:
- with open(root_hash_file, "w") as infile:
- infile.write("{}\n".format(root_hash))
- except Exception:
- raise Error(
- "Can't write hashed root password file ({})".format(
- root_hash_file,
- )
- )
-
- return root_hash_file
+ return self._get_config_file("root-password")
class Inventory:
diff --git a/guests/playbooks/update/tasks/users.yml b/guests/playbooks/update/tasks/users.yml
index ec7f798a9c00..0a930d6c382c 100644
--- a/guests/playbooks/update/tasks/users.yml
+++ b/guests/playbooks/update/tasks/users.yml
@@ -2,7 +2,7 @@
- name: 'root: Set password'
user:
name: root
- password: '{{ lookup("file", root_password_file) }}'
+ password: '{{ lookup("file", root_password_file)|password_hash("sha512") }}'
shell: '{{ bash }}'
- name: 'root: Configure ssh access'
--
2.18.0
6 years, 3 months
[libvirt] [libvirt-snmp][PATCH 0/2] Couple of spec file improvements
by Michal Privoznik
While trying to build libvirt-snmp on minimalistic RHEL installation
I've noticed couple of problems.
These two are pushed under trivial rule.
Michal Privoznik (2):
spec: Require git and gcc for the build
spec: Modernize the spec file
libvirt-snmp.spec.in | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
--
2.16.4
6 years, 3 months