qemu-discuss
[Top][All Lists]
Advanced

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

Re: [Qemu-discuss] how to use qemu net option


From: dykelin
Subject: Re: [Qemu-discuss] how to use qemu net option
Date: Fri, 13 Jan 2012 20:38:54 +0800

Thanks for you suggestion, I just learn a small part of source code of the
qemu, and I think the " -net dump "may not suit for me, I guess this
file(dump.pcap) will be write to the disk, than if so ,when the process to
read it will more slower than in the shared memory, and the "-socket", I
haven't learned it on the qemu, I don't know if it different from the
window's socket, and I will try to learn this part latter, I think due to my
terrible English, may be I don't described clearly about what I need . I
want one of the processes on my host linux to communication with the guest
linux through the network interface, and for the process on the guest linux
it do not different to the communication with the with the physical network
card on the host linux , Don't care what protocol with. And I don't why to
do so, just my boss told me to think about it. I think the tap can used, but
need to modify the code, as I not good at it ,there must be lots of bug wait
for me if I do so, as I new to it ,I don't know is there other way can be
used and not need to modify the code ,so I search for your help!
Thanks all the same!

-----邮件原件-----
发件人: address@hidden
[mailto:address@hidden 代表
address@hidden
发送时间: 2012年1月13日 1:01
收件人: address@hidden
主题: Qemu-discuss Digest, Vol 4, Issue 3

Send Qemu-discuss mailing list submissions to
        address@hidden

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.nongnu.org/mailman/listinfo/qemu-discuss
or, via email, send a message with subject or body 'help' to
        address@hidden

You can reach the person managing the list at
        address@hidden

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Qemu-discuss digest..."


Today's Topics:

   1. Re: Qemu and hard drives >2TB (Mike Lovell)
   2. Re: how to use qemu net option (Mike Lovell)
   3. Re: qemu not getting properly installed (Mike Lovell)
   4. virtfs: mapped mode fails `ldconfig`,     all modes fail
      `locale-gen` (C Anthony Risinger)


----------------------------------------------------------------------

Message: 1
Date: Wed, 11 Jan 2012 10:43:20 -0700
From: Mike Lovell <address@hidden>
To: address@hidden
Subject: Re: [Qemu-discuss] Qemu and hard drives >2TB
Message-ID: <address@hidden>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

On 01/08/2012 02:30 PM, Christian Lerrahn wrote:
> I've used Qemu in the past to install NetBSD from a Linux system.
> However, the problem I'm facing now is that I need to install to a 3TB
> hard drive and Qemu will only recognise 2TB. Not only can I not used
> GPT but it never even sees the drive at its full size (which a non-gpt
> fdisk will).
>
> I've tried different versions of Qemu but possibly not the absolutely
> latest one. Is there any version that can handle a hard drive this size?

are you saying that the guest only sees a hard drive of 2TB even though 
the device on the host is 3TB? if that is the case, then it might be 
that you need to try a newer version of qemu. though, i did just try a 
simple test and was able to see a 3TB device in the guest using qemu-kvm 
0.12.5 that came with ubuntu 10.10 and with 1.0 compiled from source.

qemu should be able to see the full size of the disk. booting from it 
would be another question. i doubt seabios would have the ability to 
boot from something not using a mbr partition table. there are two 
potential options that i see but i have tried neither.

one would be to use a hybrid gpt/mbr partitioning configuration. gpt 
leaves the first block of a disk untouched and an mbr can be put in that 
space so its possible to have both mbr and gpt on a disk at once. 
gptsync is a tool that can read a gpt partition table and write the 
equivalent mbr to the same disk with a few limitations. maybe you could 
make a small partition at the beginning of the disk to boot off of and 
then use the remainder as a data volume. i don't know if netbsd supports 
hybrid gpt/mbr partition tables though so this may not even be an 
option. googling 'hybrid mbr' should provide more info.

the second option would be to try and use the uefi firmware that the 
tianocore project has for qemu. the subproject is called OVMF and 
http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=How_to_run_O
VMF 
has details about how to run that.

hopefully those give you a few things you could try to get this working. 
i've never used netbsd so i can't say how it will react to either of 
these nor have i spend enough time with either of these options to see 
that they work in other scenarios. but hopefully it will get you pointed 
somewhere where you can look to figure something out.

mike



------------------------------

Message: 2
Date: Wed, 11 Jan 2012 14:14:21 -0700
From: Mike Lovell <address@hidden>
To: address@hidden
Subject: Re: [Qemu-discuss] how to use qemu net option
Message-ID: <address@hidden>
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"

On 01/11/2012 06:01 AM, dykelin wrote:
>
> All. I am new to qemu, and I want use qemu to launch an guest linux 
> with two virtual network interfaces (host os is linux too), and open 
> an IPC shared memory on qemu, when I receive packets from the guest 
> linux(through any one of the two interface), save them in the shared 
> memory ,get other pactets from the shared memory to send back to guest 
> linux. The packets in the shared memory will read and wrote by another 
> process run on the host linux. How can I to make it come ture? May I 
> use tap? Break down the brige in the (tap_send())after read packets 
> from the tap interface(tap_read_packet()) and before it write out to 
> the vlan(qemu_send_packet_async()), save this packet to the shared 
> memory ,and get the packet from the shared memory to write. Can this 
> come true???
>
> Thanks for any suggestions from you !!!
>
>

i can't speak to how this could be done by modifying the qemu source 
code because i have little knowledge of the inner workings of the code. 
i'm also a little confused by what you are trying to accomplish but have 
a few suggestions for things you could try that don't modify the code.

are you wanting to just be able to see all of the packets that are 
passed to and from the guest? if so, this could probably be done by 
using the 'dump' network type. for example adding '-net nic,vlan=1 -net 
user,vlan=1 -net dump,vlan=1,file=/tmp/dump.pcap' would create a single 
nic in the guest, set up the user networking target to provide NAT-like 
access to the network, and also dump all traffic to the file 
/tmp/dump.pcap. you then could read the dump.pcap file to examine the 
network traffic. this wouldn't let you inject traffic though.

if you are wanting to also be able to inject arbitrary traffic to the 
guest, it might be possible to accomplish that by using the socket 
network types with qemu. with the socket network types, the qemu process 
will establish a connection to another process and then the qemu process 
will send and receive the raw ethernet frames from the client over this 
socket. for example '-net nic,vlan=1 -net 
socket,vlan=1,connect=127.0.0.1:10240' would tell qemu to connect to a 
socket on localhost port 10240 and pass traffic across that connection. 
you could write a program that started listening on a socket and the 
start reading ethernet frames coming from the guest or start writing 
ethernet frames to get passed to the guest. if you also want the network 
traffic to be passed to a tap device, you could open the tap device as 
well and write to it any thing you receive from the guest socket and 
vice versa.

just a few thoughts.

mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.nongnu.org/archive/html/qemu-discuss/attachments/20120111/a52a
409f/attachment.html>

------------------------------

Message: 3
Date: Wed, 11 Jan 2012 14:21:46 -0700
From: Mike Lovell <address@hidden>
To: address@hidden
Subject: Re: [Qemu-discuss] qemu not getting properly installed
Message-ID: <address@hidden>
Content-Type: text/plain; charset="iso-2022-jp"

On 12/29/2011 02:30 AM, Pankaj Rawat wrote:
>
> Still got same output .
>
> Well I don?t know what is getting wrong
>
> address@hidden qemu-1.0]# which qemu
>
> /usr/local/bin/qemu
>
> address@hidden qemu-1.0]# /usr/local/bin/qemu --version
>
> QEMU emulator version 0.14.50, Copyright (c) 2003-2008 Fabrice Bellard
>
>

