RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2236500 - libvirt-daemon marked for autoremoval after upgrade
Summary: libvirt-daemon marked for autoremoval after upgrade
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: libvirt
Version: 9.3
Hardware: All
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Andrea Bolognani
QA Contact: Lili Zhu
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-08-31 13:11 UTC by Andrea Bolognani
Modified: 2023-11-09 07:39 UTC (History)
16 users (show)

Fixed In Version: libvirt-9.5.0-7.el9_3
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 2232805
Environment:
Last Closed: 2023-11-07 08:31:48 UTC
Type: ---
Target Upstream Version: 9.7.0
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-167063 0 None None None 2023-08-31 13:28:55 UTC
Red Hat Product Errata RHSA-2023:6409 0 None None None 2023-11-07 08:31:51 UTC

Description Andrea Bolognani 2023-08-31 13:11:06 UTC
+++ This bug was initially created as a clone of Bug #2232805 +++

As of RHEL 9.2, the libvirt-daemon package (which contains the
libvirtd daemon) is a hard dependency for hypervisor metapackages
such as libvirt-daemon-kvm.

In RHEL 9.3, this dependency has been dropped, with the intention of
making it possible to create minimal deployments where the monolithic
daemon is not present at all.

Unfortunately, this decision causes problems on upgrade for
deployments that were manually switched from modular daemons (the
default in RHEL 9) to monolithic daemon.

More specifically, while the upgrade itself would be successful and
libvirtd would still be available after it, a subsequent call to 'yum
autoremove' would result in the libvirt-daemon package being removed
and the deployment breaking.

Comment 1 Andrea Bolognani 2023-08-31 13:12:31 UTC
Fix pushed upstream.

  commit aa5895cbc72bd9b4bb1ce99e231b2ac4b25db9c4
  Author: Andrea Bolognani <abologna>
  Date:   Wed Aug 30 17:45:47 2023 +0200

    rpm: Recommend libvirt-daemon for with_modular_daemons distros
    
    A default deployment on modern distros uses modular daemons but
    switching back to the monolithic daemon, while not recommended,
    is still considered a perfectly valid option.
    
    For a monolithic daemon deployment, the upgrade to libvirt 9.2.0
    or newer works as expected; a subsequent call to dnf autoremove,
    however, results in the libvirt-daemon package being removed and
    the deployment no longer working.
    
    In order to avoid that situation, mark the libvirt-daemon as
    recommended.
    
    This will unfortunately result in it being included in most
    installations despite not being necessary, but considering that
    the alternative is breaking existing setups on upgrade it feels
    like a reasonable tradeoff.
    
    Moreover, since the dependency on libvirt-daemon is just a weak
    one, it's still possible for people looking to minimize the
    footprint of their installation to manually remove the package
    after installation, mitigating the drawbacks of this approach.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=2232805
    
    Signed-off-by: Andrea Bolognani <abologna>
    Reviewed-by: Erik Skultety <eskultet>
    Reviewed-by: Daniel P. Berrangé <berrange>

  v9.7.0-rc2-2-gaa5895cbc7

Comment 2 Andrea Bolognani 2023-08-31 13:24:33 UTC
Backport posted.

  https://gitlab.com/redhat/centos-stream/src/libvirt/-/merge_requests/9

Comment 6 Lili Zhu 2023-09-05 12:46:01 UTC
Before upgrade:
rpm -q libvirt-daemon
libvirt-daemon-9.0.0-10.3.el9_2.x86_64  

