<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel">
    <title>gmane.comp.emulators.kvm.devel</title>
    <link>http://permalink.gmane.org/gmane.comp.emulators.kvm.devel</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25548"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25547"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25546"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25545"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25544"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25543"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25542"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25541"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25540"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25539"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25538"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25534"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25532"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25531"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25530"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25529"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25528"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25527"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25526"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25525"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25548">
    <title>[ kvm-Bugs-2386363 ] virtio-net doesn't set vc-&gt;info_str</title>
    <link>http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25548</link>
    <description>Bugs item #2386363, was opened at 2008-12-03 19:43
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&amp;atid=893831&amp;aid=2386363&amp;group_id=180599

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: qemu
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nolan (sf-nolan)
Assigned to: Nobody/Anonymous (nobody)
Summary: virtio-net doesn't set vc-&gt;info_str

Initial Comment:
Which makes "info network" not show the devices, which makes it difficult to figure out what NIC model a running VM is using via the monitor.

The fix is simple, just add the following to virtio-net.c::virtio_net_init right after the call to qemu_new_vlan_client:
 snprintf(n-&gt;vc-&gt;info_str, sizeof(n-&gt;vc-&gt;info_str),
          "%s macaddr=%02x:%02x:%02x:%02x:%02x:%02x", "virtio",
          n-&gt;nd-&gt;maca</description>
    <dc:creator>SourceForge.net</dc:creator>
    <dc:date>2008-12-04T03:43:34</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25547">
    <title>RE: powerpc kvm-userspace build fixes</title>
    <link>http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25547</link>
    <description>
IA64 still needs it since the upstream doesn't include tcg fixes.  :(
Xiantao

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo&lt; at &gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

</description>
    <dc:creator>Zhang, Xiantao</dc:creator>
    <dc:date>2008-12-04T02:12:56</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25546">
    <title>Re: Virtio network performance problem</title>
    <link>http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25546</link>
    <description>
On an older kernel, you'll likely see packet corruption with virtio-net 
because of an uninitialized variable.  Please try the patch I just 
posted (Fix uninitialized offset in virtio-net receive_header) and let 
me know if it helps.

Regards,

Anthony Liguori

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo&lt; at &gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

</description>
    <dc:creator>Anthony Liguori</dc:creator>
    <dc:date>2008-12-03T20:35:32</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25545">
    <title>[PATCH] Use guards in virtio-net for easier upstream merging</title>
    <link>http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25545</link>
    <description>This gets virtio-net into an upstream acceptable state.  This includes
introducing USE_KVM guards for IO thread notification (where did
qemu_service_io() go?).  It also includes introducing TAP_VNET_HDR which is for
code that relies on the tap vnet support that is not currently in upstream QEMU.

Finally, it drops packets if not ready to receive.  This is unnecessary in
kvm-userspace but necessary in QEMU.

Signed-off-by: Anthony Liguori &lt;aliguori&lt; at &gt;us.ibm.com&gt;

diff --git a/qemu/hw/virtio-net.c b/qemu/hw/virtio-net.c
index 6493ff6..b53feb3 100644
--- a/qemu/hw/virtio-net.c
+++ b/qemu/hw/virtio-net.c
&lt; at &gt;&lt; at &gt; -15,7 +15,11 &lt; at &gt;&lt; at &gt;
 #include "net.h"
 #include "qemu-timer.h"
 #include "virtio-net.h"
+#ifdef USE_KVM
 #include "qemu-kvm.h"
+#endif
+
+//#define TAP_VNET_HDR
 
 typedef struct VirtIONet
 {
&lt; at &gt;&lt; at &gt; -49,9 +53,10 &lt; at &gt;&lt; at &gt; static void virtio_net_update_config(VirtIODevice *vdev, uint8_t *config)
 
 static uint32_t virtio_net_get_features(VirtIODevice *vdev)
 {
+    uint32_t features = (1 &lt;&lt; VIRTIO_NET_F_MAC);
+#ifdef TAP_VNET_</description>
    <dc:creator>Anthony Liguori</dc:creator>
    <dc:date>2008-12-03T20:32:10</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25544">
    <title>[PATCH] Fix unitialized offset in virtio-net receive_header</title>
    <link>http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25544</link>
    <description>If vnet support is not available on the tap device, offset is uninitialized and
badness ensues.

Signed-off-by: Anthony Liguori &lt;aliguori&lt; at &gt;us.ibm.com&gt;

diff --git a/qemu/hw/virtio-net.c b/qemu/hw/virtio-net.c
index b5d5f9e..4d7e6ad 100644
--- a/qemu/hw/virtio-net.c
+++ b/qemu/hw/virtio-net.c
&lt; at &gt;&lt; at &gt; -219,7 +219,7 &lt; at &gt;&lt; at &gt; static int receive_header(VirtIONet *n, struct iovec *iov, int iovcnt,
   const void *buf, int size, int hdr_len)
 {
     struct virtio_net_hdr *hdr = iov[0].iov_base;
-    int offset;
+    int offset = 0;
 
     hdr-&gt;flags = 0;
     hdr-&gt;gso_type = VIRTIO_NET_HDR_GSO_NONE;
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo&lt; at &gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

</description>
    <dc:creator>Anthony Liguori</dc:creator>
    <dc:date>2008-12-03T20:27:06</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25543">
    <title>Re: Virtio network performance problem</title>
    <link>http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25543</link>
    <description>

Actually, worded badly.

A UP guest on an SMP host with unsync'ed TSCs would show this too
obviously.  As would changes in the TSC speed.  The first I guess we
can avoid by pinning that latter I'm not so sure about.

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo&lt; at &gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

</description>
    <dc:creator>Chris Wedgwood</dc:creator>
    <dc:date>2008-12-03T19:21:33</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25542">
    <title>Re: [PATCH 0 of 6] PowerPC KVM patches for 2.6.29</title>
    <link>http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25542</link>
    <description>
Well, I suppose we could save the timestamp to the vcpu, and call
kvmtrace code later using that data. I'll stop now and let Christian
comment when he's back. :)

</description>
    <dc:creator>Hollis Blanchard</dc:creator>
    <dc:date>2008-12-03T19:31:17</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25541">
    <title>Re: Virtio network performance problem</title>
    <link>http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25541</link>
    <description>


TSC instability?  Is this an SMP guest?
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo&lt; at &gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

</description>
    <dc:creator>Chris Wedgwood</dc:creator>
    <dc:date>2008-12-03T19:20:08</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25540">
    <title>RE: Virtio network performance problem</title>
    <link>http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25540</link>
    <description>
I don't know enough to tell whether there's a TSC problem or not, to be
honest. The host has 2X AMD quad-core CPUs (let me know if you want the
/proc/cpuinfo). The guest has 2 VCPUs. 
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo&lt; at &gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

</description>
    <dc:creator>Adrian Schmitz</dc:creator>
    <dc:date>2008-12-03T19:27:15</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25539">
    <title>Re: [PATCH 0 of 6] PowerPC KVM patches for 2.6.29</title>
    <link>http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25539</link>
    <description>
However, we grab timestamps extremely early and late in the exit
handlers, in contexts from which it is not safe to call C code. This is
really important because we need to be able to measure the time spent in
the interrupt handler assembly. For x86 that may be confined to a simple
inline asm statement, but the code in
arch/powerpc/kvm/booke_interrupts.S is non-trivial and worth measuring.

</description>
    <dc:creator>Hollis Blanchard</dc:creator>
    <dc:date>2008-12-03T19:22:13</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25538">
    <title>Virtio network performance problem</title>
    <link>http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25538</link>
    <description>I'm having a problem with virtio networking. I mentioned this in a
previous thread, but I'm starting a new one since Dor solved the problem
I reported in the original thread. This appears to be a new problem.

Iperf shows throughput of ~120 Mb/s between a Windows Server 2003 x64
guest and the br0 interface on the host. Also, a ping between the same
two interfaces looks pretty bad:

Pinging 10.10.10.128 with 32 bytes of data:
Reply from 10.10.10.128: bytes=32 time=-389ms TTL=64
Reply from 10.10.10.128: bytes=32 time&lt;1ms TTL=64
Reply from 10.10.10.128: bytes=32 time=392ms TTL=64
Reply from 10.10.10.128: bytes=32 time=392ms TTL=64
Reply from 10.10.10.128: bytes=32 time=377ms TTL=64
Reply from 10.10.10.128: bytes=32 time=392ms TTL=64
Reply from 10.10.10.128: bytes=32 time&lt;1ms TTL=64
Reply from 10.10.10.128: bytes=32 time=401ms TTL=64
Reply from 10.10.10.128: bytes=32 time=1ms TTL=64

Using e1000 driver on this guest, iperf shows 320+ Mb/s throughput, and
latency looks like it should.

Host kernel:2.6.18
KVM V</description>
    <dc:creator>Adrian Schmitz</dc:creator>
    <dc:date>2008-12-03T19:11:45</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25534">
    <title>kvm-userspace ppc fixes</title>
    <link>http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25534</link>
    <description>Hi Avi, among these patches are fixes for a number of bugs in kvm-userspace,
including the qemu build break and bugs in the "user" directory. Please apply.

-Hollis


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo&lt; at &gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

</description>
    <dc:creator>Hollis Blanchard</dc:creator>
    <dc:date>2008-12-03T19:07:26</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25532">
    <title>[PATCH 5/5] user: ppc: Add "hello world" test for libcflat</title>
    <link>http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25532</link>
    <description>From: Deepa Srinivasan &lt;deepas&lt; at &gt;us.ibm.com&gt;

Add a test program ("hello world") to exercise printf() in libcflat.

Signed-off-by: Deepa Srinivasan &lt;deepas&lt; at &gt;us.ibm.com&gt;
Signed-off-by: Hollis Blanchard &lt;hollisb&lt; at &gt;us.ibm.com&gt;
---
 user/config-powerpc.mak        |    3 ++-
 user/test/powerpc/helloworld.c |   27 +++++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 1 deletions(-)
 create mode 100644 user/test/powerpc/helloworld.c

diff --git a/user/config-powerpc.mak b/user/config-powerpc.mak
index 79af245..dd7ef54 100644
--- a/user/config-powerpc.mak
+++ b/user/config-powerpc.mak
&lt; at &gt;&lt; at &gt; -17,7 +17,8 &lt; at &gt;&lt; at &gt; simpletests := \
 
 # theses tests use cstart.o, libcflat, and libgcc
 tests := \
-test/powerpc/exit.bin
+test/powerpc/exit.bin \
+test/powerpc/helloworld.bin
 
 include config-powerpc-$(PROCESSOR).mak
 
diff --git a/user/test/powerpc/helloworld.c b/user/test/powerpc/helloworld.c
new file mode 100644
index 0000000..f8630f7
--- /dev/null
+++ b/user/test/powerpc/helloworld.c
&lt; at &gt;&lt; at &gt; -0,0 +1,27 &lt; at &gt;&lt; at &gt;
+/*
+ * This program</description>
    <dc:creator>Hollis Blanchard</dc:creator>
    <dc:date>2008-12-03T19:07:31</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25531">
    <title>Re: powerpc kvm-userspace build fixes</title>
    <link>http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25531</link>
    <description>
I'll send the fix in a separate mail.

Looks like we missed the addition of a dependency from upstream, which
we probably didn't get because it conflicted with the
--disable-cpu-emulation patch in kvm-userspace.

PowerPC stopped using that once upstream fixed PowerPC host builds. If
IA64 doesn't use it (and I don't think they do), we can probably drop
that patch completely, which should make future merges a little
easier...

IA64 people?

</description>
    <dc:creator>Hollis Blanchard</dc:creator>
    <dc:date>2008-12-03T19:03:36</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25530">
    <title>Re: Hangs</title>
    <link>http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25530</link>
    <description>
The guest is Ubuntu 8.10 server (64-bit version).  I also have the same 
problems with Ubuntu 8.04LTS server.

Here's the command line:

sudo /usr/local/bin/qemu-system-x86_64        \
     -no-kvm-irqchip                         \
     -daemonize                               \
     -hda Imgs/sam_home.img                   \
     -m 512                                   \
     -cdrom ISOs/ubuntu-8.10-server-amd64.iso \
     -parallel /dev/lp0                       \
     -vnc :1                                  \
     -net nic,macaddr=DE:AD:BE:EF:01:01,model=e1000 \
     -net tap,ifname=tap1,script=/home/chris/kvm/qemu-ifup.sh \
     &gt;&gt;&amp; Logs/sam_run.log

Earlier in the mail chain, Marcelo had me run vmstat when it was hung,
and it was all zeros.  He also asked for a stack trace on the qemu and it
showed two threads:

(gdb) info threads
  2 Thread 0x414f1950 (LWP 422)  0x00007f36f07a03e1 in sigtimedwait ()
   from /lib/libc.so.6
  1 Thread 0x7f36f1f306e0 (LWP 414)  0x00007f36f084b482 in select ()
   f</description>
    <dc:creator>chris&lt; at &gt;versecorp.net</dc:creator>
    <dc:date>2008-12-03T17:49:18</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25529">
    <title>[PATCH 2/7] Create virtio-blk.h header</title>
    <link>http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25529</link>
    <description>Besides cleanliness, targets other than pc want to use virtio-blk so we need to
have to define it somewhere other than pc.h

Signed-off-by: Anthony Liguori &lt;aliguori&lt; at &gt;us.ibm.com&gt;

diff --git a/qemu/hw/pc.c b/qemu/hw/pc.c
index 6de460c..ee38326 100644
--- a/qemu/hw/pc.c
+++ b/qemu/hw/pc.c
&lt; at &gt;&lt; at &gt; -34,6 +34,7 &lt; at &gt;&lt; at &gt;
 #include "console.h"
 #include "fw_cfg.h"
 #include "device-assignment.h"
+#include "virtio-blk.h"
 
 #include "qemu-kvm.h"
 
diff --git a/qemu/hw/pc.h b/qemu/hw/pc.h
index 5349a41..a874fbd 100644
--- a/qemu/hw/pc.h
+++ b/qemu/hw/pc.h
&lt; at &gt;&lt; at &gt; -168,10 +168,6 &lt; at &gt;&lt; at &gt; void isa_ne2000_init(int base, qemu_irq irq, NICInfo *nd);
 
 PCIDevice *virtio_net_init(PCIBus *bus, NICInfo *nd, int devfn);
 
-/* virtio-blk.h */
-void *virtio_blk_init(PCIBus *bus, uint16_t vendor, uint16_t device,
-      BlockDriverState *bs);
-
 /* extboot.c */
 
 void extboot_init(BlockDriverState *bs, int cmd);
diff --git a/qemu/hw/virtio-blk.c b/qemu/hw/virtio-blk.c
index c9a91ba..bd965f9 100644
--- a/qemu/hw/virtio-blk.c
+++ b/qemu/hw/virtio-bl</description>
    <dc:creator>Anthony Liguori</dc:creator>
    <dc:date>2008-12-03T17:26:56</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25528">
    <title>[PATCH 4/7] Move virtio_balloon_init to virtio-balloon.h</title>
    <link>http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25528</link>
    <description>Besides cleanliness, targets other than pc want to use virtio-balloon so we
need to have to define it somewhere other than pc.h

Signed-off-by: Anthony Liguori &lt;aliguori&lt; at &gt;us.ibm.com&gt;

diff --git a/qemu/hw/pc.c b/qemu/hw/pc.c
index ee38326..92a8615 100644
--- a/qemu/hw/pc.c
+++ b/qemu/hw/pc.c
&lt; at &gt;&lt; at &gt; -35,6 +35,7 &lt; at &gt;&lt; at &gt;
 #include "fw_cfg.h"
 #include "device-assignment.h"
 #include "virtio-blk.h"
+#include "virtio-balloon.h"
 
 #include "qemu-kvm.h"
 
diff --git a/qemu/hw/pc.h b/qemu/hw/pc.h
index 5b90198..8cfa1ca 100644
--- a/qemu/hw/pc.h
+++ b/qemu/hw/pc.h
&lt; at &gt;&lt; at &gt; -168,7 +168,4 &lt; at &gt;&lt; at &gt; void isa_ne2000_init(int base, qemu_irq irq, NICInfo *nd);
 
 void extboot_init(BlockDriverState *bs, int cmd);
 
-/* virtio-balloon.h */
-void *virtio_balloon_init(PCIBus *bus);
-
 #endif
diff --git a/qemu/hw/virtio-balloon.h b/qemu/hw/virtio-balloon.h
index 45e4b03..c71f970 100644
--- a/qemu/hw/virtio-balloon.h
+++ b/qemu/hw/virtio-balloon.h
&lt; at &gt;&lt; at &gt; -15,6 +15,9 &lt; at &gt;&lt; at &gt;
 #ifndef _QEMU_VIRTIO_BALLOON_H
 #define _QEMU_VIRTIO_BALLOON_H
 
+#include "virtio.h"</description>
    <dc:creator>Anthony Liguori</dc:creator>
    <dc:date>2008-12-03T17:26:58</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25527">
    <title>[PATCH 1/7] Fix whitespace in virtio</title>
    <link>http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25527</link>
    <description>Whoever originally wrote the virtio code quite rudely didn't configure their
editor to use spaces instead of tabs.  This patch corrects this for all virtio
related files.

Signed-off-by: Anthony Liguori &lt;aliguori&lt; at &gt;us.ibm.com&gt;

diff --git a/qemu/hw/virtio-balloon.c b/qemu/hw/virtio-balloon.c
index 111f27d..9b34e87 100644
--- a/qemu/hw/virtio-balloon.c
+++ b/qemu/hw/virtio-balloon.c
&lt; at &gt;&lt; at &gt; -79,26 +79,26 &lt; at &gt;&lt; at &gt; static void virtio_balloon_handle_output(VirtIODevice *vdev, VirtQueue *vq)
     VirtQueueElement elem;
 
     while (virtqueue_pop(vq, &amp;elem)) {
-size_t offset = 0;
-uint32_t pfn;
+        size_t offset = 0;
+        uint32_t pfn;
 
-while (memcpy_from_iovector(&amp;pfn, offset, 4,
+        while (memcpy_from_iovector(&amp;pfn, offset, 4,
                                     elem.out_sg, elem.out_num) == 4) {
-    ram_addr_t pa;
-    ram_addr_t addr;
+            ram_addr_t pa;
+            ram_addr_t addr;
 
-    pa = (ram_addr_t)ldl_p(&amp;pfn) &lt;&lt; VIRTIO_BALLOON_PFN_SHIFT;
-    offset += 4;
+            pa = (ram_a</description>
    <dc:creator>Anthony Liguori</dc:creator>
    <dc:date>2008-12-03T17:26:55</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25526">
    <title>[PATCH 5/7] Do not access virtio-rings directly</title>
    <link>http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25526</link>
    <description>This introduces accessors for all virtio ring members and then uses the
appropriate physical memory accessors.  We shouldn't access guest physical
memory directly and this fixes that.  As a consequence, this helps us get closer
to working live migration.

I've done light performance testing and it seems to not have an impact.  If
further testing demonstrates an impact, we can optimize the physical memory
accessor functions.

Signed-off-by: Anthony Liguori &lt;aliguori&lt; at &gt;us.ibm.com&gt;

diff --git a/qemu/hw/virtio-net.c b/qemu/hw/virtio-net.c
index f621ff3..b64fb00 100644
--- a/qemu/hw/virtio-net.c
+++ b/qemu/hw/virtio-net.c
&lt; at &gt;&lt; at &gt; -101,18 +101,18 &lt; at &gt;&lt; at &gt; static int virtio_net_can_receive(void *opaque)
 {
     VirtIONet *n = opaque;
 
-    if (n-&gt;rx_vq-&gt;vring.avail == NULL ||
+    if (!virtio_queue_ready(n-&gt;rx_vq) ||
         !(n-&gt;vdev.status &amp; VIRTIO_CONFIG_S_DRIVER_OK))
         return 0;
 
-    if (n-&gt;rx_vq-&gt;vring.avail-&gt;idx == n-&gt;rx_vq-&gt;last_avail_idx ||
+    if (virtio_queue_empty(n-&gt;rx_vq) ||
         (n-&gt;mergeable_rx_b</description>
    <dc:creator>Anthony Liguori</dc:creator>
    <dc:date>2008-12-03T17:26:59</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25525">
    <title>[PATCH 3/7] Create virtio-net.h header</title>
    <link>http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25525</link>
    <description>Besides cleanliness, targets other than pc want to use virtio-net so we need to
have to define it somewhere other than pc.h

Signed-off-by: Anthony Liguori &lt;aliguori&lt; at &gt;us.ibm.com&gt;

diff --git a/qemu/hw/pc.h b/qemu/hw/pc.h
index a874fbd..5b90198 100644
--- a/qemu/hw/pc.h
+++ b/qemu/hw/pc.h
&lt; at &gt;&lt; at &gt; -164,10 +164,6 &lt; at &gt;&lt; at &gt; void pci_piix4_ide_init(PCIBus *bus, BlockDriverState **hd_table, int devfn,
 
 void isa_ne2000_init(int base, qemu_irq irq, NICInfo *nd);
 
-/* virtio-net.c */
-
-PCIDevice *virtio_net_init(PCIBus *bus, NICInfo *nd, int devfn);
-
 /* extboot.c */
 
 void extboot_init(BlockDriverState *bs, int cmd);
diff --git a/qemu/hw/pci.c b/qemu/hw/pci.c
index 75bc9a9..c93758d 100644
--- a/qemu/hw/pci.c
+++ b/qemu/hw/pci.c
&lt; at &gt;&lt; at &gt; -27,6 +27,7 &lt; at &gt;&lt; at &gt;
 #include "net.h"
 #include "pc.h"
 #include "qemu-kvm.h"
+#include "virtio-net.h"
 
 //#define DEBUG_PCI
 
diff --git a/qemu/hw/virtio-net.c b/qemu/hw/virtio-net.c
index b179fcc..f621ff3 100644
--- a/qemu/hw/virtio-net.c
+++ b/qemu/hw/virtio-net.c
&lt; at &gt;&lt; at &gt; -14,65 +14,9 &lt; at &gt;&lt; at &gt;
 #include "vir</description>
    <dc:creator>Anthony Liguori</dc:creator>
    <dc:date>2008-12-03T17:26:57</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25524">
    <title>[PATCH 6/7] Do not modify VirtQueueElement</title>
    <link>http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25524</link>
    <description>Right now, virtio-net modifies the iovec structure in VirtQueueElement.  This is
evil.  This creates an impossible situation if we want to bounce iovec buffers
in VirtQueueElement as we lose track of the original buffers and the resulting
free results in very bad things.

I tried to refactor receive_headers() and iov_fill() to be able to skip the
header if present but failed miserably.  Instead of spending more time trying to
get that to work, I simply decided to leave the code as-is and copy the iovec
to a temporary buffer.

I doubt there will be any performance impact as usually there are only a few
elements in the iovec anyway.

Signed-off-by: Anthony Liguori &lt;aliguori&lt; at &gt;us.ibm.com&gt;

diff --git a/qemu/hw/virtio-net.c b/qemu/hw/virtio-net.c
index b64fb00..6493ff6 100644
--- a/qemu/hw/virtio-net.c
+++ b/qemu/hw/virtio-net.c
&lt; at &gt;&lt; at &gt; -198,6 +198,7 &lt; at &gt;&lt; at &gt; static void virtio_net_receive(void *opaque, const uint8_t *buf, int size)
     while (offset &lt; size) {
         VirtQueueElement elem;
         int len, total;
+      </description>
    <dc:creator>Anthony Liguori</dc:creator>
    <dc:date>2008-12-03T17:27:00</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.emulators.kvm.devel">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.emulators.kvm.devel</link>
  </textinput>
</rdf:RDF>