check for other qemu related entries in /usr/loca/bin. i.e. `ls
/usr/local/bin`

when just doing `./configure && make && make install`, the build system
installs the program as qemu-system-<target> and not just qemu. i'm
guessing whatever installed 0.14.5 on your system, like your
distributions package manager, it installed one of the qemu binaries as
just /usr/local/bin/qemu and the qemu make install isn't replacing it.
so try looking for another binary with a longer, more specific name.

hope that helps if help is still needed.

mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.nongnu.org/archive/html/qemu-discuss/attachments/20120111/ba3e
9636/attachment.html>

------------------------------

Message: 4
Date: Wed, 11 Jan 2012 23:05:12 -0600
From: C Anthony Risinger <address@hidden>
To: address@hidden
Subject: [Qemu-discuss] virtfs: mapped mode fails `ldconfig`,   all
        modes fail `locale-gen`
Message-ID:
        <address@hidden>
Content-Type: text/plain; charset=UTF-8

can someone please confirm receipt of this message?  everything i send
to this list (previously) i get errors back from majordomo, but i
thought it was a mailman list ...

i wrote a detailed description of the issue here:

http://lists.nongnu.org/archive/html/qemu-discuss/2011-12/msg00018.html

... but the varying inode stuff was incorrect (at one point i
generated the cache file from the host), but the duplicate inode
problem stands

here is the 10 second recap ...

# `ldconfig`
Aborted.

FAILURE: unpriv, mapped
FAILURE: priv, mapped
SUCCESS: priv, passthru
(unpriv, passthru not acceptable)

... all FAILs due to `ldconfig` somehow receiving a library twice (see
GDB session in original message).

# localedef -i en_US -c -f ISO-8859-1 -A /usr/share/locale/locale.alias
en_US
cannot map archive header: Invalid argument

FAILURE: *any virtfs configuration*
SUCCESS: [mount/bind a tmpfs to /usr/lib/locale/]

... all FAIL mmap() call:

open("/usr/lib/locale/locale-archive.7YgBdl", O_RDWR|O_CREAT|O_EXCL, 0600) =
3
mmap(NULL, 536870912, PROT_NONE, MAP_SHARED, 3, 0) = -1 EINVAL
(Invalid argument)
mmap(NULL, 103860, PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0) = -1 EINVAL
(Invalid argument)
unlink("/usr/lib/locale/locale-archive.7YgBdl") = 0

... which succeed on tmpfs:

open("/usr/lib/locale/locale-archive.Q9trL0", O_RDWR|O_CREAT|O_EXCL, 0600) =
3
mmap(NULL, 536870912, PROT_NONE, MAP_SHARED, 3, 0) = 0x7f7271cc8000
mmap(0x7f7271cc8000, 103860, PROT_READ|PROT_WRITE,
MAP_SHARED|MAP_FIXED, 3, 0) = 0x7f7271cc8000
link("/usr/lib/locale/locale-archive.Q9trL0",
"/usr/lib/locale/locale-archive") = 0

ideas?  i'm running the latest kernel 3.1 kernel (Archlinux, soon to
be 3.2) on x86_64, and qemu-kvm 1.0.  guests use virtfs as rootfs,

-- 

C Anthony



------------------------------

_______________________________________________
Qemu-discuss mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/qemu-discuss


End of Qemu-discuss Digest, Vol 4, Issue 3
******************************************





reply via email to

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