Bug 1847234 - Missing '/' in default_tls_x509_cert_dir: /etcpki/qemu/
Summary: Missing '/' in default_tls_x509_cert_dir: /etcpki/qemu/
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libvirt
Version: 8.3
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: rc
: 8.3
Assignee: Peter Krempa
QA Contact: Fangge Jin
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-06-16 03:27 UTC by Fangge Jin
Modified: 2020-11-17 17:49 UTC (History)
11 users (show)

Fixed In Version: libvirt-6.5.0-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-17 17:49:16 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Fangge Jin 2020-06-16 03:27:35 UTC
Description of problem:
Got bellow error when do encypted migration:
# virsh migrate rhel7-min qemu+ssh://10.0.138.168/system --live --verbose --p2p --tls
error: internal error: unable to execute QEMU command 'object-add': Unable to access credentials /etcpki/qemu/ca-cert.pem: No such file or directory



Version-Release number of selected component (if applicable):
libvirt-6.4.0-1.module+el8.3.0+6881+88468c00.x86_64

How reproducible:
100%

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Jaroslav Suchanek 2020-06-16 10:12:38 UTC
(In reply to Fangge Jin from comment #0)
> Description of problem:
> Got bellow error when do encypted migration:
> # virsh migrate rhel7-min qemu+ssh://10.0.138.168/system --live --verbose
> --p2p --tls
> error: internal error: unable to execute QEMU command 'object-add': Unable
> to access credentials /etcpki/qemu/ca-cert.pem: No such file or directory
> 
> 
> 
> Version-Release number of selected component (if applicable):
> libvirt-6.4.0-1.module+el8.3.0+6881+88468c00.x86_64

Can you please check your /etc/libvirt/qemu.conf and the default_tls_x509_cert_dir option ? What's the output of
grep "default_tls_x509_cert_dir.*=" /etc/libvirt/qemu.conf
?

Thanks.

Comment 2 Peter Krempa 2020-06-16 10:19:39 UTC
Caused by the following hunk of commit 068efae5b1a9ef :

@@ -201,7 +233,11 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged)
      * This will then be used as a fallback if the service specific
      * directory doesn't exist (although we don't check if this exists).
      */
-    cfg->defaultTLSx509certdir = g_strdup(SYSCONFDIR "/pki/qemu");
+    if (root == NULL) {
+        cfg->defaultTLSx509certdir = g_strdup(SYSCONFDIR "pki/qemu");
+    } else {
+        cfg->defaultTLSx509certdir = g_strdup_printf("%s/etc/pki/qemu", root);
+    }

     cfg->vncListen = g_strdup(VIR_LOOPBACK_IPV4_ADDR);
     cfg->spiceListen = g_strdup(VIR_LOOPBACK_IPV4_ADDR);

You can see that the '/' is dropped from the strdup.

Comment 4 Peter Krempa 2020-06-16 10:54:01 UTC
Fixed upstream:

commit 8f58a4003532d5fffdadf2adc659c94eba3fa21a
Author: Peter Krempa <pkrempa>
Date:   Tue Jun 16 12:36:55 2020 +0200

    virQEMUDriverConfigNew: Add slash to cfg->defaultTLSx509certdir for non-embedded driver
    
    Commit 068efae5b1a9ef accidentally removed the slash.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1847234
    
    Signed-off-by: Peter Krempa <pkrempa>
    Reviewed-by: Andrea Bolognani <abologna>

Comment 7 Fangge Jin 2020-07-31 06:59:10 UTC
Verified with libvirt-6.5.0-1.module+el8.3.0+7323+d54bb644.x86_64

Comment 10 errata-xmlrpc 2020-11-17 17:49:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (virt:8.3 bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:5137


Note You need to log in before you can comment on or make changes to this bug.