qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] oslib-posix: Use sysctl(2) call to resolve exec


From: Kamil Rytarowski
Subject: Re: [Qemu-devel] [PATCH] oslib-posix: Use sysctl(2) call to resolve exec_dir on NetBSD
Date: Thu, 2 Nov 2017 18:52:04 +0100
User-agent: Mozilla/5.0 (X11; NetBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0

On 02.11.2017 18:29, Peter Maydell wrote:
> On 2 November 2017 at 17:27, Kamil Rytarowski <address@hidden> wrote:
>> On 02.11.2017 17:55, Peter Maydell wrote:
>>> It's a shame the BSDs can't agree on a single way to implement this :-(
> 
>> It's better to assume that there is no such entity as a shared BSD code
>> in modern BSD Operating Systems. My opinion is to drop CONFIG_BSD
>> entirely from qemu and treat __NetBSD__, __FreeBSD__ and __OpenBSD__ as
>> diverse targets.
> 
> Mmm, that's probably the best way to do it. (Better still,
> wherever possible check features rather than OS type).
> 

Correct.

We already end up with check for CONFIG_BSD and specific BSD variation.

chardev/char-parallel.c:#ifdef CONFIG_BSD
chardev/char-parallel.c-#if defined(__FreeBSD__) ||
defined(__FreeBSD_kernel__)

util/qemu-openpty.c:#elif defined CONFIG_BSD
util/qemu-openpty.c-# include <termios.h>
util/qemu-openpty.c-# if defined(__FreeBSD__) ||
defined(__FreeBSD_kernel__) || defined(__DragonFly__)

block.c:#ifdef CONFIG_BSD
block.c-#include <sys/ioctl.h>
block.c-#include <sys/queue.h>
block.c-#ifndef __DragonFly__

Sometimes automatic detection whether a struct or function exists can
lead to problems as they might have different purpose. This is common
especially for sysctl(2) calls.

> It does mean that more minor BSD variants like DragonFly are
> in a worse place, because nobody much is going to care about
> supporting them, and they can't get automatic support by
> being "like all of the others".
> 

Fixing and maintaining DragonFly requires non-trivial (at lest in terms
of dedicated time) effort. I wouldn't be surprised that part of qemu
problems originates from the base-system bugs (this happens in every BSD
and OS).

CC: Antonio who expressed interest in the DFLY port.

> thanks
> -- PMM
> 


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]