1. Switch to monolithic mode
# systemctl list-unit-files |grep virt
libvirt-guests.service                                    disabled        disabled
libvirtd.service                                          enabled         disabled
virtinterfaced.service                                    disabled        disabled
virtlockd.service                                         indirect        disabled
virtlogd.service                                          indirect        disabled
virtnetworkd.service                                      disabled        disabled
virtnodedevd.service                                      disabled        disabled
virtnwfilterd.service                                     disabled        disabled
virtproxyd.service                                        disabled        disabled
virtqemud.service                                         disabled        enabled
virtsecretd.service                                       disabled        disabled
virtstoraged.service                                      disabled        disabled
libvirtd-admin.socket                                     enabled         disabled
libvirtd-ro.socket                                        enabled         disabled
libvirtd-tcp.socket                                       enabled         disabled
libvirtd-tls.socket                                       enabled         disabled
libvirtd.socket                                           enabled         disabled
virtinterfaced-admin.socket                               disabled        disabled
virtinterfaced-ro.socket                                  disabled        disabled
virtinterfaced.socket                                     disabled        enabled
virtlockd-admin.socket                                    disabled        disabled
virtlockd.socket                                          enabled         disabled
virtlogd-admin.socket                                     disabled        disabled
virtlogd.socket                                           enabled         enabled
virtnetworkd-admin.socket                                 disabled        disabled
virtnetworkd-ro.socket                                    disabled        disabled
virtnetworkd.socket                                       disabled        enabled
virtnodedevd-admin.socket                                 disabled        disabled
virtnodedevd-ro.socket                                    disabled        disabled
virtnodedevd.socket                                       disabled        enabled
virtnwfilterd-admin.socket                                disabled        disabled
virtnwfilterd-ro.socket                                   disabled        disabled
virtnwfilterd.socket                                      disabled        enabled
virtproxyd-admin.socket                                   disabled        disabled
virtproxyd-ro.socket                                      disabled        disabled
virtproxyd-tcp.socket                                     disabled        disabled
virtproxyd-tls.socket                                     disabled        disabled
virtproxyd.socket                                         disabled        enabled
virtqemud-admin.socket                                    disabled        disabled
virtqemud-ro.socket                                       disabled        disabled
virtqemud.socket                                          disabled        disabled
virtsecretd-admin.socket                                  disabled        disabled
virtsecretd-ro.socket                                     disabled        disabled
virtsecretd.socket                                        disabled        enabled
virtstoraged-admin.socket                                 disabled        disabled
virtstoraged-ro.socket                                    disabled        disabled
virtstoraged.socket                                       disabled        enabled
virt-guest-shutdown.target                                static          -



After Upgrade:
# rpm -q libvirt-daemon
libvirt-daemon-9.5.0-6.el9.x86_64

# dnf autoremove
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

Last metadata expiration check: 0:58:05 ago on Tue 05 Sep 2023 07:24:33 AM EDT.
Dependencies resolved.
==============================================================================================================================================================================================
 Package                                                  Architecture                        Version                                    Repository                                      Size
==============================================================================================================================================================================================
Removing:
 grub2-tools-efi                                          x86_64                              1:2.06-68.el9                              @BaseOS                                        2.7 M
 grub2-tools-extra                                        x86_64                              1:2.06-68.el9                              @BaseOS                                        5.3 M
 libglvnd-opengl                                          x86_64                              1:1.3.4-1.el9                              @beaker-AppStream                              173 k
 libnsl2                                                  x86_64                              2.0.0-1.el9                                @beaker-AppStream                               58 k
 mpdecimal                                                x86_64                              2.5.1-3.el9                                @beaker-AppStream                              200 k
 openldap-compat                                          x86_64                              2.6.3-1.el9                                @BaseOS                                         59 k
 python3-ethtool                                          x86_64                              0.15-2.el9                                 @beaker-BaseOS                                  94 k
 python3.11                                               x86_64                              3.11.4-3.el9                               @AppStream                                      32 k
 python3.11-cffi                                          x86_64                              1.15.1-1.el9                               @beaker-AppStream                              1.4 M
 python3.11-cryptography                                  x86_64                              37.0.2-5.el9                               @beaker-AppStream                              4.8 M
 python3.11-libs                                          x86_64                              3.11.4-3.el9                               @AppStream                                      44 M
 python3.11-pip-wheel                                     noarch                              22.3.1-4.el9                               @AppStream                                     1.5 M
 python3.11-ply                                           noarch                              3.11-1.el9                                 @beaker-AppStream                              584 k
 python3.11-pycparser                                     noarch                              2.20-1.el9                                 @beaker-AppStream                              867 k
 python3.11-pyyaml                                        x86_64                              6.0-1.el9                                  @beaker-AppStream                              785 k
 python3.11-setuptools-wheel                              noarch                              65.5.1-2.el9                               @beaker-AppStream                              860 k
 python3.11-six                                           noarch                              1.16.0-1.el9                               @beaker-AppStream                              123 k

Transaction Summary
==============================================================================================================================================================================================
Remove  17 Packages

Freed space: 64 M
Is this ok [y/N]: y


