* [Qemu-devel] [PULL 00/10] Fixes for Cocoa backend
@ 2011-06-14 1:21 Andreas Färber
2011-06-14 1:21 ` [Qemu-devel] [PATCH 01/10] cocoa: do not create a spurious window for -version Andreas Färber
2011-06-15 19:31 ` [Qemu-devel] [PULL 00/10] Fixes for Cocoa backend Blue Swirl
0 siblings, 2 replies; 13+ messages in thread
From: Andreas Färber @ 2011-06-14 1:21 UTC (permalink / raw)
To: qemu-devel; +Cc: Blue Swirl, Andreas Färber
Hello,
I've collected a number of warning and usability fixes for the Cocoa frontend
and Darwin host. Please pull.
Cc: Blue Swirl <blauwirbel@gmail.com>
The following changes since commit 0b862cedf36d927818c50584ddd611b0370673df:
configure: Detect and don't try to use older libcurl (2011-06-13 21:16:27 +0200)
are available in the git repository at:
git://repo.or.cz/qemu/afaerber.git cocoa-for-upstream
Alexandre Raymond (5):
Fix compilation warning due to incorrectly specified type
Cocoa: avoid displaying window when command-line contains '-h' or
'-help'
Remove warning in printf due to type mismatch
configure: Fix check for fdatasync()
Darwin: Fix compilation warning regarding the deprecated daemon()
function
Andreas Färber (4):
Fix libfdt warnings on Darwin
cocoa: Provide central qemu_main() prototype
cocoa: Revert dependency on VNC
cocoa: Avoid warning related to multiple handleEvent: definitions
Tristan Gingold (1):
cocoa: do not create a spurious window for -version
Makefile.objs | 2 +-
audio/coreaudio.c | 2 +-
configure | 8 +++++++-
libfdt_env.h | 8 ++------
osdep.h | 1 +
oslib-posix.c | 16 ++++++++++++++++
qemu-common.h | 5 +++++
qemu-nbd.c | 2 +-
target-lm32/translate.c | 2 +-
ui/cocoa.m | 25 ++++++++++++++++++-------
10 files changed, 53 insertions(+), 18 deletions(-)
--
1.7.5.3
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 01/10] cocoa: do not create a spurious window for -version
2011-06-14 1:21 [Qemu-devel] [PULL 00/10] Fixes for Cocoa backend Andreas Färber
@ 2011-06-14 1:21 ` Andreas Färber
2011-06-14 1:21 ` [Qemu-devel] [PATCH 02/10] Fix compilation warning due to incorrectly specified type Andreas Färber
2011-06-15 19:31 ` [Qemu-devel] [PULL 00/10] Fixes for Cocoa backend Blue Swirl
1 sibling, 1 reply; 13+ messages in thread
From: Andreas Färber @ 2011-06-14 1:21 UTC (permalink / raw)
To: qemu-devel; +Cc: Andreas Färber, Tristan Gingold
From: Tristan Gingold <gingold@adacore.com>
When invoked with -version, qemu will exit just after displaying the version,
so there is no need to create a window.
Also handles --XXX options.
Signed-off-by: Tristan Gingold <gingold@adacore.com>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
---
ui/cocoa.m | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/ui/cocoa.m b/ui/cocoa.m
index 20f91bc..1ff1ac6 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -865,10 +865,19 @@ int main (int argc, const char * argv[]) {
/* In case we don't need to display a window, let's not do that */
for (i = 1; i < argc; i++) {
- if (!strcmp(argv[i], "-vnc") ||
- !strcmp(argv[i], "-nographic") ||
- !strcmp(argv[i], "-curses")) {
+ const char *opt = argv[i];
+
+ if (opt[0] == '-') {
+ /* Treat --foo the same as -foo. */
+ if (opt[1] == '-') {
+ opt++;
+ }
+ if (!strcmp(opt, "-vnc") ||
+ !strcmp(opt, "-nographic") ||
+ !strcmp(opt, "-version") ||
+ !strcmp(opt, "-curses")) {
return qemu_main(gArgc, gArgv);
+ }
}
}
--
1.7.5.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 02/10] Fix compilation warning due to incorrectly specified type
2011-06-14 1:21 ` [Qemu-devel] [PATCH 01/10] cocoa: do not create a spurious window for -version Andreas Färber
@ 2011-06-14 1:21 ` Andreas Färber
2011-06-14 1:22 ` [Qemu-devel] [PATCH 03/10] Cocoa: avoid displaying window when command-line contains '-h' or '-help' Andreas Färber
0 siblings, 1 reply; 13+ messages in thread
From: Andreas Färber @ 2011-06-14 1:21 UTC (permalink / raw)
To: qemu-devel; +Cc: Alexandre Raymond, Andreas Färber
From: Alexandre Raymond <cerbere@gmail.com>
In audio/coreaudio.c, a variable named "str" was assigned "const char" values,
which resulted in the following warnings:
-----8<-----
audio/coreaudio.c: In function ‘coreaudio_logstatus’:
audio/coreaudio.c:59: warning: initialization discards qualifiers from pointer target type
audio/coreaudio.c:63: warning: assignment discards qualifiers from pointer target type
(...)
-----8<-----
Signed-off-by: Alexandre Raymond <cerbere@gmail.com>
Acked-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
---
audio/coreaudio.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/audio/coreaudio.c b/audio/coreaudio.c
index 0a26413..3bd75cd 100644
--- a/audio/coreaudio.c
+++ b/audio/coreaudio.c
@@ -56,7 +56,7 @@ typedef struct coreaudioVoiceOut {
static void coreaudio_logstatus (OSStatus status)
{
- char *str = "BUG";
+ const char *str = "BUG";
switch(status) {
case kAudioHardwareNoError:
--
1.7.5.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 03/10] Cocoa: avoid displaying window when command-line contains '-h' or '-help'
2011-06-14 1:21 ` [Qemu-devel] [PATCH 02/10] Fix compilation warning due to incorrectly specified type Andreas Färber
@ 2011-06-14 1:22 ` Andreas Färber
2011-06-14 1:22 ` [Qemu-devel] [PATCH 04/10] Remove warning in printf due to type mismatch Andreas Färber
0 siblings, 1 reply; 13+ messages in thread
From: Andreas Färber @ 2011-06-14 1:22 UTC (permalink / raw)
To: qemu-devel; +Cc: Alexandre Raymond, Andreas Färber
From: Alexandre Raymond <cerbere@gmail.com>
There was already a check in place to avoid displaying a window
in certain modes such as vnc, nographic or curses.
Add a check for '-h' and '-help' to avoid displaying a window for a split-
second before showing the usage information.
Signed-off-by: Alexandre Raymond <cerbere@gmail.com>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
---
ui/cocoa.m | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/ui/cocoa.m b/ui/cocoa.m
index 1ff1ac6..e1312d3 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -872,7 +872,8 @@ int main (int argc, const char * argv[]) {
if (opt[1] == '-') {
opt++;
}
- if (!strcmp(opt, "-vnc") ||
+ if (!strcmp(opt, "-h") || !strcmp(opt, "-help") ||
+ !strcmp(opt, "-vnc") ||
!strcmp(opt, "-nographic") ||
!strcmp(opt, "-version") ||
!strcmp(opt, "-curses")) {
--
1.7.5.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 04/10] Remove warning in printf due to type mismatch
2011-06-14 1:22 ` [Qemu-devel] [PATCH 03/10] Cocoa: avoid displaying window when command-line contains '-h' or '-help' Andreas Färber
@ 2011-06-14 1:22 ` Andreas Färber
2011-06-14 1:22 ` [Qemu-devel] [PATCH 05/10] configure: Fix check for fdatasync() Andreas Färber
0 siblings, 1 reply; 13+ messages in thread
From: Andreas Färber @ 2011-06-14 1:22 UTC (permalink / raw)
To: qemu-devel; +Cc: Alexandre Raymond, Andreas Färber
From: Alexandre Raymond <cerbere@gmail.com>
----8<----
qemu/target-lm32/translate.c: In function ‘gen_intermediate_code_internal’:
qemu/target-lm32/translate.c:1135: warning: format ‘%zd’ expects type ‘signed size_t’, but argument 4 has type ‘int’
----8<----
Both gen_opc_ptr and gen_opc_buf are "uint16_t *". The difference between
pointers is a ptrdiff_t so printf needs '%td'.
Signed-off-by: Alexandre Raymond <cerbere@gmail.com>
Acked-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
---
target-lm32/translate.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/target-lm32/translate.c b/target-lm32/translate.c
index eb21158..5e19725 100644
--- a/target-lm32/translate.c
+++ b/target-lm32/translate.c
@@ -1132,7 +1132,7 @@ static void gen_intermediate_code_internal(CPUState *env,
if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)) {
qemu_log("\n");
log_target_disas(pc_start, dc->pc - pc_start, 0);
- qemu_log("\nisize=%d osize=%zd\n",
+ qemu_log("\nisize=%d osize=%td\n",
dc->pc - pc_start, gen_opc_ptr - gen_opc_buf);
}
#endif
--
1.7.5.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 05/10] configure: Fix check for fdatasync()
2011-06-14 1:22 ` [Qemu-devel] [PATCH 04/10] Remove warning in printf due to type mismatch Andreas Färber
@ 2011-06-14 1:22 ` Andreas Färber
2011-06-14 1:22 ` [Qemu-devel] [PATCH 06/10] Fix libfdt warnings on Darwin Andreas Färber
0 siblings, 1 reply; 13+ messages in thread
From: Andreas Färber @ 2011-06-14 1:22 UTC (permalink / raw)
To: qemu-devel; +Cc: Alexandre Raymond, Andreas Färber
From: Alexandre Raymond <cerbere@gmail.com>
Under Darwin, a symbol exists for the fdatasync() function, so that our
link test succeeds. However _POSIX_SYNCHRONIZED_IO is set to '-1'.
According to POSIX:2008, a value of -1 means the feature is not supported.
A value of 0 means supported at compilation time, and a value greater 0
means supported at both compilation and run time.
Enable fdatasync() only if _POSIX_SYNCHRONIZED_IO is '>0'.
Signed-off-by: Alexandre Raymond <cerbere@gmail.com>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
---
configure | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/configure b/configure
index c931ae8..6101f4e 100755
--- a/configure
+++ b/configure
@@ -2461,7 +2461,13 @@ fi
fdatasync=no
cat > $TMPC << EOF
#include <unistd.h>
-int main(void) { return fdatasync(0); }
+int main(void) {
+#if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0
+return fdatasync(0);
+#else
+#abort Not supported
+#endif
+}
EOF
if compile_prog "" "" ; then
fdatasync=yes
--
1.7.5.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 06/10] Fix libfdt warnings on Darwin
2011-06-14 1:22 ` [Qemu-devel] [PATCH 05/10] configure: Fix check for fdatasync() Andreas Färber
@ 2011-06-14 1:22 ` Andreas Färber
2011-06-14 1:22 ` [Qemu-devel] [PATCH 07/10] cocoa: Provide central qemu_main() prototype Andreas Färber
0 siblings, 1 reply; 13+ messages in thread
From: Andreas Färber @ 2011-06-14 1:22 UTC (permalink / raw)
To: qemu-devel; +Cc: Andreas Färber, Hollis Blanchard
Building with libfdt results in the following warnings on Mac OS X:
CC ppc-softmmu/device_tree.o
In file included from /Users/andreas/QEMU/latest64/include/libfdt.h:54,
from /Users/andreas/QEMU/qemu/device_tree.c:26:
/Users/andreas/QEMU/qemu/libfdt_env.h:25:20: warning: endian.h: No such file or directory
/Users/andreas/QEMU/qemu/libfdt_env.h:26:22: warning: byteswap.h: No such file or directory
/Users/andreas/QEMU/qemu/libfdt_env.h:28:5: warning: "__BYTE_ORDER" is not defined
/Users/andreas/QEMU/qemu/libfdt_env.h:28:21: warning: "__BIG_ENDIAN" is not defined
Since QEMU's copy of libfdt_env.h only uses bswap_32() and bswap_64(),
let QEMU's bswap.h take care of the headers and use its endianness define.
Cc: Hollis Blanchard <hollis@penguinppc.org>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Acked-by: Alexander Graf <agraf@suse.de>
---
libfdt_env.h | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/libfdt_env.h b/libfdt_env.h
index ee0419f..90d7f3b 100644
--- a/libfdt_env.h
+++ b/libfdt_env.h
@@ -19,13 +19,9 @@
#ifndef _LIBFDT_ENV_H
#define _LIBFDT_ENV_H
-#include <stddef.h>
-#include <stdint.h>
-#include <string.h>
-#include <endian.h>
-#include <byteswap.h>
+#include "bswap.h"
-#if __BYTE_ORDER == __BIG_ENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
#define fdt32_to_cpu(x) (x)
#define cpu_to_fdt32(x) (x)
#define fdt64_to_cpu(x) (x)
--
1.7.5.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 07/10] cocoa: Provide central qemu_main() prototype
2011-06-14 1:22 ` [Qemu-devel] [PATCH 06/10] Fix libfdt warnings on Darwin Andreas Färber
@ 2011-06-14 1:22 ` Andreas Färber
2011-06-14 1:22 ` [Qemu-devel] [PATCH 08/10] cocoa: Revert dependency on VNC Andreas Färber
0 siblings, 1 reply; 13+ messages in thread
From: Andreas Färber @ 2011-06-14 1:22 UTC (permalink / raw)
To: qemu-devel; +Cc: Alexandre Raymond, Andreas Färber
This fixes a missing prototype warning in vl.c and obsoletes
the prototype in cocoa.m. Adjust callers in cocoa.m to supply
third argument, which is currently only used on Linux/ppc.
The prototype is designed so that it could be shared with SDL
and other frontends, if desired.
Cc: Alexandre Raymond <cerbere@gmail.com>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
---
qemu-common.h | 5 +++++
ui/cocoa.m | 6 +++---
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/qemu-common.h b/qemu-common.h
index 39fabc9..109498d 100644
--- a/qemu-common.h
+++ b/qemu-common.h
@@ -132,6 +132,11 @@ static inline char *realpath(const char *path, char *resolved_path)
#endif /* !defined(NEED_CPU_H) */
+/* main function, renamed */
+#if defined(CONFIG_COCOA)
+int qemu_main(int argc, char **argv, char **envp);
+#endif
+
/* bottom halves */
typedef void QEMUBHFunc(void *opaque);
diff --git a/ui/cocoa.m b/ui/cocoa.m
index e1312d3..1c54759 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -23,6 +23,7 @@
*/
#import <Cocoa/Cocoa.h>
+#include <crt_externs.h>
#include "qemu-common.h"
#include "console.h"
@@ -61,7 +62,6 @@ typedef struct {
int bitsPerPixel;
} QEMUScreen;
-int qemu_main(int argc, char **argv); // main defined in qemu/vl.c
NSWindow *normalWindow;
id cocoaView;
static DisplayChangeListener *dcl;
@@ -794,7 +794,7 @@ static int cocoa_keycode_to_qemu(int keycode)
COCOA_DEBUG("QemuCocoaAppController: startEmulationWithArgc\n");
int status;
- status = qemu_main(argc, argv);
+ status = qemu_main(argc, argv, *_NSGetEnviron());
exit(status);
}
@@ -877,7 +877,7 @@ int main (int argc, const char * argv[]) {
!strcmp(opt, "-nographic") ||
!strcmp(opt, "-version") ||
!strcmp(opt, "-curses")) {
- return qemu_main(gArgc, gArgv);
+ return qemu_main(gArgc, gArgv, *_NSGetEnviron());
}
}
}
--
1.7.5.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 08/10] cocoa: Revert dependency on VNC
2011-06-14 1:22 ` [Qemu-devel] [PATCH 07/10] cocoa: Provide central qemu_main() prototype Andreas Färber
@ 2011-06-14 1:22 ` Andreas Färber
2011-06-14 1:22 ` [Qemu-devel] [PATCH 09/10] cocoa: Avoid warning related to multiple handleEvent: definitions Andreas Färber
2011-06-27 14:48 ` [Qemu-devel] [PATCH 08/10] cocoa: Revert dependency on VNC Jes Sorensen
0 siblings, 2 replies; 13+ messages in thread
From: Andreas Färber @ 2011-06-14 1:22 UTC (permalink / raw)
To: qemu-devel; +Cc: Jes Sorensen, Andreas Färber, Anthony Liguori
In 821601ea5b02a68ada479731a4d3d07a9876632a (Make VNC support optional)
cocoa.o was moved from ui-obj-$(CONFIG_COCOA) to vnc-obj-$(CONFIG_COCOA),
adding a dependency on $(CONFIG_VNC). That must've been unintentional.
Cc: Jes Sorensen <Jes.Sorensen@redhat.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
---
Makefile.objs | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Makefile.objs b/Makefile.objs
index 52d8b23..509ab39 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -128,6 +128,7 @@ common-obj-y += $(addprefix audio/, $(audio-obj-y))
ui-obj-y += keymaps.o
ui-obj-$(CONFIG_SDL) += sdl.o sdl_zoom.o x_keymap.o
+ui-obj-$(CONFIG_COCOA) += cocoa.o
ui-obj-$(CONFIG_CURSES) += curses.o
vnc-obj-y += vnc.o d3des.o
vnc-obj-y += vnc-enc-zlib.o vnc-enc-hextile.o
@@ -135,7 +136,6 @@ vnc-obj-y += vnc-enc-tight.o vnc-palette.o
vnc-obj-y += vnc-enc-zrle.o
vnc-obj-$(CONFIG_VNC_TLS) += vnc-tls.o vnc-auth-vencrypt.o
vnc-obj-$(CONFIG_VNC_SASL) += vnc-auth-sasl.o
-vnc-obj-$(CONFIG_COCOA) += cocoa.o
ifdef CONFIG_VNC_THREAD
vnc-obj-y += vnc-jobs-async.o
else
--
1.7.5.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 09/10] cocoa: Avoid warning related to multiple handleEvent: definitions
2011-06-14 1:22 ` [Qemu-devel] [PATCH 08/10] cocoa: Revert dependency on VNC Andreas Färber
@ 2011-06-14 1:22 ` Andreas Färber
2011-06-14 1:22 ` [Qemu-devel] [PATCH 10/10] Darwin: Fix compilation warning regarding the deprecated daemon() function Andreas Färber
2011-06-27 14:48 ` [Qemu-devel] [PATCH 08/10] cocoa: Revert dependency on VNC Jes Sorensen
1 sibling, 1 reply; 13+ messages in thread
From: Andreas Färber @ 2011-06-14 1:22 UTC (permalink / raw)
To: qemu-devel; +Cc: Andreas Färber
Avoid compiler confusion as to which method signature to use for the
handleEvent: selector on OSX >= 10.6 by making the variable type-safe
as opposed to generic 'id' type.
Requires moving the variable definition to after the class definition.
----8<----
ui/cocoa.m: In function ‘cocoa_refresh’:
ui/cocoa.m:997: warning: multiple methods named ‘-handleEvent:’ found
/System/Library/Frameworks/AppKit.framework/Headers/NSTextInputContext.h:84: warning: using ‘-(BOOL)handleEvent:(NSEvent *)theEvent’
ui/cocoa.m:272: warning: also found ‘-(void)handleEvent:(NSEvent *)event’
----8<---
Reported-by: Alexandre Raymond <cerbere@gmail.com>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Tested-by: Alexandre Raymond <cerbere@gmail.com>
---
ui/cocoa.m | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/ui/cocoa.m b/ui/cocoa.m
index 1c54759..515e684 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -63,7 +63,6 @@ typedef struct {
} QEMUScreen;
NSWindow *normalWindow;
-id cocoaView;
static DisplayChangeListener *dcl;
int gArgc;
@@ -278,6 +277,8 @@ static int cocoa_keycode_to_qemu(int keycode)
- (QEMUScreen) gscreen;
@end
+QemuCocoaView *cocoaView;
+
@implementation QemuCocoaView
- (id)initWithFrame:(NSRect)frameRect
{
--
1.7.5.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 10/10] Darwin: Fix compilation warning regarding the deprecated daemon() function
2011-06-14 1:22 ` [Qemu-devel] [PATCH 09/10] cocoa: Avoid warning related to multiple handleEvent: definitions Andreas Färber
@ 2011-06-14 1:22 ` Andreas Färber
0 siblings, 0 replies; 13+ messages in thread
From: Andreas Färber @ 2011-06-14 1:22 UTC (permalink / raw)
To: qemu-devel; +Cc: Alexandre Raymond, Blue Swirl, Andreas Färber
From: Alexandre Raymond <cerbere@gmail.com>
Changes since v1: create a wrapper function named qemu_daemon() in oslib-posix.c
instead of putting the OS specific workaround in qemu-nbd.c directly.
On OSX >= 10.5, daemon() is deprecated, resulting in the following warning:
----8<----
qemu-nbd.c: In function ‘main’:
qemu-nbd.c:371: warning: ‘daemon’ is deprecated (declared at /usr/include/stdlib.h:289)
----8<----
The following trick, used in mDNSResponder, takes care of this warning:
http://www.opensource.apple.com/source/mDNSResponder/mDNSResponder-258.18/mDNSPosix/PosixDaemon.c
On OSX, it temporarily renames the daemon() function before including stdlib.h
and declares it manually as an extern function. This way, the compiler does not
see the declaration from stdlib.h and thus does not display the warning.
Signed-off-by: Alexandre Raymond <cerbere@gmail.com>
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
---
osdep.h | 1 +
oslib-posix.c | 16 ++++++++++++++++
qemu-nbd.c | 2 +-
3 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/osdep.h b/osdep.h
index 970d767..6eb9a49 100644
--- a/osdep.h
+++ b/osdep.h
@@ -88,6 +88,7 @@
# define QEMU_GNUC_PREREQ(maj, min) 0
#endif
+int qemu_daemon(int nochdir, int noclose);
void *qemu_memalign(size_t alignment, size_t size);
void *qemu_vmalloc(size_t size);
void qemu_vfree(void *ptr);
diff --git a/oslib-posix.c b/oslib-posix.c
index 7bc5f7c..3a18e86 100644
--- a/oslib-posix.c
+++ b/oslib-posix.c
@@ -26,11 +26,27 @@
* THE SOFTWARE.
*/
+/* The following block of code temporarily renames the daemon() function so the
+ compiler does not see the warning associated with it in stdlib.h on OSX */
+#ifdef __APPLE__
+#define daemon qemu_fake_daemon_function
+#include <stdlib.h>
+#undef daemon
+extern int daemon(int, int);
+#endif
+
#include "config-host.h"
#include "sysemu.h"
#include "trace.h"
#include "qemu_socket.h"
+
+
+int qemu_daemon(int nochdir, int noclose)
+{
+ return daemon(nochdir, noclose);
+}
+
void *qemu_oom_check(void *ptr)
{
if (ptr == NULL) {
diff --git a/qemu-nbd.c b/qemu-nbd.c
index 110d78e..d91c02c 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -359,7 +359,7 @@ int main(int argc, char **argv)
if (!verbose) {
/* detach client and server */
- if (daemon(0, 0) == -1) {
+ if (qemu_daemon(0, 0) == -1) {
err(EXIT_FAILURE, "Failed to daemonize");
}
}
--
1.7.5.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [Qemu-devel] [PULL 00/10] Fixes for Cocoa backend
2011-06-14 1:21 [Qemu-devel] [PULL 00/10] Fixes for Cocoa backend Andreas Färber
2011-06-14 1:21 ` [Qemu-devel] [PATCH 01/10] cocoa: do not create a spurious window for -version Andreas Färber
@ 2011-06-15 19:31 ` Blue Swirl
1 sibling, 0 replies; 13+ messages in thread
From: Blue Swirl @ 2011-06-15 19:31 UTC (permalink / raw)
To: Andreas Färber; +Cc: qemu-devel
On Tue, Jun 14, 2011 at 4:21 AM, Andreas Färber <andreas.faerber@web.de> wrote:
> Hello,
>
> I've collected a number of warning and usability fixes for the Cocoa frontend
> and Darwin host. Please pull.
>
> Cc: Blue Swirl <blauwirbel@gmail.com>
Thanks, pulled.
> The following changes since commit 0b862cedf36d927818c50584ddd611b0370673df:
>
> configure: Detect and don't try to use older libcurl (2011-06-13 21:16:27 +0200)
>
> are available in the git repository at:
> git://repo.or.cz/qemu/afaerber.git cocoa-for-upstream
>
> Alexandre Raymond (5):
> Fix compilation warning due to incorrectly specified type
> Cocoa: avoid displaying window when command-line contains '-h' or
> '-help'
> Remove warning in printf due to type mismatch
> configure: Fix check for fdatasync()
> Darwin: Fix compilation warning regarding the deprecated daemon()
> function
>
> Andreas Färber (4):
> Fix libfdt warnings on Darwin
> cocoa: Provide central qemu_main() prototype
> cocoa: Revert dependency on VNC
> cocoa: Avoid warning related to multiple handleEvent: definitions
>
> Tristan Gingold (1):
> cocoa: do not create a spurious window for -version
>
> Makefile.objs | 2 +-
> audio/coreaudio.c | 2 +-
> configure | 8 +++++++-
> libfdt_env.h | 8 ++------
> osdep.h | 1 +
> oslib-posix.c | 16 ++++++++++++++++
> qemu-common.h | 5 +++++
> qemu-nbd.c | 2 +-
> target-lm32/translate.c | 2 +-
> ui/cocoa.m | 25 ++++++++++++++++++-------
> 10 files changed, 53 insertions(+), 18 deletions(-)
>
> --
> 1.7.5.3
>
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Qemu-devel] [PATCH 08/10] cocoa: Revert dependency on VNC
2011-06-14 1:22 ` [Qemu-devel] [PATCH 08/10] cocoa: Revert dependency on VNC Andreas Färber
2011-06-14 1:22 ` [Qemu-devel] [PATCH 09/10] cocoa: Avoid warning related to multiple handleEvent: definitions Andreas Färber
@ 2011-06-27 14:48 ` Jes Sorensen
1 sibling, 0 replies; 13+ messages in thread
From: Jes Sorensen @ 2011-06-27 14:48 UTC (permalink / raw)
To: Andreas Färber; +Cc: Anthony Liguori, qemu-devel
On 06/14/11 03:22, Andreas Färber wrote:
> In 821601ea5b02a68ada479731a4d3d07a9876632a (Make VNC support optional)
> cocoa.o was moved from ui-obj-$(CONFIG_COCOA) to vnc-obj-$(CONFIG_COCOA),
> adding a dependency on $(CONFIG_VNC). That must've been unintentional.
>
> Cc: Jes Sorensen <Jes.Sorensen@redhat.com>
> Cc: Anthony Liguori <aliguori@us.ibm.com>
> Signed-off-by: Andreas Färber <andreas.faerber@web.de>
> ---
> Makefile.objs | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
Looks like an error from my side, sorry about that.
Patch looks good.
Jes
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2011-06-27 14:50 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-14 1:21 [Qemu-devel] [PULL 00/10] Fixes for Cocoa backend Andreas Färber
2011-06-14 1:21 ` [Qemu-devel] [PATCH 01/10] cocoa: do not create a spurious window for -version Andreas Färber
2011-06-14 1:21 ` [Qemu-devel] [PATCH 02/10] Fix compilation warning due to incorrectly specified type Andreas Färber
2011-06-14 1:22 ` [Qemu-devel] [PATCH 03/10] Cocoa: avoid displaying window when command-line contains '-h' or '-help' Andreas Färber
2011-06-14 1:22 ` [Qemu-devel] [PATCH 04/10] Remove warning in printf due to type mismatch Andreas Färber
2011-06-14 1:22 ` [Qemu-devel] [PATCH 05/10] configure: Fix check for fdatasync() Andreas Färber
2011-06-14 1:22 ` [Qemu-devel] [PATCH 06/10] Fix libfdt warnings on Darwin Andreas Färber
2011-06-14 1:22 ` [Qemu-devel] [PATCH 07/10] cocoa: Provide central qemu_main() prototype Andreas Färber
2011-06-14 1:22 ` [Qemu-devel] [PATCH 08/10] cocoa: Revert dependency on VNC Andreas Färber
2011-06-14 1:22 ` [Qemu-devel] [PATCH 09/10] cocoa: Avoid warning related to multiple handleEvent: definitions Andreas Färber
2011-06-14 1:22 ` [Qemu-devel] [PATCH 10/10] Darwin: Fix compilation warning regarding the deprecated daemon() function Andreas Färber
2011-06-27 14:48 ` [Qemu-devel] [PATCH 08/10] cocoa: Revert dependency on VNC Jes Sorensen
2011-06-15 19:31 ` [Qemu-devel] [PULL 00/10] Fixes for Cocoa backend Blue Swirl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).