From: Bartosz Fabianowski <bartosz@fabianowski.de>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: qemu port
Date: Thu, 03 Jun 2004 01:54:59 +0200 [thread overview]
Message-ID: <40BE68D3.5030006@fabianowski.de> (raw)
In-Reply-To: <20040603011805.A40432@saturn.kn-bremen.de>
> OK, I've now taken this and the other FreeBSD patches, added a few
> small ones of my own and made a port [...]
Awesome! A port was my original idea and the reason for why I started
tinkering with QEMU in the first place.
> - needs to run as root in order to use /dev/tap* networking (why?)
I haven't looked at your port yet, but my own compilation of QEMU has
the same problem. It seems to me that this is because on each
invocation, QEMU creates a new tap device. Just run QEMU a few times (as
root) and then look at the output of ifconfig. Each invocation will have
produced a new tap device. Since normal users probably have no
permission to create device nodes, QEMU fails to create its required tap
device and therefore tap networking doesn't work. A fix for this would
be to create a certain amount of tap device nodes at FreeBSD start up
and then to have QEMU recycle the nodes it doesn't need any more. Then
again, maybe I am totally wrong on what is causing this.
> - using physical media doesn't work on 4.x hosts (missing
> DIOCGMEDIASIZE ioctl)
This is the place where it's actually used:
if (ioctl(fd, DIOCGMEDIASIZE, (off_t *)&size))
size = lseek(fd, 0LL, SEEK_END);
This ioctl checks whether the total size of the medium can be retrieved
and thus only succeeds if there is a medium in the drive. So the ioctl
effectively just checks whether there is a medium. The size is then
retrieved separately using lseek.
I haven't tried compiling or running this, but my idea would be to try
something like this instead:
if((size = lseek(fd, 0LL, SEEK_END)) < 0)
size = 0;
Now, lseek is always called. If there is no medium, lseek should fail,
returning some negative value. In this case, the size is set to zero to
indicate failure. Otherwise, the size determined by lseek is used.
- Bartosz
next prev parent reply other threads:[~2004-06-02 23:54 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-29 21:25 [Qemu-devel] Running QEMU on FreeBSD Antony T Curtis
2004-05-29 21:39 ` Bartosz Fabianowski
2004-05-29 21:50 ` Antony T Curtis
2004-05-29 21:58 ` Bartosz Fabianowski
2004-05-29 22:09 ` Antony T Curtis
2004-05-29 22:24 ` Bartosz Fabianowski
2004-05-29 23:09 ` Antony T Curtis
2004-05-30 3:53 ` Antony T Curtis
2004-05-30 7:25 ` Markus Niemistö
2004-05-30 9:50 ` Antony T Curtis
2004-05-30 14:41 ` Bartosz Fabianowski
2004-05-30 17:27 ` Antony T Curtis
2004-05-30 18:57 ` Bartosz Fabianowski
2004-05-30 20:09 ` Antony T Curtis
2004-05-31 0:36 ` Bartosz Fabianowski
2004-05-31 1:24 ` Antony T Curtis
2004-05-31 1:42 ` Bartosz Fabianowski
2004-05-31 1:59 ` Kyle Hayes
2004-05-31 12:15 ` Bartosz Fabianowski
2004-05-31 13:22 ` Antony T Curtis
2004-05-31 9:38 ` Antony T Curtis
2004-05-31 20:36 ` Bartosz Fabianowski
2004-05-31 13:54 ` Antony T Curtis
2004-05-31 20:31 ` Bartosz Fabianowski
2004-05-31 22:15 ` Antony T Curtis
2004-05-31 22:56 ` Brion Vibber
2004-05-31 23:01 ` Bartosz Fabianowski
2004-06-02 23:18 ` qemu port (was: Re: [Qemu-devel] Running QEMU on FreeBSD) Juergen Lock
2004-06-02 23:54 ` Bartosz Fabianowski [this message]
2004-06-03 17:10 ` [Qemu-devel] Re: qemu port Gianni Tedesco
2004-06-04 18:44 ` Juergen Lock
2004-06-05 21:04 ` [Qemu-devel] FreeSBIE timer (was: Re: qemu port) Juergen Lock
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40BE68D3.5030006@fabianowski.de \
--to=bartosz@fabianowski.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).