Check the unit files again
# systemctl list-unit-files |grep virt
libvirt-guests.service                                    disabled        disabled
libvirtd.service                                          enabled         disabled
virtinterfaced.service                                    disabled        disabled
virtlockd.service                                         indirect        disabled
virtlogd.service                                          indirect        disabled
virtnetworkd.service                                      disabled        disabled
virtnodedevd.service                                      disabled        disabled
virtnwfilterd.service                                     disabled        disabled
virtproxyd.service                                        disabled        disabled
virtqemud.service                                         disabled        enabled
virtsecretd.service                                       disabled        disabled
virtstoraged.service                                      disabled        disabled
libvirtd-admin.socket                                     enabled         disabled
libvirtd-ro.socket                                        enabled         disabled
libvirtd-tcp.socket                                       enabled         disabled
libvirtd-tls.socket                                       enabled         disabled
libvirtd.socket                                           enabled         disabled
virtinterfaced-admin.socket                               disabled        disabled
virtinterfaced-ro.socket                                  disabled        disabled
virtinterfaced.socket                                     disabled        enabled
virtlockd-admin.socket                                    disabled        disabled
virtlockd.socket                                          enabled         disabled
virtlogd-admin.socket                                     disabled        disabled
virtlogd.socket                                           enabled         enabled
virtnetworkd-admin.socket                                 disabled        disabled
virtnetworkd-ro.socket                                    disabled        disabled
virtnetworkd.socket                                       disabled        enabled
virtnodedevd-admin.socket                                 disabled        disabled
virtnodedevd-ro.socket                                    disabled        disabled
virtnodedevd.socket                                       disabled        enabled
virtnwfilterd-admin.socket                                disabled        disabled
virtnwfilterd-ro.socket                                   disabled        disabled
virtnwfilterd.socket                                      disabled        enabled
virtproxyd-admin.socket                                   disabled        disabled
virtproxyd-ro.socket                                      disabled        disabled
virtproxyd-tcp.socket                                     disabled        disabled
virtproxyd-tls.socket                                     disabled        disabled
virtproxyd.socket                                         disabled        enabled
virtqemud-admin.socket                                    disabled        disabled
virtqemud-ro.socket                                       disabled        disabled
virtqemud.socket                                          disabled        disabled
virtsecretd-admin.socket                                  disabled        disabled
virtsecretd-ro.socket                                     disabled        disabled
virtsecretd.socket                                        disabled        enabled
virtstoraged-admin.socket                                 disabled        disabled
virtstoraged-ro.socket                                    disabled        disabled
virtstoraged.socket                                       disabled        enabled
virt-guest-shutdown.target                                static          -


# rpm -q libvirt-daemon
libvirt-daemon-9.5.0-6.el9.x86_64

libvirt-daemon is not removed after upgrade.

Comment 8 Lili Zhu 2023-09-05 23:58:23 UTC
When I try to reproduce this bug for the second time, After upgrade, before execute the "yum autoremove", I reboot the host firstly,
After the reboot:
libvirt-daemon-9.5.0-6.el9.x86_64

# yum autoremove
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

Last metadata expiration check: 0:11:39 ago on Tue 05 Sep 2023 07:33:32 PM EDT.
Dependencies resolved.
==============================================================================================================================================================================================
 Package                                                  Architecture                        Version                                    Repository                                      Size
==============================================================================================================================================================================================
Removing:
 grub2-tools-efi                                          x86_64                              1:2.06-68.el9                              @BaseOS                                        2.7 M
 grub2-tools-extra                                        x86_64                              1:2.06-68.el9                              @BaseOS                                        5.3 M
 libglvnd-opengl                                          x86_64                              1:1.3.4-1.el9                              @beaker-AppStream                              173 k
 libnsl2                                                  x86_64                              2.0.0-1.el9                                @beaker-AppStream                               58 k
 mpdecimal                                                x86_64                              2.5.1-3.el9                                @beaker-AppStream                              200 k
 openldap-compat                                          x86_64                              2.6.3-1.el9                                @BaseOS                                         59 k
 python3-ethtool                                          x86_64                              0.15-2.el9                                 @beaker-BaseOS                                  94 k
 python3.11                                               x86_64                              3.11.4-3.el9                               @AppStream                                      32 k
 python3.11-cffi                                          x86_64                              1.15.1-1.el9                               @beaker-AppStream                              1.4 M
 python3.11-cryptography                                  x86_64                              37.0.2-5.el9                               @beaker-AppStream                              4.8 M
 python3.11-libs                                          x86_64                              3.11.4-3.el9                               @AppStream                                      44 M
 python3.11-pip-wheel                                     noarch                              22.3.1-4.el9                               @AppStream                                     1.5 M
 python3.11-ply                                           noarch                              3.11-1.el9                                 @beaker-AppStream                              584 k
 python3.11-pycparser                                     noarch                              2.20-1.el9                                 @beaker-AppStream                              867 k
 python3.11-pyyaml                                        x86_64                              6.0-1.el9                                  @beaker-AppStream                              785 k
 python3.11-setuptools-wheel                              noarch                              65.5.1-2.el9                               @beaker-AppStream                              860 k
 python3.11-six                                           noarch                              1.16.0-1.el9                               @beaker-AppStream                              123 k

