Patch for Qemu 0.13.0
Page 2 of 3

Author:  tranzitwww [ Tue Dec 28, 2010 6:31 pm ]
Post subject:  Re: Patch for Qemu 0.13.0

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:,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='
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 &&
             strcmp(type, "user") != 0 &&
@@ -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"
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,

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

Author:  tranzitwww [ Tue Dec 28, 2010 7:29 pm ]
Post subject:  Re: Patch for Qemu 0.13.0

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)
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)

Author:  grossmj [ Tue Dec 28, 2010 9:53 pm ]
Post subject:  Re: Patch for Qemu 0.13.0

Thanks tranzitwww!! I'll test your patch soon.


Author:  tranzitwww [ Tue Dec 28, 2010 9:59 pm ]
Post subject:  Re: Patch for Qemu 0.13.0

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 ;))

Author:  jumbo [ Sat Jan 01, 2011 10:21 am ]
Post subject:  Re: Patch for Qemu 0.13.0

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 :(

Author:  tranzitwww [ Sun Jan 02, 2011 6:02 pm ]
Post subject:  Re: Patch for Qemu 0.13.0

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)

(qemu) info version
(qemu) host_net_add dump vlan=0,file=G:\QEMU2_to_SW1.cap
(qemu) info network
VLAN 0 devices:
  udp.0: udp: 30000->
  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) 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...

Author:  tranzitwww [ Thu Jan 06, 2011 8:57 pm ]
Post subject:  Re: Patch for Qemu 0.13.0

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)
BIOS Information
        Vendor: Bochs
        Version: Bochs
        Release Date: 01/01/2007
        Address: 0xE8000
        Runtime Size: 96 kB
        ROM Size: 64 kB
                BIOS characteristics not supported
                Targeted content distribution is supported
        BIOS Revision: 1.0

Author:  sthen [ Sat Jan 29, 2011 2:42 pm ]
Post subject:  Re: Patch for Qemu 0.13.0

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.

Author:  jumbo [ Sun Jan 30, 2011 11:20 am ]
Post subject:  Re: Patch for Qemu 0.13.0

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....

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.

Author:  zappacor [ Mon Apr 04, 2011 4:09 pm ]
Post subject:  Re: Patch for Qemu 0.13.0

hi all,

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


Page 2 of 3 All times are UTC
Powered by phpBB® Forum Software © phpBB Group