<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8977635182462077435</id><updated>2012-02-16T05:59:10.246-08:00</updated><category term='watchdog'/><category term='hpc'/><category term='qemu'/><category term='VM'/><category term='udev'/><category term='assembly'/><category term='C'/><category term='vde'/><category term='dss'/><category term='awesome'/><title type='text'>Computer stuffs</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://mativait.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8977635182462077435/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://mativait.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Mati</name><uri>http://www.blogger.com/profile/05997225954723147741</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8977635182462077435.post-5514287642389526402</id><published>2011-12-17T14:12:00.000-08:00</published><updated>2011-12-17T14:41:50.412-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='watchdog'/><category scheme='http://www.blogger.com/atom/ns#' term='VM'/><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='qemu'/><title type='text'>Rolling your own watchdog for Qemu</title><content type='html'>Sometimes there may arise a need to make your own watchdog for your virtual machine. The process itself is really a simple one, I will base this example on Intel's 6300esb watchdog.&lt;br /&gt;&lt;br /&gt;Let's first start by getting the latest source code for Qemu:&lt;br /&gt;&lt;br /&gt;&lt;pre style="background-color: white; border-bottom-color: rgb(47, 111, 171); border-bottom-style: dashed; border-bottom-width: 1px; border-left-color: rgb(47, 111, 171); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(47, 111, 171); border-right-style: dashed; border-right-width: 1px; border-top-color: rgb(47, 111, 171); border-top-style: dashed; border-top-width: 1px; font-family: 'Courier New', monospace; font-size: 12px; line-height: 1.1em; overflow-x: auto; overflow-y: auto; padding-bottom: 15px; padding-left: 20px; padding-right: 20px; padding-top: 15px;"&gt;git clone git://git.qemu.org/qemu.git &amp;amp;&amp;amp; cd qemu&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now it is reasonable to switch to your own git branch in case you want to roll out some patches later on.&lt;br /&gt;&lt;br /&gt;&lt;pre style="background-color: white; border-bottom-color: rgb(47, 111, 171); border-bottom-style: dashed; border-bottom-width: 1px; border-left-color: rgb(47, 111, 171); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(47, 111, 171); border-right-style: dashed; border-right-width: 1px; border-top-color: rgb(47, 111, 171); border-top-style: dashed; border-top-width: 1px; font-family: 'Courier New', monospace; font-size: 12px; line-height: 1.1em; overflow-x: auto; overflow-y: auto; padding-bottom: 15px; padding-left: 20px; padding-right: 20px; padding-top: 15px;"&gt;git checkout -b custom-watchdog&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;All of the existing watchdog sources are located at &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;hw&lt;/span&gt;&amp;nbsp;folder.&lt;br /&gt;&lt;br /&gt;Make a copy of existing watchdog and include it in the build path.&lt;br /&gt;&lt;br /&gt;&lt;pre style="background-color: white; border-bottom-color: rgb(47, 111, 171); border-bottom-style: dashed; border-bottom-width: 1px; border-left-color: rgb(47, 111, 171); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(47, 111, 171); border-right-style: dashed; border-right-width: 1px; border-top-color: rgb(47, 111, 171); border-top-style: dashed; border-top-width: 1px; overflow-x: auto; overflow-y: auto; padding-bottom: 15px; padding-left: 20px; padding-right: 20px; padding-top: 15px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: 12px; line-height: 13px;"&gt;cp hw/wdt_i6300esb.c hw/wdt_custom_watchdog.c&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now lets plug the new watchdog into the build process. For doing that we need to edit Makefile.objs and add a new line&lt;br /&gt;hw-obj-$(CONFIG_PCI) += wdt_custom_watchdog.o&lt;br /&gt;&lt;br /&gt;right after the&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;"&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;hw-obj-$(CONFIG_PCI) += wdt_i6300esb.o"&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;line&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Next step is to dig into the code and start modifying the new and improved watchdog. For the sake of simplicity I will leave the core functionality unchanged. I will only change the important parts of the code to enable the registering the new watchdog with Qemu.&lt;br /&gt;Replace every reference to i3600esb and alike with your version of the name. If you skip some of the code then there is a chance that custom watchdog will not behave as expected. Most of the tedious replacement is easily done with sed commands similar to this.&lt;br /&gt;&lt;br /&gt;&lt;pre style="background-color: white; border-bottom-color: rgb(47, 111, 171); border-bottom-style: dashed; border-bottom-width: 1px; border-left-color: rgb(47, 111, 171); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(47, 111, 171); border-right-style: dashed; border-right-width: 1px; border-top-color: rgb(47, 111, 171); border-top-style: dashed; border-top-width: 1px; overflow-x: auto; overflow-y: auto; padding-bottom: 15px; padding-left: 20px; padding-right: 20px; padding-top: 15px;"&gt;&lt;span class="Apple-style-span" style="white-space: normal;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;sed -e 's/i6300esb/custom_watchdog/g' hw/wdt_i6300esb.c &amp;gt; hw/wdt_custom_watchdog.c&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now open up the code of the custom watchdog and fill in it's name and description with your own such as:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="background-color: white; border-bottom-color: rgb(47, 111, 171); border-bottom-style: dashed; border-bottom-width: 1px; border-left-color: rgb(47, 111, 171); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(47, 111, 171); border-right-style: dashed; border-right-width: 1px; border-top-color: rgb(47, 111, 171); border-top-style: dashed; border-top-width: 1px; overflow-x: auto; overflow-y: auto; padding-bottom: 15px; padding-left: 20px; padding-right: 20px; padding-top: 15px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="white-space: normal;"&gt;.wdt_description = "Super Custom Watchdog"&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Recompile now and see if the new watchdog is visible and loading with Qemu.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="border-bottom-color: rgb(47, 111, 171); border-bottom-style: dashed; border-bottom-width: 1px; border-left-color: rgb(47, 111, 171); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(47, 111, 171); border-right-style: dashed; border-right-width: 1px; border-top-color: rgb(47, 111, 171); border-top-style: dashed; border-top-width: 1px; overflow-x: auto; overflow-y: auto; padding-bottom: 15px; padding-left: 20px; padding-right: 20px; padding-top: 15px;"&gt;&lt;div style="background-color: white; white-space: normal;"&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;qemu (custom-watchdog)$ ./i386-softmmu/qemu-system-i386 -watchdog ?&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="white-space: normal;"&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;span class="Apple-tab-span" style="background-color: white; white-space: pre;"&gt; &lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: lime;"&gt;custom_watchdog&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;Super Custom Watchdog&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="background-color: white; white-space: normal;"&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;i6300esb&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;Intel 6300ESB&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="background-color: white; white-space: normal;"&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ib700&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;iBASE 700&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;As it turns out, the new watchdog is visible for Qemu.&lt;br /&gt;&lt;br /&gt;Let's run some VM with our new watchdog:&lt;br /&gt;&lt;br /&gt;&lt;pre style="background-color: white; border-bottom-color: rgb(47, 111, 171); border-bottom-style: dashed; border-bottom-width: 1px; border-left-color: rgb(47, 111, 171); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(47, 111, 171); border-right-style: dashed; border-right-width: 1px; border-top-color: rgb(47, 111, 171); border-top-style: dashed; border-top-width: 1px; overflow-x: auto; overflow-y: auto; padding-bottom: 15px; padding-left: 20px; padding-right: 20px; padding-top: 15px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="white-space: normal;"&gt;./i386-softmmu/qemu-system-i386 -watchdog custom_watchdog ~/debian.qcow2&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If everything goes well and the virtual machine comes up without any errors regarding the watchdog, the next step would be to replace some of the old variable names in the source code with more appropriate ones, otherwise the new watchdog is ready for further customization.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://ut.ee/~mativait/wdt_custom_watchdog.c" target="_blank"&gt;Source code here.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Software versions used:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Qemu sources for &amp;nbsp;version 1.0&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8977635182462077435-5514287642389526402?l=mativait.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mativait.blogspot.com/feeds/5514287642389526402/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mativait.blogspot.com/2011/12/rolling-your-own-watchdog-for-qemu.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8977635182462077435/posts/default/5514287642389526402'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8977635182462077435/posts/default/5514287642389526402'/><link rel='alternate' type='text/html' href='http://mativait.blogspot.com/2011/12/rolling-your-own-watchdog-for-qemu.html' title='Rolling your own watchdog for Qemu'/><author><name>Mati</name><uri>http://www.blogger.com/profile/05997225954723147741</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8977635182462077435.post-2476391187746068933</id><published>2011-05-29T09:01:00.000-07:00</published><updated>2011-05-29T09:02:39.749-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hpc'/><category scheme='http://www.blogger.com/atom/ns#' term='awesome'/><category scheme='http://www.blogger.com/atom/ns#' term='assembly'/><title type='text'>Low-level awesomeness!</title><content type='html'>Get the high performance computation as close to the metal as possible:&lt;br /&gt;&lt;a href="http://www.returninfinity.com/"&gt;http://www.returninfinity.com/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8977635182462077435-2476391187746068933?l=mativait.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mativait.blogspot.com/feeds/2476391187746068933/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mativait.blogspot.com/2011/05/low-level-awesomeness.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8977635182462077435/posts/default/2476391187746068933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8977635182462077435/posts/default/2476391187746068933'/><link rel='alternate' type='text/html' href='http://mativait.blogspot.com/2011/05/low-level-awesomeness.html' title='Low-level awesomeness!'/><author><name>Mati</name><uri>http://www.blogger.com/profile/05997225954723147741</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8977635182462077435.post-9174245590957157747</id><published>2011-05-25T08:03:00.000-07:00</published><updated>2011-05-25T08:03:53.309-07:00</updated><title type='text'>Distributed Systems Seminar Presentation</title><content type='html'>Today's presentation &lt;a href="http://math.ut.ee/%7Emativait/presentation2505.pdf"&gt;slides&lt;/a&gt; and a &lt;a href="http://www.youtube.com/watch?v=xKfBClw5nfc"&gt;demo&lt;/a&gt; of mesh topology setup.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8977635182462077435-9174245590957157747?l=mativait.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mativait.blogspot.com/feeds/9174245590957157747/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mativait.blogspot.com/2011/05/distributed-systems-seminar.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8977635182462077435/posts/default/9174245590957157747'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8977635182462077435/posts/default/9174245590957157747'/><link rel='alternate' type='text/html' href='http://mativait.blogspot.com/2011/05/distributed-systems-seminar.html' title='Distributed Systems Seminar Presentation'/><author><name>Mati</name><uri>http://www.blogger.com/profile/05997225954723147741</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8977635182462077435.post-6149290644642300215</id><published>2011-05-05T10:28:00.000-07:00</published><updated>2011-05-05T10:29:57.619-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vde'/><category scheme='http://www.blogger.com/atom/ns#' term='dss'/><category scheme='http://www.blogger.com/atom/ns#' term='qemu'/><category scheme='http://www.blogger.com/atom/ns#' term='udev'/><title type='text'>F2F meets Qemu</title><content type='html'>This post is about setting up VDE network between qemu machines through a F2F job. &lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;Tools I used are dpipe, vde_switch, vde_plug, &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;nc, everything wrapped into python code that is in turn called from F2F job. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-qS1ZYMxoU-c/TblCQTstZkI/AAAAAAAAABI/iBQLi3PYdQ0/s1600/starTopologyDhcp.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="160" src="http://2.bp.blogspot.com/-qS1ZYMxoU-c/TblCQTstZkI/AAAAAAAAABI/iBQLi3PYdQ0/s200/starTopologyDhcp.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;IPx - machine&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt; Sx - vde_switch&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;Network layout: &amp;nbsp;star-topology - central node is master VM, all slave nodes are connected to its switch using their switches. &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;Master virtual machine configuration: provide IP addresses on VDE. &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;Slave virtual machine configuration: acquire IP from master VM.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: x-large;"&gt;F2F job&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-large;"&gt;&lt;span style="font-size: large;"&gt;Idea&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;The F2F job defines two possible roles for a host - master or slave. In a master role the host launches master virtual machine which serves as a dhcp server for the VDE network. In a slave role the host launches the slave virtual machine which acquires its IP from master VM and joins VDE network.&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt; I chose to use a separate vde_switch in  front of each VM regardless of it being a master or slave VM to achieve  uniform configuration layout across the network (machine-switch; switch-switch).&lt;/span&gt;&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;VM configuration&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;F2F job handles distributing configuration parameters for virtual machines. An unique id is assigned to each of the slave hosts based on the order of joining the group and in turn each of the slaves configure necessary parameters for launching and connecting the VM. Each slave node needs to know&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt; ip and port for VDE switch and ID for calculating unique MAC for the VM.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;On the host of the master&amp;nbsp; VM there is set up also a listening socket for each slave VM which is in turn connected to master switch.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: x-large;"&gt;Final notes&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;Finally I want to add some bits I learned about scaling the VDE network using dhcp. In this post the VDE network consists of a single master machine and several slave machines. Because of the boot times for multiple slave machines are different (MAC-s are assigned in random order) then it is tedious to describe all possible situations for interface names in slave's /etc/network/interfaces because by default udev writes rules for MAC-ethX associations. What I did was that I reconfigured udev to forget MAC addresses for certain MAC ranges. It already had rules for not remembering interfaces for virtual machines (wild-card MAC ranges) but they are overridden by the rules for some generic cards (Realtek, etc) which still force them to be written out. After commenting out rules for generic cards, udev didn't remember any MAC-ethX associations and interfaces configuration file for slave machine could be written in a very minimal manner.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;Sample F2F job and&amp;nbsp; helper code can be found &lt;a href="https://bitbucket.org/mativait/dss/changeset/3abe8c7da883"&gt;here&lt;/a&gt; and can be run using the&amp;nbsp; code from f2f-mobile branch (usual configuration).&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="color: red;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8977635182462077435-6149290644642300215?l=mativait.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mativait.blogspot.com/feeds/6149290644642300215/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mativait.blogspot.com/2011/05/f2f-meets-qemu.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8977635182462077435/posts/default/6149290644642300215'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8977635182462077435/posts/default/6149290644642300215'/><link rel='alternate' type='text/html' href='http://mativait.blogspot.com/2011/05/f2f-meets-qemu.html' title='F2F meets Qemu'/><author><name>Mati</name><uri>http://www.blogger.com/profile/05997225954723147741</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-qS1ZYMxoU-c/TblCQTstZkI/AAAAAAAAABI/iBQLi3PYdQ0/s72-c/starTopologyDhcp.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8977635182462077435.post-6624348097099226815</id><published>2011-04-03T17:13:00.000-07:00</published><updated>2011-04-03T17:16:20.408-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vde'/><category scheme='http://www.blogger.com/atom/ns#' term='dss'/><category scheme='http://www.blogger.com/atom/ns#' term='qemu'/><title type='text'>VDE network setup</title><content type='html'>&lt;span style="font-size: x-large;"&gt;&lt;span style="font-size: x-small;"&gt;A sample setup of qemu machines and VDE networking components is described. Configuration parameters for qemu might not be optimal &lt;/span&gt;&lt;span style="font-size: x-small;"&gt;since the emphasis was at the moment on the network configuration.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Tools &amp;amp; Components&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;Tools used for setting up following VDE network are:&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;vde_switch - a virtual switch &lt;/li&gt;&lt;li&gt;dpipe - two-way pipe here used to connect two switches &lt;/li&gt;&lt;li&gt;vde_plug - connects virtual machine (VM) to a switch&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt; vde_plug2tap - connect tap device to a switch&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;qemu - for running VM&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;s &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size: large;"&gt;Network layout&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;span style="font-size: large;"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://2.bp.blogspot.com/-ObVXC2CIR38/TZhwa33neSI/AAAAAAAAABA/IAsrM8LZuR4/s1600/vde_qemu_sample_staticIPtap0.bmp" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="190" src="http://2.bp.blogspot.com/-ObVXC2CIR38/TZhwa33neSI/AAAAAAAAABA/IAsrM8LZuR4/s320/vde_qemu_sample_staticIPtap0.bmp" width="320" /&gt;&lt;/a&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;Sample network setup consists of two switched networks. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Q1, Q2 &lt;/b&gt;and &lt;b&gt;Q3 &lt;/b&gt;are qemu virtual machines.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;S1,S2&lt;/b&gt;&amp;nbsp; are VDE switches to which VMs are connected.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;S1 and S2 are connected using &lt;b&gt;dpipe &lt;/b&gt;and &lt;b&gt;vde_plug&lt;/b&gt;-s&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;tap0 &lt;/b&gt;is an interface on the actual host machine which is running &lt;b&gt;S2&lt;/b&gt;. tap0 is connected to S2 using &lt;b&gt;vde_tap2plug&lt;/b&gt;.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Scripts&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;Setup scripts are currentlty hosted elsewhere. Click on the link to see the code.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="https://mativait@bitbucket.org/mativait/dss/src/e1c557ccb7cf/1_launch_vde_and_machines.sh"&gt;&lt;span style="font-size: small;"&gt;Launch S1 and S2, boot machines Q1..Q3&amp;nbsp;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="https://mativait@bitbucket.org/mativait/dss/src/e1c557ccb7cf/2_connect_vde_to_world.sh"&gt;&lt;span style="font-size: small;"&gt;Connect S1 and S2 to external world&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: large;"&gt;&lt;a href="https://mativait@bitbucket.org/mativait/dss/src/e1c557ccb7cf/3_stop_qemu_and_vde.sh"&gt;&lt;span style="font-size: small;"&gt;Stop qemu machines and tear down VDE network&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;Sample &lt;a href="https://bitbucket.org/mativait/dss/src/9ced8df2309c/Q2_interfaces"&gt;/etc/network/interfaces&lt;/a&gt; file for qemu machines &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-size: large;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size: large;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style="font-size: large;"&gt;Useful links&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://blog.bodhizazen.net/linux/bridge-wireless-cards/"&gt;How to connect guest and host&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8977635182462077435-6624348097099226815?l=mativait.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mativait.blogspot.com/feeds/6624348097099226815/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mativait.blogspot.com/2011/04/vde-network-setup.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8977635182462077435/posts/default/6624348097099226815'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8977635182462077435/posts/default/6624348097099226815'/><link rel='alternate' type='text/html' href='http://mativait.blogspot.com/2011/04/vde-network-setup.html' title='VDE network setup'/><author><name>Mati</name><uri>http://www.blogger.com/profile/05997225954723147741</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-ObVXC2CIR38/TZhwa33neSI/AAAAAAAAABA/IAsrM8LZuR4/s72-c/vde_qemu_sample_staticIPtap0.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8977635182462077435.post-6578651095844662745</id><published>2011-03-15T01:52:00.000-07:00</published><updated>2011-04-04T10:44:25.484-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vde'/><category scheme='http://www.blogger.com/atom/ns#' term='dss'/><category scheme='http://www.blogger.com/atom/ns#' term='qemu'/><title type='text'>About qemu and VDE</title><content type='html'>&lt;span style="font-size: small;"&gt;&amp;nbsp;This post contains general notes on how to get VDE and qemu running on Ubuntu 10.4. In the future it will be broken up into separate posts when this one gets too long and technical.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;VDE bits and pieces&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;VDE network consists of multiple tools:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;vde_switch - creates a virtual switch&lt;/span&gt;&lt;span style="font-size: small;"&gt; &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;vde_plug, &lt;/span&gt;&lt;span style="font-size: small;"&gt;vde_plug2tap - for creating virtual cables&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;dpipe - two-directional pipe, connects I/O streams of multiple programs&lt;/span&gt;&lt;/li&gt;&lt;li style="color: #999999;"&gt;&lt;span style="font-size: small;"&gt;vdeq, vdekvm (deprecated)&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size: large;"&gt;Creating a VDE network&lt;span style="font-size: small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;Launching VDE switches&lt;/span&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;vde_switch &amp;nbsp;-F -s&lt;/span&gt;&lt;span style="font-size: small;"&gt; path/to/vde/socket&lt;/span&gt;&lt;span style="font-size: small;"&gt; &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;Connect VDE switches&lt;/span&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;use vde_plug, vde_plug2tap, dpipe to connect different vde_switches on the same and/or different machine&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;/ul&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;Adding qemu machines to the VDE network&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;add to qemu command:&amp;nbsp; -net nic,macaddr='unique macaddr' -net vde,sock=path/to/vde/socket&amp;nbsp;&lt;/span&gt;&lt;span style="font-size: small;"&gt; &lt;/span&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;configure network on the guest&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;ol&gt;&lt;ul&gt;&lt;/ul&gt;&lt;/ol&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Recompiling qemu package for Ubuntu&lt;/span&gt;&lt;br /&gt;Ubuntu repository (lucid) does not contain qemu with built in VDE support &lt;a href="http://www.linux-archive.org/ubuntu-server-development/349829-qemu-kvm-vde-networking.html"&gt;(discussion&lt;/a&gt;). That means that one has to compile qemu himself containing VDE support. Here's how I roughly did it based on &lt;a href="http://www.debian.org/doc/FAQ/ch-pkg_basics.en.html"&gt;this&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;#get dependencies and tools for building (clean system probably needs more tools and libs)&amp;nbsp;&lt;/blockquote&gt;&lt;blockquote&gt;apt-get source qemu-kvm&lt;/blockquote&gt;&lt;blockquote&gt;cd qemu-kvm*&lt;/blockquote&gt;&lt;blockquote&gt;sudo sudo apt-get build-dep qemu-kvm&lt;/blockquote&gt;&lt;blockquote&gt;sudo sudo apt-get install devscripts&lt;/blockquote&gt;&lt;blockquote&gt;sudo dch -l local 'qemu-kvm package with vde support'&lt;/blockquote&gt;&lt;blockquote&gt;#configure and build the sources into the package&lt;/blockquote&gt;&lt;blockquote&gt;./configure --enable-vde &amp;nbsp;&lt;/blockquote&gt;&lt;blockquote&gt;debuild -us -uc&lt;/blockquote&gt;&lt;blockquote&gt;# install new packages&lt;/blockquote&gt;&lt;blockquote&gt;cd ..&amp;nbsp;&lt;/blockquote&gt;&lt;blockquote&gt;sudo dpkg -i qemu_0.12.3+noroms-0ubuntu9.4local2_i386.deb&lt;/blockquote&gt;&lt;blockquote&gt;sudo dpkg -i  qemu-kvm_0.12.3+noroms-0ubuntu9.4*.deb&lt;/blockquote&gt;&lt;blockquote&gt;sudo apt-get install qemu-common_0.12.3+noroms-0ubuntu9.4local2_all.deb&lt;/blockquote&gt;&lt;blockquote&gt;sudo aptitude install vgabios seabios                          &lt;/blockquote&gt;&lt;blockquote&gt;sudo dpkg -i  qemu-common_0.12.3+noroms-0ubuntu9.4local2_all.deb&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;Links&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://wiki.virtualsquare.org/wiki/index.php/VDE_Basic_Networking"&gt;http://wiki.virtualsquare.org/wiki/index.php/VDE_Basic_Networking&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge"&gt;http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://people.debian.org/%7Eaurel32/qemu/"&gt;Ready to use qemu images&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size: large;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8977635182462077435-6578651095844662745?l=mativait.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mativait.blogspot.com/feeds/6578651095844662745/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mativait.blogspot.com/2011/03/about-qemu-and-vde.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8977635182462077435/posts/default/6578651095844662745'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8977635182462077435/posts/default/6578651095844662745'/><link rel='alternate' type='text/html' href='http://mativait.blogspot.com/2011/03/about-qemu-and-vde.html' title='About qemu and VDE'/><author><name>Mati</name><uri>http://www.blogger.com/profile/05997225954723147741</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>