Transaction Summary
==============================================================================================================================================================================================
Remove  17 Packages

Freed space: 64 M
Is this ok [y/N]: y

# rpm -q libvirt-daemon
libvirt-daemon-9.5.0-6.el9.x86_64

#systemctl list-units  |grep virt
  sys-devices-virtual-block-dm\x2d0.device                                                         loaded active plugged   /sys/devices/virtual/block/dm-0
  sys-devices-virtual-block-dm\x2d1.device                                                         loaded active plugged   /sys/devices/virtual/block/dm-1
  sys-devices-virtual-block-dm\x2d2.device                                                         loaded active plugged   /sys/devices/virtual/block/dm-2
  sys-devices-virtual-misc-rfkill.device                                                           loaded active plugged   /sys/devices/virtual/misc/rfkill
  sys-devices-virtual-net-virbr0.device                                                            loaded active plugged   /sys/devices/virtual/net/virbr0
  libvirtd-admin.socket                                                                            loaded active listening Libvirt admin socket
  libvirtd-ro.socket                                                                               loaded active listening Libvirt local read-only socket
  libvirtd-tcp.socket                                                                              loaded active listening Libvirt non-TLS IP socket
  libvirtd-tls.socket                                                                              loaded active listening Libvirt TLS IP socket
  libvirtd.socket                                                                                  loaded active listening Libvirt local socket
  virtlockd.socket                                                                                 loaded active listening Virtual machine lock manager socket
  virtlogd.socket  

# systemctl list-unit-files  |grep virt
libvirt-guests.service                                    disabled        disabled
libvirtd.service                                          enabled         disabled
virtinterfaced.service                                    disabled        disabled
virtlockd.service                                         indirect        disabled
virtlogd.service                                          indirect        disabled
virtnetworkd.service                                      disabled        disabled
virtnodedevd.service                                      disabled        disabled
virtnwfilterd.service                                     disabled        disabled
virtproxyd.service                                        disabled        disabled
virtqemud.service                                         disabled        enabled
virtsecretd.service                                       disabled        disabled
virtstoraged.service                                      disabled        disabled
libvirtd-admin.socket                                     enabled         disabled
libvirtd-ro.socket                                        enabled         disabled
libvirtd-tcp.socket                                       enabled         disabled
libvirtd-tls.socket                                       enabled         disabled
libvirtd.socket                                           enabled         disabled
virtinterfaced-admin.socket                               disabled        disabled
virtinterfaced-ro.socket                                  disabled        disabled
virtinterfaced.socket                                     disabled        enabled
virtlockd-admin.socket                                    disabled        disabled
virtlockd.socket                                          enabled         disabled
virtlogd-admin.socket                                     disabled        disabled
virtlogd.socket                                           enabled         enabled
virtnetworkd-admin.socket                                 disabled        disabled
virtnetworkd-ro.socket                                    disabled        disabled
virtnetworkd.socket                                       disabled        enabled
virtnodedevd-admin.socket                                 disabled        disabled
virtnodedevd-ro.socket                                    disabled        disabled
virtnodedevd.socket                                       disabled        enabled
virtnwfilterd-admin.socket                                disabled        disabled
virtnwfilterd-ro.socket                                   disabled        disabled
virtnwfilterd.socket                                      disabled        enabled
virtproxyd-admin.socket                                   disabled        disabled
virtproxyd-ro.socket                                      disabled        disabled
virtproxyd-tcp.socket                                     disabled        disabled
virtproxyd-tls.socket                                     disabled        disabled
virtproxyd.socket                                         disabled        enabled
virtqemud-admin.socket                                    disabled        disabled
virtqemud-ro.socket                                       disabled        disabled
virtqemud.socket                                          disabled        disabled
virtsecretd-admin.socket                                  disabled        disabled
virtsecretd-ro.socket                                     disabled        disabled
virtsecretd.socket                                        disabled        enabled
virtstoraged-admin.socket                                 disabled        disabled
virtstoraged-ro.socket                                    disabled        disabled
virtstoraged.socket                                       disabled        enabled
virt-guest-shutdown.target                                static          -

# virsh list --all
 Id   Name   State
--------------------

 systemctl status libvirtd
● libvirtd.service - Virtualization daemon
     Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; preset: disabled)
     Active: active (running) since Tue 2023-09-05 19:56:28 EDT; 2s ago
TriggeredBy: ● libvirtd-ro.socket
             ● libvirtd.socket
             ● libvirtd-tls.socket
             ● libvirtd-tcp.socket
             ● libvirtd-admin.socket
       Docs: man:libvirtd(8)
             https://libvirt.org
   Main PID: 7434 (libvirtd)
      Tasks: 21 (limit: 32768)
     Memory: 51.7M
        CPU: 819ms
     CGroup: /system.slice/libvirtd.service
             ├─1840 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper
             ├─1841 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper
             └─7434 /usr/sbin/libvirtd --timeout 120

