It is currently Sat Sep 22, 2018 6:03 am


All times are UTC




Post new topic Reply to topic  [ 26 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: Patch for Qemu 0.13.0
PostPosted: Tue Dec 28, 2010 6:31 pm 
Offline

Joined: Thu Jun 24, 2010 3:58 pm
Posts: 411
Location: [email protected]
Hi, I test it and works great with ASA, Microcore, Tinycore, Multicast also works (OSPF ASA with Router), etc...
Good news, in X mode with '-k en-us', arrow keys are working for windows to :))
Monitor functions are working with '-monitor telnet:127.0.0.1:9999,server,nowait', v0.12.5 had some issues.

How about x64 bit version?

Well, here I've try to make something, tested on linux and works (Not final version, Has to be updated) :))
Add udp connectivity in monitor area with command 'host_net_add udp vlan=0,sport=40003,dport=40001,daddr=127.0.0.1'
Code:
diff -ruNB qemu-0.13.0/net.c qemu-0.13.0-patch/net.c
--- qemu-0.13.0/net.c   2010-10-15 23:56:10.000000000 +0300
+++ qemu-0.13.0-patch/net.c     2010-12-28 22:03:36.809500000 +0200
@@ -1107,6 +1108,7 @@

     if (is_netdev) {
         if (strcmp(type, "tap") != 0 &&
+            strcmp(type, "udp") != 0 &&
#ifdef CONFIG_SLIRP
             strcmp(type, "user") != 0 &&
#endif
@@ -1175,7 +1177,7 @@
static int net_host_check_device(const char *device)
{
     int i;
-    const char *valid_param_list[] = { "tap", "socket", "dump"
+    const char *valid_param_list[] = { "tap", "socket", "dump", "udp"
#ifdef CONFIG_SLIRP
                                        ,"user"
#endif
diff -ruNB qemu-0.13.0/qemu-monitor.hx qemu-0.13.0-patch/qemu-monitor.hx
--- qemu-0.13.0/qemu-monitor.hx 2010-10-15 23:56:10.000000000 +0300
+++ qemu-0.13.0-patch/qemu-monitor.hx   2010-12-28 19:51:39.488500000 +0200
@@ -1178,7 +1178,7 @@
     {
         .name       = "host_net_add",
         .args_type  = "device:s,opts:s?",
-        .params     = "tap|user|socket|vde|dump [options]",
+        .params     = "tap|user|socket|vde|udp|dump [options]",
         .help       = "add host VLAN client",
         .mhandler.cmd = net_host_device_add,
     },


Code:
(qemu) host_net_add udp vlan=0,sport=40003,dport=40001,daddr=127.0.0.1
(qemu) host_net_add udp vlan=0,sport=40004,dport=40002,daddr=127.0.0.1
(qemu)
(qemu) info network
VLAN 0 devices:
  e1000.0: model=e1000,macaddr=00:00:ab:b5:2f:00
  udp.0: udp: 40003->127.0.0.1:40001
  udp.1: udp: 40004->127.0.0.1:40002
VLAN 1 devices:
  e1000.1: model=e1000,macaddr=00:00:ab:cf:33:01
Devices not on any VLAN:
(qemu)
(qemu) host_net_remove 0 udp.0
(qemu) host_net_remove 0 udp.1




Top
 Profile  
 
 Post subject: Re: Patch for Qemu 0.13.0
PostPosted: Tue Dec 28, 2010 7:29 pm 
Offline

Joined: Thu Jun 24, 2010 3:58 pm
Posts: 411
Location: [email protected]
Read the above-^ reply first :))
New list of commands that can be used if the Qemu monitor stuff is implemented in GNS3
And why not, allow any command from Dynagen console to a qemu host, like the 'send' command for dynamips (Which doesn't work, by the way)
Code:
savevm [tag|id] -- save a VM snapshot. If no tag or id are provided, a new snapshot is created
loadvm tag|id -- restore a VM snapshot from its tag or id
delvm tag|id -- delete a VM snapshot from its tag or id

stop  -- stop emulation (pause)
c|cont  -- resume emulation
q|quit  -- quit the emulator

sendkey keys [hold_ms] -- send keys to the VM (e.g. 'sendkey ctrl-alt-f1', default hold time=100 ms)
system_reset  -- reset the system
system_powerdown  -- send system power down event

host_net_add tap|user|socket|vde|udp|dump [options] -- add host VLAN client
host_net_remove vlan_id name -- remove host VLAN client

set_link name on|off -- change the link status of a network adapter

info [subcommand] -- show various information about the system state

usb_add device -- add USB device (e.g. 'host:bus.addr' or 'host:vendor_id:product_id')
usb_del device -- remove USB device 'bus.addr'

balloon target -- request VM to change its memory allocation (in MB)


Top
 Profile  
 
 Post subject: Re: Patch for Qemu 0.13.0
PostPosted: Tue Dec 28, 2010 9:53 pm 
Offline
Site Admin

Joined: Sat Oct 11, 2008 1:41 pm
Posts: 2668
Location: Canada
Thanks tranzitwww!! I'll test your patch soon.

Cheers,

_________________
Jeremy, GNS3 Programmer & Benevolent Dictator for Life.


Top
 Profile  
 
 Post subject: Re: Patch for Qemu 0.13.0
PostPosted: Tue Dec 28, 2010 9:59 pm 
Offline

Joined: Thu Jun 24, 2010 3:58 pm
Posts: 411
Location: [email protected]
There is still some work to do..
If you enter only the command "host_net_add udp" qemu crashes.
You know I wanted this from the first time, but I was lazy then to look over that code ;))


Top
 Profile  
 
 Post subject: Re: Patch for Qemu 0.13.0
PostPosted: Sat Jan 01, 2011 10:21 am 
Offline

Joined: Tue Jul 20, 2010 5:50 pm
Posts: 93
Happy new Year guys,

thanks for the help with the qemu monitor stuff, I am currently working on some code in our dynagen libraries to always start the "qemu monitor" - I chose the starting TCP port as 9000.

One issue that is obvious is backward compatiblity, as qemu 0.11 fails to start emulator with something that it cannot parse in the command line, so we also need some automatic qemu version checking.....

As for the x64 bit version question I believe when you run ./configure on qemu it will use the arch of your computer. The qemu configure command produces nice output of all the GCC options used.

Another thing I noticed is that the Qemu guys introduced -netdev and -device command which they say is prefferable way of connecting to network stuff instead of hubbased -net command.....somehow no documentation exists :(


Top
 Profile  
 
 Post subject: Re: Patch for Qemu 0.13.0
PostPosted: Sun Jan 02, 2011 6:02 pm 
Offline

Joined: Thu Jun 24, 2010 3:58 pm
Posts: 411
Location: [email protected]
Happy new years to you too!

Great! Sniffer works by default :)
The issue is that it doesn't return anything back if the action was successful or not, only if there is a syntax error. So, for checking remains the command 'info network'.

One small suggestion to add the port (fa0_2, e0, p1, etc) in the capture file name 'R1(fa0_1)_to_SW2(p5).cap', because you can use one single SW with vlans and connect one device with multiple links to it or create a port channel to another Node, etc. It will not be possible to open the sniffer on all interfaces in the same time... (or it will be, but will not work :)
And why not possibility to sniff from both ends of a single link, in the same time, where both devices support this option! [Ro]-[Ro], [Qemu]-[Qemu] and [Ro]-[Qemu] (great for debug, like the sw bug in GNS3 v0.7.3)

Code:
(qemu) info version
0.13.0
(qemu) host_net_add dump vlan=0,file=G:\QEMU2_to_SW1.cap
(qemu)
(qemu) info network
VLAN 0 devices:
  udp.0: udp: 30000->127.0.0.1:10000
  dump.4: dump to G:\QEMU2_to_SW1.cap (len=65536)
  e1000.0: model=e1000,macaddr=00:aa:00:43:a2:00
VLAN 1 devices:
  e1000.1: model=e1000,macaddr=00:00:ab:5d:a1:01
Devices not on any VLAN:
(qemu)
(qemu) host_net_remove 0 dump.4

Jumbo for version check use "qemu -version" in windows it will write the output to "stdout.txt" file -> 'QEMU emulator version 0.13.0, Copyright (c) 2003-2008 Fabrice Bellard'
What is not working in 0.11.0, because I had problems with 0.12.5...


Top
 Profile  
 
 Post subject: Re: Patch for Qemu 0.13.0
PostPosted: Thu Jan 06, 2011 8:57 pm 
Offline

Joined: Thu Jun 24, 2010 3:58 pm
Posts: 411
Location: [email protected]
There is a issue with SMBIOS in this version...
I've use a Ubuntu image inside a Qemu with a custom smbios option [-smbios "type=0,vendor=Phoenix Technologies Ltd.,version=1.10,date=09/30/2002,release=A04"]
and the result with 'dmidecode -t 0' is: (Bad news for Cisco IDS emulation topic2879-10.html#p9038)
Code:
BIOS Information
        Vendor: Bochs
        Version: Bochs
        Release Date: 01/01/2007
        Address: 0xE8000
        Runtime Size: 96 kB
        ROM Size: 64 kB
        Characteristics:
                BIOS characteristics not supported
                Targeted content distribution is supported
        BIOS Revision: 1.0


Top
 Profile  
 
 Post subject: Re: Patch for Qemu 0.13.0
PostPosted: Sat Jan 29, 2011 2:42 pm 
It would be really great to get the udp mode networking patches committed upstream in qemu rather than maintained separately. The most recent post in qemu-devel about it seems to be a couple of years ago and the layout in qemu have changed quite a lot since then. socket.c already supports udp sockets (currently multicast only), as well as tcp sockets (connect/listen). Has anyone considered making unicast udp an addition to socket.c rather than a separate file? This would reduce duplication and might stand a better chance of getting accepted.


Top
  
 
 Post subject: Re: Patch for Qemu 0.13.0
PostPosted: Sun Jan 30, 2011 11:20 am 
Offline

Joined: Tue Jul 20, 2010 5:50 pm
Posts: 93
that is a very good idea, I had a similar one but then I saw the 2 year old message on qemu-devel where they basically complained about the "style" of code and the usage of key word "udp", which left me wondering....

Sthen,
if you have time and knowledge feel free to go ahead and try to rewrite the patch and submit to qemu-dev folks. Otherwise that is something I can try to do.


Top
 Profile  
 
 Post subject: Re: Patch for Qemu 0.13.0
PostPosted: Mon Apr 04, 2011 4:09 pm 
Offline

Joined: Mon Apr 04, 2011 3:07 pm
Posts: 7
hi all,

was this done? I'mean did the patchs got into qemu?

Rolando




Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 26 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO