forked from photron/msys_setup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlibvirt-0.8.1-mingw.patch
173 lines (151 loc) · 4.77 KB
/
libvirt-0.8.1-mingw.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
diff -u -r a/configure.ac b/configure.ac
--- a/configure.ac 2010-04-30 16:16:44 +0000
+++ b/configure.ac 2010-05-01 10:48:40 +0000
@@ -78,7 +78,6 @@
VERSION_SCRIPT_FLAGS=-Wl,--version-script=
`$LD --help 2>&1 | grep -- --version-script >/dev/null` || \
VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,"
-AC_SUBST(VERSION_SCRIPT_FLAGS)
LIBVIRT_COMPILE_WARNINGS([maximum])
@@ -1824,10 +1823,11 @@
# from libvirt.syms and passes libvirt.def instead of libvirt.syms to the linker
LIBVIRT_SYMBOL_FILE=libvirt.def
# mingw's ld has the --version-script parameter, but it requires a .def file
- # instead to work properly, therefore clear --version-script here
+ # instead to work properly, therefore clear --version-script here and use
+ # -Wl, to pass the .def file to the linker
# cygwin's ld has the --version-script parameter too, but for some reason
# it's working there as expected
- VERSION_SCRIPT_FLAGS=
+ VERSION_SCRIPT_FLAGS="-Wl,"
;;
esac
AC_SUBST([CYGWIN_EXTRA_LDFLAGS])
@@ -1836,6 +1836,7 @@
AC_SUBST([MINGW_EXTRA_LDFLAGS])
AC_SUBST([WIN32_EXTRA_CFLAGS])
AC_SUBST([LIBVIRT_SYMBOL_FILE])
+AC_SUBST([VERSION_SCRIPT_FLAGS])
dnl Look for windres to build a Windows icon resource.
diff -u -r a/src/libvirt_private.syms b/src/libvirt_private.syms
--- a/src/libvirt_private.syms 2010-04-30 15:45:44 +0000
+++ b/src/libvirt_private.syms 2010-05-01 13:04:08 +0000
@@ -623,7 +623,6 @@
virCondInit;
virCondDestroy;
virCondWait;
-virCondWaitUntil;
virCondSignal;
virCondBroadcast;
@@ -667,7 +666,6 @@
virFileLinkPointsTo;
virParseNumber;
virParseVersionString;
-virPipeReadUntilEOF;
virAsprintf;
virRun;
virSkipSpaces;
diff -u -r a/src/util/dnsmasq.c b/src/util/dnsmasq.c
--- a/src/util/dnsmasq.c 2010-04-26 15:20:26 +0000
+++ b/src/util/dnsmasq.c 2010-05-01 12:08:22 +0000
@@ -80,17 +80,17 @@
const char *name)
{
if (VIR_REALLOC_N(hostsfile->hosts, hostsfile->nhosts + 1) < 0)
- goto alloc_error;
+ goto no_memory;
if (name) {
if (virAsprintf(&hostsfile->hosts[hostsfile->nhosts].host, "%s,%s,%s",
- mac, ip, name) < 0) {
- goto alloc_error;
+ mac, ip, name) < 0) {
+ goto no_memory;
}
} else {
if (virAsprintf(&hostsfile->hosts[hostsfile->nhosts].host, "%s,%s",
- mac, ip) < 0) {
- goto alloc_error;
+ mac, ip) < 0) {
+ goto no_memory;
}
}
@@ -98,10 +98,9 @@
return 0;
- alloc_error:
- virReportSystemError(ENOMEM,
- _("Failed to add dhcp host entry: mac=%s, ip=%s, name=%s\n"),
- mac, ip, (name ? name : "(null)"));
+ no_memory:
+ virReportOOMError();
+
return -1;
}
@@ -112,20 +111,23 @@
int err;
dnsmasqHostsfile *hostsfile;
- if (VIR_ALLOC(hostsfile) < 0)
+ if (VIR_ALLOC(hostsfile) < 0) {
+ virReportOOMError();
return NULL;
+ }
hostsfile->hosts = NULL;
hostsfile->nhosts = 0;
if (virAsprintf(&hostsfile->path, "%s/%s.%s", config_dir, name,
- DNSMASQ_HOSTSFILE_SUFFIX) < 0) {
+ DNSMASQ_HOSTSFILE_SUFFIX) < 0) {
+ virReportOOMError();
goto error;
}
if ((err = virFileMakePath(config_dir))) {
virReportSystemError(err, _("cannot create config directory '%s'"),
- config_dir);
+ config_dir);
goto error;
}
@@ -201,11 +203,11 @@
hostsfileSave(dnsmasqHostsfile *hostsfile)
{
int err = hostsfileWrite(hostsfile->path, hostsfile->hosts,
- hostsfile->nhosts);
+ hostsfile->nhosts);
if (err < 0) {
virReportSystemError(err, _("cannot write config file '%s'"),
- hostsfile->path);
+ hostsfile->path);
return -1;
}
@@ -220,7 +222,7 @@
if (unlink(hostsfile->path) < 0) {
virReportSystemError(errno, _("cannot remove config file '%s'"),
- hostsfile->path);
+ hostsfile->path);
return -1;
}
@@ -240,8 +242,10 @@
{
dnsmasqContext *ctx;
- if (VIR_ALLOC(ctx) < 0)
+ if (VIR_ALLOC(ctx) < 0) {
+ virReportOOMError();
return NULL;
+ }
if (!(ctx->hostsfile = hostsfileNew(network_name, config_dir)))
goto error;
@@ -328,14 +332,16 @@
* Reloads all the configurations associated to a context
*/
int
-dnsmasqReload(pid_t pid)
+dnsmasqReload(pid_t pid ATTRIBUTE_UNUSED)
{
+#ifndef WIN32
if (kill(pid, SIGHUP) != 0) {
virReportSystemError(errno,
- _("Failed to make dnsmasq (PID: %d) reload config files.\n"),
+ _("Failed to make dnsmasq (PID: %d) reload config files"),
pid);
return -1;
}
+#endif
return 0;
}