(libvirt-daemon is not removed, and everything worked as normal)

Comment 11 Lili Zhu 2023-09-06 08:18:03 UTC
Produce this bug by upgrading from RHEL8 to RHEL9:
1. install virt module on RHEL8
# yum module install virt

2. check whether there are libvirt and libvirt-daemon packages
# rpm -q libvirt
package libvirt is not installed
# rpm -q libvirt-daemon
libvirt-daemon-9.5.0-6.el9.x86_64

(libvirt is not installed)

3. upgrade to rhel9.3

4. execute autoremove
# yum autoremove 
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

Last metadata expiration check: 0:56:22 ago on Wed 06 Sep 2023 03:11:02 AM EDT.
Modular dependency problems:
...
Dependencies resolved.
==============================================================================================================================================================================================
 Package                                                Architecture                      Version                                          Repository                                    Size
==============================================================================================================================================================================================
Removing:
 aspell                                                 x86_64                            12:0.60.6.1-22.el8                               @beaker-AppStream                            3.0 M
 boost-atomic                                           x86_64                            1.75.0-8.el9                                     @System                                       18 k
 boost-chrono                                           x86_64                            1.75.0-8.el9                                     @System                                       38 k
 boost-date-time                                        x86_64                            1.75.0-8.el9                                     @System                                       16 k
 boost-program-options                                  x86_64                            1.75.0-8.el9                                     @System                                      278 k
 boost-random                                           x86_64                            1.75.0-8.el9                                     @System                                       38 k
 boost-regex                                            x86_64                            1.75.0-8.el9                                     @System                                      868 k
 brotli                                                 x86_64                            1.0.9-6.el9                                      @System                                      754 k
 dbus-daemon                                            x86_64                            1:1.12.20-8.el9                                  @System                                      509 k
 dbus-glib                                              x86_64                            0.110-13.el9                                     @System                                      348 k
 dbus-tools                                             x86_64                            1:1.12.20-8.el9                                  @System                                      121 k
 glusterfs                                              x86_64                            6.0-57.4.el9                                     @System                                      2.8 M
 glusterfs-api                                          x86_64                            6.0-57.4.el9                                     @System                                      224 k
 glusterfs-cli                                          x86_64                            6.0-57.4.el9                                     @System                                      520 k
 glusterfs-client-xlators                               x86_64                            6.0-57.4.el9                                     @System                                      3.9 M
 glusterfs-libs                                         x86_64                            6.0-57.4.el9                                     @System                                      1.5 M
 gnupg2-smime                                           x86_64                            2.3.3-4.el9                                      @System                                      555 k
 grub2-tools-extra                                      x86_64                            1:2.06-68.el9                                    @System                                      5.3 M
 hivex                                                  x86_64                            1.3.21-3.el9                                     @System                                      190 k
 info                                                   x86_64                            6.7-15.el9                                       @System                                      496 k
 jasper-libs                                            x86_64                            2.0.28-3.el9                                     @System                                      326 k
 libdb-utils                                            x86_64                            5.3.28-53.el9                                    @System                                      360 k
 libglvnd-gles                                          x86_64                            1:1.3.4-1.el9                                    @System                                      119 k
 libiscsi                                               x86_64                            1.19.0-5.el9                                     @System                                      223 k
 liblockfile                                            x86_64                            1.14-10.el9                                      @System                                       53 k
 libmodman                                              x86_64                            2.0.1-17.el8                                     @beaker-BaseOS                                62 k
 libnsl2                                                x86_64                            2.0.0-1.el9                                      @System                                       58 k
 libsss_autofs                                          x86_64                            2.9.1-2.el9                                      @System                                       65 k
 libvirt-daemon                                         x86_64                            9.5.0-6.el9                                      @System                                      585 k
 memstrack                                              x86_64                            0.2.4-1.el9                                      @System                                      124 k
 mpdecimal                                              x86_64                            2.5.1-3.el9                                      @System                                      200 k
 openssl-pkcs11                                         x86_64                            0.4.11-7.el9                                     @System                                      198 k
 pinentry                                               x86_64                            1.1.1-8.el9                                      @System                                      118 k
....
 qemu-kvm-block-curl                                    x86_64                            17:8.0.0-13.el9                                  @System                                       40 k
 rest                                                   x86_64                            0.8.1-11.el9                                     @System                                      194 k
 sgabios-bin                                            noarch                            1:0.20180715git-8.el9                            @System                                      4.0 k
 sqlite                                                 x86_64                            3.34.1-6.el9_1                                   @System                                      1.5 M

