Fix daemon startup to avoid destroying networking

This commit is contained in:
Daniel P. Berrange 2008-03-10 21:36:01 +00:00
parent 263e2f2021
commit 81e46cb6da
3 changed files with 59 additions and 27 deletions

View File

@ -1,26 +1,5 @@
libvirt-0.0.3.tar.gz
libvirt-0.0.4.tar.gz
libvirt-0.0.5.tar.gz
libvirt-0.0.6.tar.gz
libvirt-0.1.0.tar.gz
libvirt-0.1.2.tar.gz
libvirt-0.1.1.tar.gz
libvirt-0.1.3.tar.gz
libvirt-0.1.4.tar.gz
libvirt-0.1.5.tar.gz
libvirt-0.1.6.tar.gz
libvirt-0.1.7.tar.gz
libvirt-0.1.8.tar.gz
libvirt-0.1.9.tar.gz
libvirt-0.1.10.tar.gz
libvirt-0.1.11.tar.gz
libvirt-0.2.0.tar.gz
libvirt-0.2.1.tar.gz
libvirt-0.2.2.tar.gz
libvirt-0.2.3.tar.gz
libvirt-0.3.0.tar.gz
libvirt-0.3.1.tar.gz
libvirt-0.3.2.tar.gz
libvirt-0.3.3.tar.gz
libvirt-0.4.0.tar.gz
libvirt-0.4.1.tar.gz
.build*.log
*.rpm
i686
x86_64
libvirt-*.tar.gz

View File

@ -0,0 +1,48 @@
diff -rup libvirt-0.4.1.orig/qemud/qemud.c libvirt-0.4.1.new/qemud/qemud.c
--- libvirt-0.4.1.orig/qemud/qemud.c 2008-03-10 17:31:09.000000000 -0400
+++ libvirt-0.4.1.new/qemud/qemud.c 2008-03-10 17:31:36.000000000 -0400
@@ -393,7 +393,7 @@ static int qemudGoDaemon(void) {
case -1:
return -1;
default:
- return nextpid;
+ _exit(0);
}
cleanup:
@@ -418,8 +418,7 @@ static int qemudGoDaemon(void) {
status != 0) {
return -1;
}
-
- return pid;
+ _exit(0);
}
}
}
@@ -2116,16 +2115,12 @@ int main(int argc, char **argv) {
goto error1;
if (godaemon) {
- int pid;
openlog("libvirtd", 0, 0);
- pid = qemudGoDaemon();
- if (pid < 0) {
+ if (qemudGoDaemon() < 0) {
qemudLog(QEMUD_ERR, _("Failed to fork as daemon: %s"),
strerror(errno));
goto error1;
}
- if (pid > 0)
- goto out;
/* Choose the name of the PID file. */
if (!pid_file) {
@@ -2172,7 +2167,6 @@ int main(int argc, char **argv) {
if (godaemon)
closelog();
- out:
ret = 0;
error2:

View File

@ -21,12 +21,13 @@
Summary: Library providing a simple API virtualization
Name: libvirt
Version: 0.4.1
Release: 2%{?dist}%{?extra_release}
Release: 3%{?dist}%{?extra_release}
License: LGPL
Group: Development/Libraries
Source: libvirt-%{version}.tar.gz
Patch0: libvirt-0.4.1-qemud1.patch
Patch1: libvirt-0.4.1-qemud2.patch
Patch2: %{name}-%{version}-daemon-startup.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-root
URL: http://libvirt.org/
BuildRequires: python python-devel
@ -140,6 +141,7 @@ of recent versions of Linux (and other OSes).
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%build
# Xen is available only on i386 x86_64 ia64
@ -280,6 +282,9 @@ fi
%doc docs/examples/python
%changelog
* Mon Mar 10 2008 Daniel P. Berrange <berrange@redhat.com> - 0.4.1-3.fc9
- Fixed daemon startup when run with --daemon flag
* Mon Mar 3 2008 Daniel Veillard <veillard@redhat.com> - 0.4.1-2.fc9
- 2 patches found just after the release