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 1276239 - Restart libvirtd service should report error when setting negative value for parameters expected unsigned value in qemu.conf
Summary: Restart libvirtd service should report error when setting negative value for ...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.2
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Libvirt Maintainers
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-10-29 08:28 UTC by yafu
Modified: 2016-04-28 20:10 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-10-29 09:01:02 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description yafu 2015-10-29 08:28:26 UTC
Description of problem:
When set the value to negative in the file /etc/libvirt/qemu.conf, 'service libvirtd restart' does not report error and the exited value is '0',but the status of the libvirtd service is inactive. 

Version-Release number of selected component (if applicable):
libvirt-1.2.17-13.el7.x86_64
qemu-kvm-rhev-2.3.0-31.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Set anyone of below value to negative value:
  #cat /etc/libvirt/qemu.conf
   remote_websocket_port_min = -5702
   remote_websocket_port_max = -65535
   remote_display_port_min = -5900  
   remote_display_port_max = -65535
   migration_port_min = -49152
   migration_port_max = -49215
   max_processes = -5
   max_files = -5
   max_queued = -3
2.Restart libvirtd service:
  #systemctl restart libvirtd.service
3.Check the exited value of step 2:
  #echo $?
   0
4.Check the status of libvirtd service:
  #systemctl status libvirtd.service
  ● libvirtd.service - Virtualization daemon
   Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Thu 2015-10-29 16:16:11 CST; 4s ago
     Docs: man:libvirtd(8)
           http://libvirt.org
  Process: 14895 ExecReload=/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCESS)
  Process: 2303 ExecStart=/usr/sbin/libvirtd $LIBVIRTD_ARGS (code=exited, status=0/SUCCESS)
 Main PID: 2303 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/libvirtd.service
           ├─9302 /sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_le...
           └─9303 /sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_le...

Oct 29 16:16:11 yafu-test libvirtd[2303]: 2015-10-29 08:16:11.023+0000: 2432: debug : virFileClose:102 : Closed fd 15
Oct 29 16:16:11 yafu-test libvirtd[2303]: 2015-10-29 08:16:11.023+0000: 2432: debug : virFileClose:102 : Closed fd 16
Oct 29 16:16:11 yafu-test libvirtd[2303]: 2015-10-29 08:16:11.023+0000: 2432: debug : virFileClose:102 : Closed fd 17
Oct 29 16:16:11 yafu-test libvirtd[2303]: 2015-10-29 08:16:11.023+0000: 2432: debug : virFileClose:102 : Closed fd 18
Oct 29 16:16:11 yafu-test libvirtd[2303]: 2015-10-29 08:16:11.023+0000: 2432: debug : virFileClose:102 : Closed fd 19
Oct 29 16:16:11 yafu-test libvirtd[2303]: 2015-10-29 08:16:11.023+0000: 2432: debug : virFileClose:102 : Closed fd 20
Oct 29 16:16:11 yafu-test libvirtd[2303]: 2015-10-29 08:16:11.023+0000: 2432: debug : virFileClose:102 : Closed fd 21
Oct 29 16:16:11 yafu-test libvirtd[2303]: 2015-10-29 08:16:11.023+0000: 2432: debug : virFileClose:102 : Closed fd 22
Oct 29 16:16:11 yafu-test libvirtd[2303]: 2015-10-29 08:16:11.023+0000: 2432: debug : virFileClose:102 : Closed fd 24
Oct 29 16:16:11 yafu-test libvirtd[2303]: 2015-10-29 08:16:11.023+0000: 2432: debug : virFileClose:102 : Closed fd 26


Actual results:
As the output of step 2/3/4 shows,restart libvirtd service output nothing,but the status of libvirtd service is inactive.

Expected results:
Restart libvirtd service should report error when setting negative value for parameters expected unsigned value  in qemu.conf

Additional info:

Comment 1 Peter Krempa 2015-10-29 09:01:02 UTC
The journal output already contains the error.

Oct 29 09:58:25 localhost libvirtd[26017]: Initialization of QEMU state driver failed: internal error: /etc/lib
Oct 29 09:58:25 localhost libvirtd[26017]: Driver state initialization failed

The exit value you are testing comes from systemd, which indicates success to stop and start the new process. The return value does not show whether the daemon was started successfully.

Comment 2 yafu 2015-10-30 06:29:27 UTC
(In reply to Peter Krempa from comment #1)
> The journal output already contains the error.
> 
> Oct 29 09:58:25 localhost libvirtd[26017]: Initialization of QEMU state
> driver failed: internal error: /etc/lib
> Oct 29 09:58:25 localhost libvirtd[26017]: Driver state initialization failed
> 
> The exit value you are testing comes from systemd, which indicates success
> to stop and start the new process. The return value does not show whether
> the daemon was started successfully.

The exit value comes from the exit value of libvirtd process,systemd just accept the value. Where the exit value comes from can check with the command 'strace libvirtd --listen'.
If the wrong setting of qemu.conf will interrupt libvirtd process,maybe it's better to exit the libvirtd process with non-zero value and report the error to the user.It also can avoid confusing the user who use 'systemctl restart libvirtd.service' to restart libvirtd and just check the exit value as the result.


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