Transaction Summary
==============================================================================================================================================================================================
Remove  49 Packages

Freed space: 90 M
Is this ok [y/N]: y
...

# rpm -q libvirt-daemon
package libvirt-daemon is not installed

(libvirt-daemon is removed)

5. check the unit files
# systemctl list-unit-files |grep virt
libvirt-guests.service                                    disabled        disabled
virtinterfaced.service                                    disabled        disabled
virtlockd.service                                         indirect        disabled
virtlogd.service                                          indirect        disabled
virtnetworkd.service                                      disabled        disabled
virtnodedevd.service                                      disabled        disabled
virtnwfilterd.service                                     disabled        disabled
virtproxyd.service                                        disabled        disabled
virtqemud.service                                         disabled        enabled
virtsecretd.service                                       disabled        disabled
virtstoraged.service                                      disabled        disabled
virtinterfaced-admin.socket                               disabled        disabled
virtinterfaced-ro.socket                                  disabled        disabled
virtinterfaced.socket                                     disabled        enabled
virtlockd-admin.socket                                    disabled        disabled
virtlockd.socket                                          disabled        disabled
virtlogd-admin.socket                                     disabled        disabled
virtlogd.socket                                           disabled        enabled
virtnetworkd-admin.socket                                 disabled        disabled
virtnetworkd-ro.socket                                    disabled        disabled
virtnetworkd.socket                                       disabled        enabled
virtnodedevd-admin.socket                                 disabled        disabled
virtnodedevd-ro.socket                                    disabled        disabled
virtnodedevd.socket                                       disabled        enabled
virtnwfilterd-admin.socket                                disabled        disabled
virtnwfilterd-ro.socket                                   disabled        disabled
virtnwfilterd.socket                                      disabled        enabled
virtproxyd-admin.socket                                   disabled        disabled
virtproxyd-ro.socket                                      disabled        disabled
virtproxyd-tcp.socket                                     disabled        disabled
virtproxyd-tls.socket                                     disabled        disabled
virtproxyd.socket                                         disabled        enabled
virtqemud-admin.socket                                    disabled        disabled
virtqemud-ro.socket                                       disabled        disabled
virtqemud.socket                                          disabled        disabled
virtsecretd-admin.socket                                  disabled        disabled
virtsecretd-ro.socket                                     disabled        disabled
virtsecretd.socket                                        disabled        enabled
virtstoraged-admin.socket                                 disabled        disabled
virtstoraged-ro.socket                                    disabled        disabled
virtstoraged.socket                                       disabled        enabled
virt-guest-shutdown.target                                static          -

(No libvirtd related daemon and sockets left)

