[libvirt] [PATCH v4 0/4] Add .domainGetHostname() support for QEMU driver.
by Julio Faracco
This serie adds a new function into QEMU Guest Agent handler to use the
QEMU command 'guest-get-host-name' to retrieve the domain hostname. This
approach requires QEMU-GA running inside the guest, but it is the fastest
and easiest way to get this info.
This serie has some suggestion made by John Ferlan for v3. Specially,
some improvements to error handling.
Julio Faracco (4):
qemu: implementing qemuAgentGetHostname() function.
qemu: adding domainGetHostname support for QEMU
docs: Add QEMU-GA get hostname feature into news.xml
qemu: unlink the error report from VIR_STRDUP.
docs/news.xml | 9 ++++++
src/qemu/qemu_agent.c | 66 ++++++++++++++++++++++++++++++++++++++----
src/qemu/qemu_agent.h | 4 +++
src/qemu/qemu_driver.c | 42 +++++++++++++++++++++++++++
4 files changed, 115 insertions(+), 6 deletions(-)
--
2.17.1
6 years, 2 months
[libvirt] [PATCH v3 00/28] Introduce metadata locking
by Michal Privoznik
v3 of:
https://www.redhat.com/archives/libvir-list/2018-August/msg00814.html
What has changed since v2? A lot.
- The lock manager was moved into security manager (which requires a lot
of preparation which is done in first 8 or so patches).
- The VIR_LOCK_SPACE_ACQUIRE_WAIT flag (2/7 in v2) is dropped as it
turned out to be harmful. virlockd can't block under any
circumstances. And we can not introduce a thread pool for it.
- While going through the code I've found couple of bugs which I'm
fixing in first few patches.
As usual, you can find all the patches at:
https://github.com/zippy2/libvirt/tree/disk_metadata_lock_v3
Michal Prívozník (28):
virSecurityManagerNewDriver: Fix code pattern
virSecurityManagerNewStack: Don't ignore virSecurityStackAddNested
retval
lock_daemon: Fix some memleaks
lock_driver_lockd: Don't leak lockspace dirs
virLockManagerLockDaemonAcquire: Drop useless check
virLockManagerSanlockAddResource: Do not ignore unknown resource types
locking: Don't leak private data in virLockManagerLockDaemonNew
virLockManagerLockDaemonAddResource: Switch to cleanup label rather
than error
virlockspace: Allow caller to specify start and length offset in
virLockSpaceAcquireResource
lock_driver_lockd: Introduce
VIR_LOCK_SPACE_PROTOCOL_ACQUIRE_RESOURCE_METADATA flag
lock_driver: Introduce new VIR_LOCK_MANAGER_OBJECT_TYPE_DAEMON
_virLockManagerLockDaemonPrivate: Move @hasRWDisks into dom union
lock_driver: Introduce VIR_LOCK_MANAGER_RESOURCE_TYPE_METADATA
lock_daemon_dispatch: Check for ownerPid rather than ownerId
locking: Introduce virLockManagerClearResources
lock_driver: Introduce KEEP_OPEN flags
lock_manager: Introduce virLockManagerCloseConn
lock_manager: Allow disabling configFile for virLockManagerPluginNew
qemu_conf: Introduce metadata_lock_manager
security_manager: Load lock plugin on init
security_manager: Introduce virSecurityManagerLockCloseConn
security_manager: Introduce metadata locking APIs
security_dac: Pass virSecurityManagerPtr to virSecurityDACSetOwnership
security_dac: Pass virSecurityManagerPtr to
virSecurityDACRestoreFileLabelInternal
security_dac: Fix info messages when chown()-ing
security_dac: Fix const correctness
security_dac: Move transaction handling up one level
security_dac: Lock domain metadata
cfg.mk | 4 +-
src/libvirt_private.syms | 2 +
src/locking/lock_daemon.c | 3 +
src/locking/lock_daemon_dispatch.c | 25 +-
src/locking/lock_driver.h | 38 +++
src/locking/lock_driver_lockd.c | 520 ++++++++++++++++++++++++++-----------
src/locking/lock_driver_lockd.h | 1 +
src/locking/lock_driver_nop.c | 14 +
src/locking/lock_driver_sanlock.c | 50 ++--
src/locking/lock_manager.c | 31 ++-
src/locking/lock_manager.h | 7 +
src/qemu/libvirtd_qemu.aug | 1 +
src/qemu/qemu.conf | 6 +
src/qemu/qemu_conf.c | 13 +
src/qemu/qemu_conf.h | 1 +
src/qemu/qemu_driver.c | 12 +-
src/qemu/test_libvirtd_qemu.aug.in | 1 +
src/security/security_dac.c | 213 +++++++++------
src/security/security_manager.c | 366 +++++++++++++++++++++++++-
src/security/security_manager.h | 17 +-
src/util/virlockspace.c | 15 +-
src/util/virlockspace.h | 4 +
tests/testutilsqemu.c | 2 +-
tests/virlockspacetest.c | 29 ++-
24 files changed, 1096 insertions(+), 279 deletions(-)
--
2.16.4
6 years, 2 months
[libvirt] [PATCH 0/2] qemu: Unify generation of command line for virtio devices
by Andrea Bolognani
-device virtio-blurb-pci
Andrea Bolognani (2):
tests: Fix use of virtio-serial for aarch64/virt
qemu: Unify generation of command line for virtio devices
src/qemu/qemu_command.c | 299 ++++++++++--------
.../mach-virt-console-virtio.args | 2 +-
tests/qemuxml2argvtest.c | 3 +-
.../mach-virt-console-virtio.xml | 4 +-
tests/qemuxml2xmltest.c | 6 +-
5 files changed, 173 insertions(+), 141 deletions(-)
--
2.17.1
6 years, 2 months
[libvirt] [libvirt-snmp][PATCH] rpm: simplify applying of patches
by Michal Privoznik
The distros we support for RPM builds all have %autosetup
support. Use that instead of what we currently have (nothing).
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
Pushed under trivial rule and also 'who cares about snmp' rules ;-)
libvirt-snmp.spec.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libvirt-snmp.spec.in b/libvirt-snmp.spec.in
index c5a1a41..21a9885 100644
--- a/libvirt-snmp.spec.in
+++ b/libvirt-snmp.spec.in
@@ -15,7 +15,7 @@ BuildRequires: net-snmp-perl net-snmp net-snmp-utils net-snmp-devel libvirt-deve
Provides a way to control libvirt through SNMP protocol.
%prep
-%setup -q
+%autosetup -S git_am
%build
--
2.16.4
6 years, 2 months
[libvirt] [jenkins-ci PATCH] guests: Special-case fedora-gpg-keys updates on Rawhide
by Andrea Bolognani
During each Rawhide development cycle there is a point
at which packages start being signed with new keys, which
causes updates to fail.
To work around the problem, make sure fedora-gpg-keys is
updated before attempting to update all other packages;
updating fedora-gpg-keys itself requires gpg signature
checking to be disabled.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
I am actually not 100% sure we need to disable gpg
signature checking in order to update fedora-gpg-keys:
it would make sense for that one package to be signed
with the old key to make the update possible without
breaking trust at any point in time. Unfortunately I
updated my Rawhide guest without taking a snapshot
first, and I can't figure out a way to get it back to
a state suitable for checking whether the above makes
sense :( Perhaps someone with deeper understanding of
the Fedora release process will confirm or deny.
guests/lcitool | 24 +++++++++++++++++-------
guests/playbooks/update/tasks/base.yml | 9 +++++++++
2 files changed, 26 insertions(+), 7 deletions(-)
diff --git a/guests/lcitool b/guests/lcitool
index 821cafc..ddeee6a 100755
--- a/guests/lcitool
+++ b/guests/lcitool
@@ -511,7 +511,8 @@ class Application:
facts = self._inventory.get_facts(host)
package_format = facts["package_format"]
os_name = facts["os_name"]
- os_full = os_name + str(facts["os_version"])
+ os_version = str(facts["os_version"])
+ os_full = os_name + os_version
if package_format not in ["deb", "rpm"]:
raise Error("Host {} doesn't support Dockerfiles".format(host))
@@ -560,12 +561,21 @@ class Application:
apt-get autoclean -y
"""))
elif package_format == "rpm":
- sys.stdout.write(textwrap.dedent("""
- RUN yum update -y && \\
- yum install -y ${PACKAGES} && \\
- yum autoremove -y && \\
- yum clean all -y
- """))
+ if os_name == "Fedora" and os_version == "Rawhide":
+ sys.stdout.write(textwrap.dedent("""
+ RUN yum update -y --nogpgcheck fedora-gpg-keys && \\
+ yum update -y && \\
+ yum install -y ${PACKAGES} && \\
+ yum autoremove -y && \\
+ yum clean all -y
+ """))
+ else:
+ sys.stdout.write(textwrap.dedent("""
+ RUN yum update -y && \\
+ yum install -y ${PACKAGES} && \\
+ yum autoremove -y && \\
+ yum clean all -y
+ """))
def run(self):
cmdline = self._parser.parse_args()
diff --git a/guests/playbooks/update/tasks/base.yml b/guests/playbooks/update/tasks/base.yml
index 11f600f..cc16eb0 100644
--- a/guests/playbooks/update/tasks/base.yml
+++ b/guests/playbooks/update/tasks/base.yml
@@ -64,6 +64,15 @@
- not ( os_name == 'Fedora' and
os_version == 'Rawhide' )
+- name: Update installed packages
+ package:
+ name: fedora-gpg-keys
+ state: latest
+ disable_gpg_check: yes
+ when:
+ - os_name == 'Fedora'
+ - os_version == 'Rawhide'
+
- name: Update installed packages
command: dnf update --refresh --exclude 'kernel*' -y
args:
--
2.17.1
6 years, 2 months
[libvirt] [PATCH] tests: skip some unicode tests if expected output won't match
by Daniel P. Berrangé
The expected output strings from the vshtabletest.c are created on a
modern Linux host where unicode printing support is very good. On older
Linux platforms, or non-Linux platforms, some unicode characters will
not be considered printable. While the vsh table alignment code will
stil do the right thing with escaping & aligning in this case, the
result will not match the test's expected output.
Since we know the code is working correctly, do a check with iswprint()
to validate the platform's quality and skip the test if it fails. This
fixes the test on FreeBSD platforms.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
Pushed as a build fix
tests/vshtabletest.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/tests/vshtabletest.c b/tests/vshtabletest.c
index 9e9c045226..1138e34161 100644
--- a/tests/vshtabletest.c
+++ b/tests/vshtabletest.c
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <locale.h>
+#include <wctype.h>
#include "internal.h"
#include "testutils.h"
@@ -158,6 +159,15 @@ testUnicodeArabic(const void *opaque ATTRIBUTE_UNUSED)
" 1 ﻉﺪﻴﻟ ﺎﻠﺜﻘﻴﻟ ﻕﺎﻣ ﻊﻧ, ٣٠ ﻎﻴﻨﻳﺍ ﻮﺘﻧﺎﻤﺗ ﺎﻠﺛﺎﻠﺛ، ﺄﺳﺭ, ﺩﻮﻟ ﺩﻮﻟ. ﺄﻣﺎﻣ ﺍ ﺎﻧ ﻲﻜﻧ \n"
" ﺺﻔﺣﺓ ﺖﻜﺘﻴﻛﺍً ﻊﻟ, ﺎﻠﺠﻧﻭﺩ ﻭﺎﻠﻌﺗﺍﺩ ﺵﺭ \n";
vshTablePtr table;
+ wchar_t wc;
+
+ /* If this char is not classed as printable, the actual
+ * output won't match what this test expects. The code
+ * is still operating correctly, but we have different
+ * layout */
+ mbrtowc(&wc, "،", MB_CUR_MAX, NULL);
+ if (!iswprint(wc))
+ return EXIT_AM_SKIP;
table = vshTableNew("ﻡﺍ ﻢﻣﺍ ﻕﺎﺌﻣﺓ", "ﺓ ﺎﻠﺼﻋ", "ﺍﻸﺜﻧﺎﻧ", NULL);
if (!table)
@@ -192,6 +202,15 @@ testUnicodeZeroWidthChar(const void *opaque ATTRIBUTE_UNUSED)
" 1\u200B fedora28 run\u200Bning \n"
" 2 rhel7.5 running \n";
char *act = NULL;
+ wchar_t wc;
+
+ /* If this char is not classed as printable, the actual
+ * output won't match what this test expects. The code
+ * is still operating correctly, but we have different
+ * layout */
+ mbrtowc(&wc, "\u200B", MB_CUR_MAX, NULL);
+ if (!iswprint(wc))
+ return EXIT_AM_SKIP;
table = vshTableNew("I\u200Bd", "Name", "\u200BStatus", NULL);
if (!table)
--
2.17.1
6 years, 2 months
[libvirt] [snmp PATCH] Fix wrong object OIDs sent by libvirtMib_subagent
by Miguel Martin
The objects OIDs sent by the guest agent are:
libvirtGuestName.0
libvirtGuestUUID.1
libvirtGuestState.2
libvirtGuestRowStatus.3
The expected libvirtGuestNotif objects OID would be:
libvirtGuestName.0
libvirtGuestUUID.0
libvirtGuestState.0
libvirtGuestRowStatus.0
Signed-off-by: Miguel Martin <mmartinv(a)redhat.com>
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1624839
---
src/libvirtNotifications.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/libvirtNotifications.c b/src/libvirtNotifications.c
index 135f177..0522d54 100644
--- a/src/libvirtNotifications.c
+++ b/src/libvirtNotifications.c
@@ -38,11 +38,11 @@ send_libvirtGuestNotif_trap(virDomainPtr dom)
const oid libvirtGuestName_oid[] =
{ 1, 3, 6, 1, 4, 1, 36957, 1, 1, 1, 2, 0 };
const oid libvirtGuestUUID_oid[] =
- { 1, 3, 6, 1, 4, 1, 36957, 1, 1, 1, 1, 1 };
+ { 1, 3, 6, 1, 4, 1, 36957, 1, 1, 1, 1, 0 };
const oid libvirtGuestState_oid[] =
- { 1, 3, 6, 1, 4, 1, 36957, 1, 1, 1, 3, 2 };
+ { 1, 3, 6, 1, 4, 1, 36957, 1, 1, 1, 3, 0 };
const oid libvirtGuestRowStatus_oid[] =
- { 1, 3, 6, 1, 4, 1, 36957, 1, 1, 1, 9, 3 };
+ { 1, 3, 6, 1, 4, 1, 36957, 1, 1, 1, 9, 0 };
const char *domName = virDomainGetName(dom);
--
2.17.1
6 years, 2 months
[libvirt] [go PATCH] Avoid clashing path with default storage pool
by Daniel P. Berrangé
The test driver provides a default storage pool at
/default-pool. Libvirt now enforces source path uniqueness, so we must
pick a different path for our test pools.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
Pushed as a build fix
connect_test.go | 6 +++---
storage_pool_test.go | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/connect_test.go b/connect_test.go
index 29c274d..da24448 100644
--- a/connect_test.go
+++ b/connect_test.go
@@ -789,7 +789,7 @@ func TestStoragePoolDefineXML(t *testing.T) {
}()
defName := "default-pool-test-0"
xml := `<pool type='dir'><name>default-pool-test-0</name><target>
- <path>/default-pool</path></target></pool>`
+ <path>/default-pool-test-0</path></target></pool>`
pool, err := conn.StoragePoolDefineXML(xml, 0)
if err != nil {
t.Fatal(err)
@@ -900,7 +900,7 @@ func TestLookupStorageVolByKey(t *testing.T) {
return
}
defer pool.Destroy()
- defPoolPath := "default-pool"
+ defPoolPath := "default-pool-test-1"
defVolName := time.Now().String()
defVolKey := "/" + defPoolPath + "/" + defVolName
vol, err := pool.StorageVolCreateXML(testStorageVolXML(defVolName, defPoolPath), 0)
@@ -942,7 +942,7 @@ func TestLookupStorageVolByPath(t *testing.T) {
return
}
defer pool.Destroy()
- defPoolPath := "default-pool"
+ defPoolPath := "default-pool-test-1"
defVolName := time.Now().String()
defVolPath := "/" + defPoolPath + "/" + defVolName
vol, err := pool.StorageVolCreateXML(testStorageVolXML(defVolName, defPoolPath), 0)
diff --git a/storage_pool_test.go b/storage_pool_test.go
index 18cdb3a..7e93b17 100644
--- a/storage_pool_test.go
+++ b/storage_pool_test.go
@@ -42,7 +42,7 @@ func buildTestStoragePool(poolName string) (*StoragePool, *Connect) {
pool, err := conn.StoragePoolDefineXML(`<pool type='dir'>
<name>`+name+`</name>
<target>
- <path>/default-pool</path>
+ <path>/default-pool-test-1</path>
</target>
</pool>`, 0)
if err != nil {
--
2.17.1
6 years, 2 months
[libvirt] [perl PATCH] Avoid using /default-pool for test storage pool
by Daniel P. Berrangé
The path /default-pool is used by a predefined storage pool in the test
driver, and libvirt now enforces pool source uniqueness.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
Pushed as a build fix
t/400-storage-pools.t | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/400-storage-pools.t b/t/400-storage-pools.t
index 319a21e..c78507d 100644
--- a/t/400-storage-pools.t
+++ b/t/400-storage-pools.t
@@ -60,7 +60,7 @@ my $xml = "<pool type='dir'>
<name>wibble</name>
<uuid>12341234-5678-5678-5678-123412341234</uuid>
<target>
- <path>/default-pool</path>
+ <path>/wibble</path>
</target>
</pool>";
--
2.17.1
6 years, 2 months