Comment 13 Andrea Bolognani 2023-09-06 09:14:13 UTC
(In reply to Lili Zhu from comment #12)
> > Hi, Andrea
> > I feel confused, if this bug was introduced by fixing bug 2210058

No, that bug is unrelated. The issue was introduced by the rebase to
libvirt 9.2.0, which is the first upstream version where it was made
possible for the libvirt-daemon package to be uninstalled without
taking the rest of libvirt with it.

> > I should reproduce this bug with downstream libvirt-9.5.0-6.el9.x86_64,
> > right?

Correct.

> I think for the normal installation step of libvirt in RHEL9,
> # dnf install qemu-kvm libvirt virt-install virt-viewer
> 
> We can not reproduce this bug, since libvirt package depends on
> libvirt-daemon package. We can not autoremove libvirt-daemon after upgrade,
> since libvirt package still exists.
> 
> For the upgrade from RHEL8 to RHEL9, on RHEL8, usually,
> # yum module install virt
> 
> libvirt package is not installed in RHEL8, so after upgrade, we can
> autoremove libvirt-daemon package. 

Right. The libvirt packages has a hard dependency on *all*
subpackages, including libvirt-daemon, so if you have installed it
then it will not be possible for you to pick and choose which parts
you want to keep and which ones you want to remove.

Usually you'd go for a more targeted setup; specifically, for a host
that's going to be a QEMU-based hypervisor, you'd install the
libvirt-daemon-kvm package, which depends on all the libvirt
components needed to make qemu:///system work, as well as qemu-kvm
itself, but none of the other drivers like LXC or Xen.

The libvirt-daemon-kvm package *does not*, as of libvirt-9.5.0-6.el9,
have a dependency on the libvirt-daemon package, so if you have set
up your machine by installing it you should be able to reproduce the
issue this bug report is about after upgrade.

Comment 14 Lili Zhu 2023-09-06 10:04:26 UTC
(In reply to Andrea Bolognani from comment #13)

> 
> Usually you'd go for a more targeted setup; specifically, for a host
> that's going to be a QEMU-based hypervisor, you'd install the
> libvirt-daemon-kvm package, which depends on all the libvirt
> components needed to make qemu:///system work, as well as qemu-kvm
> itself, but none of the other drivers like LXC or Xen.
> 
> The libvirt-daemon-kvm package *does not*, as of libvirt-9.5.0-6.el9,
> have a dependency on the libvirt-daemon package, so if you have set
> up your machine by installing it you should be able to reproduce the
> issue this bug report is about after upgrade.

Great. I will preverify this bug with the method you mentioned. Thanks very much.

Comment 16 Lili Zhu 2023-09-08 03:23:57 UTC
Tested this bug by applying commit in Comment #1 to libvirt-9.5.0-6
1. install libvirt-daemon-kvm
# yum install libvirt-daemon-kvm

2. check the packges installed
# rpm -qa |grep libvirt
libvirt-libs-9.0.0-10.3.el9_2.x86_64
libvirt-client-9.0.0-10.3.el9_2.x86_64
python3-libvirt-9.0.0-1.el9.x86_64
libvirt-daemon-9.0.0-10.3.el9_2.x86_64
libvirt-daemon-driver-storage-core-9.0.0-10.3.el9_2.x86_64
libvirt-daemon-driver-storage-disk-9.0.0-10.3.el9_2.x86_64
libvirt-daemon-driver-storage-iscsi-9.0.0-10.3.el9_2.x86_64
libvirt-daemon-driver-storage-logical-9.0.0-10.3.el9_2.x86_64
libvirt-daemon-driver-storage-mpath-9.0.0-10.3.el9_2.x86_64
libvirt-daemon-driver-storage-rbd-9.0.0-10.3.el9_2.x86_64
libvirt-daemon-driver-storage-scsi-9.0.0-10.3.el9_2.x86_64
libvirt-daemon-driver-storage-9.0.0-10.3.el9_2.x86_64
libvirt-daemon-driver-interface-9.0.0-10.3.el9_2.x86_64
libvirt-daemon-driver-nwfilter-9.0.0-10.3.el9_2.x86_64
libvirt-daemon-driver-qemu-9.0.0-10.3.el9_2.x86_64
libvirt-daemon-driver-secret-9.0.0-10.3.el9_2.x86_64
libvirt-daemon-driver-nodedev-9.0.0-10.3.el9_2.x86_64
libvirt-daemon-driver-network-9.0.0-10.3.el9_2.x86_64
libvirt-daemon-kvm-9.0.0-10.3.el9_2.x86_64

3. switch to monolithic mode
# systemctl list-units |grep virt
  sys-devices-virtual-block-dm\x2d0.device                                                         loaded active plugged   /sys/devices/virtual/block/dm-0
  sys-devices-virtual-block-dm\x2d1.device                                                         loaded active plugged   /sys/devices/virtual/block/dm-1
  sys-devices-virtual-block-dm\x2d2.device                                                         loaded active plugged   /sys/devices/virtual/block/dm-2
  sys-devices-virtual-misc-rfkill.device                                                           loaded active plugged   /sys/devices/virtual/misc/rfkill
  libvirtd-admin.socket                                                                            loaded active listening Libvirt admin socket
  libvirtd-ro.socket                                                                               loaded active listening Libvirt local read-only socket
  libvirtd-tcp.socket                                                                              loaded active listening Libvirt non-TLS IP socket
  libvirtd-tls.socket                                                                              loaded active listening Libvirt TLS IP socket
  libvirtd.socket                                                                                  loaded active listening Libvirt local socket
  virtlockd.socket                                                                                 loaded active listening Virtual machine lock manager socket
  virtlogd.socket                                                                                  loaded active listening Virtual machine log manager socket

4. update the packages
# cd /root/rpmbuild/RPMS/x86_64/ 
# yum update *
 
5. execute autoremove
# yum autoremove
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

Dependencies resolved.
Nothing to do.
Complete!

6. connect to qemu:///system
# virsh -c qemu:///system
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
       'quit' to quit

virsh # 

libvirt-daemon is not autoremoved after upgrade.

Comment 17 Lili Zhu 2023-09-08 09:17:44 UTC
Tested with:
libvirt-daemon-9.5.0-7.el9_3.x86_64

Testing steps are the same with those in Comment #16.

Comment 20 Lili Zhu 2023-09-13 03:20:20 UTC
Verify this bug with:

1. install virt module in RHEL8 os
# yum module install virt

2. check the libvirt units# systemctl list-units |grep virt
sys-devices-virtual-block-dm\x2d0.device                                                         loaded active plugged   /sys/devices/virtual/block/dm-0                                              
sys-devices-virtual-block-dm\x2d1.device                                                         loaded active plugged   /sys/devices/virtual/block/dm-1                                              
sys-devices-virtual-block-dm\x2d2.device                                                         loaded active plugged   /sys/devices/virtual/block/dm-2                                              
sys-devices-virtual-net-virbr0.device                                                            loaded active plugged   /sys/devices/virtual/net/virbr0                                              
libvirtd-admin.socket                                                                            loaded active listening Libvirt admin socket                                                         
libvirtd-ro.socket                                                                               loaded active listening Libvirt local read-only socket                                               
libvirtd.socket                                                                                  loaded active listening Libvirt local socket                                                         
virtlockd.socket                                                                                 loaded active listening Virtual machine lock manager socket                                          
virtlogd.socket                                                                                  loaded active listening Virtual machine log manager socket 

3. upgrade the host to RHEL9

4. check the status after upgrade
# rpm -q libvirt-daemon
libvirt-daemon-9.5.0-7.el9_3.x86_64

# systemctl list-units |grep virt
  sys-devices-virtual-block-dm\x2d0.device                                                         loaded active plugged   /sys/devices/virtual/block/dm-0
  sys-devices-virtual-block-dm\x2d1.device                                                         loaded active plugged   /sys/devices/virtual/block/dm-1
  sys-devices-virtual-block-dm\x2d2.device                                                         loaded active plugged   /sys/devices/virtual/block/dm-2
  sys-devices-virtual-misc-rfkill.device                                                           loaded active plugged   /sys/devices/virtual/misc/rfkill
  sys-devices-virtual-net-virbr0.device                                                            loaded active plugged   /sys/devices/virtual/net/virbr0
  libvirtd-admin.socket                                                                            loaded active listening Libvirt admin socket
  libvirtd-ro.socket                                                                               loaded active listening Libvirt local read-only socket
  libvirtd.socket                                                                                  loaded active listening Libvirt local socket
  virtlockd.socket                                                                                 loaded active listening Virtual machine lock manager socket
  virtlogd.socket                                                                                  loaded active listening Virtual machine log manager socket

5. execute autoremove
# yum autoremove

6. check libvirt-daemon package
# rpm -q libvirt-daemon
libvirt-daemon-9.5.0-7.el9_3.x86_64

7.connect to virtqemud
# virsh -c qemu:///system
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
       'quit' to quit

virsh # 

libvit-daemon is not autoremoved after upgrade, mark the bug as verified.

Comment 21 Andrea Bolognani 2023-09-13 07:52:43 UTC
(In reply to Lili Zhu from comment #20)
> 7.connect to virtqemud
> # virsh -c qemu:///system
> Welcome to virsh, the virtualization interactive terminal.
> 
> Type:  'help' for help with commands
>        'quit' to quit
> 
> virsh # 

Tiny clarification: virsh will connect to libvirtd, not virtqemud.

Since the machine was installed with RHEL 8, which uses the
monolithic daemon (libvirtd) by default, and we intentionally don't
change things around on package upgrade, even after the upgrade to
RHEL 9 it will still use libvirtd despite RHEL 9 using the modular
daemon (virtqemud) by default.

> libvit-daemon is not autoremoved after upgrade, mark the bug as verified.

Thanks!

Comment 22 Lili Zhu 2023-09-13 08:05:24 UTC
(In reply to Andrea Bolognani from comment #21)
> (In reply to Lili Zhu from comment #20)
> > 7.connect to virtqemud
> > # virsh -c qemu:///system
> > Welcome to virsh, the virtualization interactive terminal.
> > 
> > Type:  'help' for help with commands
> >        'quit' to quit
> > 
> > virsh # 
> 
> Tiny clarification: virsh will connect to libvirtd, not virtqemud.
> 
> Since the machine was installed with RHEL 8, which uses the
> monolithic daemon (libvirtd) by default, and we intentionally don't
> change things around on package upgrade, even after the upgrade to
> RHEL 9 it will still use libvirtd despite RHEL 9 using the modular
> daemon (virtqemud) by default.
> 
> > libvit-daemon is not autoremoved after upgrade, mark the bug as verified.
> 
> Thanks!

Aha, yes, good catch. Thanks

Comment 24 errata-xmlrpc 2023-11-07 08:31:48 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 (Moderate: libvirt security, 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/RHSA-2023:6409


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