* [Qemu-devel] [PATCH] xen: net backend doesn't need linux headers. @ 2009-06-02 7:05 Gerd Hoffmann 2009-06-06 15:52 ` Blue Swirl 0 siblings, 1 reply; 8+ messages in thread From: Gerd Hoffmann @ 2009-06-02 7:05 UTC (permalink / raw) To: qemu-devel, xen-devel; +Cc: Andreas Färber, Gerd Hoffmann Drop them to make qemu build on OpenSolaris. Cc: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> --- hw/xen_nic.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/hw/xen_nic.c b/hw/xen_nic.c index 8abe319..1d91e62 100644 --- a/hw/xen_nic.c +++ b/hw/xen_nic.c @@ -33,8 +33,6 @@ #include <sys/stat.h> #include <sys/mman.h> #include <sys/wait.h> -#include <linux/if.h> -#include <linux/if_tun.h> #include <xs.h> #include <xenctrl.h> -- 1.6.2.2 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] xen: net backend doesn't need linux headers. 2009-06-02 7:05 [Qemu-devel] [PATCH] xen: net backend doesn't need linux headers Gerd Hoffmann @ 2009-06-06 15:52 ` Blue Swirl 2009-06-06 19:43 ` Andreas Färber 0 siblings, 1 reply; 8+ messages in thread From: Blue Swirl @ 2009-06-06 15:52 UTC (permalink / raw) To: Gerd Hoffmann; +Cc: Andreas Färber, xen-devel, qemu-devel On 6/2/09, Gerd Hoffmann <kraxel@redhat.com> wrote: > Drop them to make qemu build on OpenSolaris. > > Cc: Andreas Färber <andreas.faerber@web.de> > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Thanks, applied. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] xen: net backend doesn't need linux headers. 2009-06-06 15:52 ` Blue Swirl @ 2009-06-06 19:43 ` Andreas Färber 2009-06-06 20:51 ` Andreas Färber 2009-06-08 7:00 ` Gerd Hoffmann 0 siblings, 2 replies; 8+ messages in thread From: Andreas Färber @ 2009-06-06 19:43 UTC (permalink / raw) To: Gerd Hoffmann; +Cc: Blue Swirl, xen-devel, qemu-devel Am 06.06.2009 um 17:52 schrieb Blue Swirl: > On 6/2/09, Gerd Hoffmann <kraxel@redhat.com> wrote: >> Drop them to make qemu build on OpenSolaris. >> >> Cc: Andreas Färber <andreas.faerber@web.de> >> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> > > Thanks, applied. Thanks, the patch helps, but doesn't fully fix the build: CC xen_backend.o CC xen_devconfig.o CC xen_console.o CC xenfb.o CC xen_disk.o In file included from /export/home/andreas/QEMU/qemu/hw/xen_disk.c:43: /export/home/andreas/QEMU/qemu/hw/xen_blkif.h:20: warning: #pragma pack(push[, id], <n>) is not supported on this target /export/home/andreas/QEMU/qemu/hw/xen_blkif.h:36: warning: #pragma pack(pop[, id], <n>) is not supported on this target CC xen_nic.o /export/home/andreas/QEMU/qemu/hw/xen_nic.c: In function `net_tx_packets': /export/home/andreas/QEMU/qemu/hw/xen_nic.c:179: error: `PAGE_SIZE' undeclared (first use in this function) /export/home/andreas/QEMU/qemu/hw/xen_nic.c:179: error: (Each undeclared identifier is reported only once /export/home/andreas/QEMU/qemu/hw/xen_nic.c:179: error: for each function it appears in.) make: *** [xen_nic.o] Error 1 A quick search for PAGE_SIZE revealed some posts saying that PAGE_SIZE shouldn't be used in userland and be replaced with getpagesize(). Looking at the code though I see a number of XC_PAGE_SIZE that don't result in errors. Might PAGE_SIZE be a typo then? Andreas ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] xen: net backend doesn't need linux headers. 2009-06-06 19:43 ` Andreas Färber @ 2009-06-06 20:51 ` Andreas Färber 2009-06-07 6:56 ` Blue Swirl 2009-06-08 7:00 ` Gerd Hoffmann 1 sibling, 1 reply; 8+ messages in thread From: Andreas Färber @ 2009-06-06 20:51 UTC (permalink / raw) To: Gerd Hoffmann; +Cc: Blue Swirl, xen-devel, xen-discuss, qemu-devel Am 06.06.2009 um 21:43 schrieb Andreas Färber: > > Am 06.06.2009 um 17:52 schrieb Blue Swirl: > >> On 6/2/09, Gerd Hoffmann <kraxel@redhat.com> wrote: >>> Drop them to make qemu build on OpenSolaris. >>> >>> Cc: Andreas Färber <andreas.faerber@web.de> >>> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> >> >> Thanks, applied. > > Thanks, the patch helps, but doesn't fully fix the build: > > CC xen_backend.o > CC xen_devconfig.o > CC xen_console.o > CC xenfb.o > CC xen_disk.o > In file included from /export/home/andreas/QEMU/qemu/hw/xen_disk.c:43: > /export/home/andreas/QEMU/qemu/hw/xen_blkif.h:20: warning: #pragma > pack(push[, id], <n>) is not supported on this target > /export/home/andreas/QEMU/qemu/hw/xen_blkif.h:36: warning: #pragma > pack(pop[, id], <n>) is not supported on this target > CC xen_nic.o > /export/home/andreas/QEMU/qemu/hw/xen_nic.c: In function > `net_tx_packets': > /export/home/andreas/QEMU/qemu/hw/xen_nic.c:179: error: `PAGE_SIZE' > undeclared (first use in this function) > /export/home/andreas/QEMU/qemu/hw/xen_nic.c:179: error: (Each > undeclared identifier is reported only once > /export/home/andreas/QEMU/qemu/hw/xen_nic.c:179: error: for each > function it appears in.) > make: *** [xen_nic.o] Error 1 > > A quick search for PAGE_SIZE revealed some posts saying that > PAGE_SIZE shouldn't be used in userland and be replaced with > getpagesize(). Looking at the code though I see a number of > XC_PAGE_SIZE that don't result in errors. Might PAGE_SIZE be a typo > then? With this patch xen_nic.c compiles: diff --git a/hw/xen_nic.c b/hw/xen_nic.c index 048d865..3615c8c 100644 --- a/hw/xen_nic.c +++ b/hw/xen_nic.c @@ -176,7 +176,7 @@ static void net_tx_packets(struct XenNetDev *netdev) if (txreq.flags & NETTXF_csum_blank) { /* have read-only mapping -> can't fill checksum in- place */ if (!tmpbuf) - tmpbuf = malloc(PAGE_SIZE); + tmpbuf = malloc(XC_PAGE_SIZE); memcpy(tmpbuf, page + txreq.offset, txreq.size); net_checksum_calculate(tmpbuf, txreq.size); qemu_send_packet(netdev->vs, tmpbuf, txreq.size); If then goes on to compile Xen stuff into sparc-softmmu and fails: CC sparc-softmmu/xen_machine_pv.o /export/home/andreas/QEMU/qemu/hw/xen_machine_pv.c:116: warning: initialization from incompatible pointer type CC sparc-softmmu/xen_domainbuild.o [...] LINK sparc-softmmu/qemu-system-sparc Undefined first referenced symbol in file xc_gnttab_map_grant_refs ../libqemu_common.a(xen_disk.o) xc_gnttab_map_grant_ref ../libqemu_common.a(xen_disk.o) xc_gnttab_munmap ../libqemu_common.a(xen_disk.o) xc_gnttab_open ../libqemu_common.a(xen_backend.o) ld: fatal: symbol referencing errors. No output written to qemu-system- sparc collect2: ld returned 1 exit status gmake[1]: *** [qemu-system-sparc] Error 1 make: *** [subdir-sparc-softmmu] Error 2 Same errors when linking i386-softmmu. OpenSolaris 2009.06 has SUNWxvm@3.1,5.11-111, I interpret this as being Xen 3.1 - is that maybe too old? Perhaps it's easier to just have QEMU's configure disable Xen support on Solaris for now then? Andreas ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] xen: net backend doesn't need linux headers. 2009-06-06 20:51 ` Andreas Färber @ 2009-06-07 6:56 ` Blue Swirl 2009-06-08 7:14 ` Gerd Hoffmann 0 siblings, 1 reply; 8+ messages in thread From: Blue Swirl @ 2009-06-07 6:56 UTC (permalink / raw) To: Andreas Färber; +Cc: xen-devel, xen-discuss, Gerd Hoffmann, qemu-devel On 6/6/09, Andreas Färber <andreas.faerber@web.de> wrote: > > Am 06.06.2009 um 21:43 schrieb Andreas Färber: > > > > > > > Am 06.06.2009 um 17:52 schrieb Blue Swirl: > > > > > > > On 6/2/09, Gerd Hoffmann <kraxel@redhat.com> wrote: > > > > > > > Drop them to make qemu build on OpenSolaris. > > > > > > > > Cc: Andreas Färber <andreas.faerber@web.de> > > > > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> > > > > > > > > > > Thanks, applied. > > > > > > > Thanks, the patch helps, but doesn't fully fix the build: > > > > CC xen_backend.o > > CC xen_devconfig.o > > CC xen_console.o > > CC xenfb.o > > CC xen_disk.o > > In file included from > /export/home/andreas/QEMU/qemu/hw/xen_disk.c:43: > > /export/home/andreas/QEMU/qemu/hw/xen_blkif.h:20: > warning: #pragma pack(push[, id], <n>) is not supported on this target > > /export/home/andreas/QEMU/qemu/hw/xen_blkif.h:36: > warning: #pragma pack(pop[, id], <n>) is not supported on this target > > CC xen_nic.o > > /export/home/andreas/QEMU/qemu/hw/xen_nic.c: In function > `net_tx_packets': > > /export/home/andreas/QEMU/qemu/hw/xen_nic.c:179: error: > `PAGE_SIZE' undeclared (first use in this function) > > /export/home/andreas/QEMU/qemu/hw/xen_nic.c:179: error: > (Each undeclared identifier is reported only once > > /export/home/andreas/QEMU/qemu/hw/xen_nic.c:179: error: > for each function it appears in.) > > make: *** [xen_nic.o] Error 1 > > > > A quick search for PAGE_SIZE revealed some posts saying that PAGE_SIZE > shouldn't be used in userland and be replaced with getpagesize(). Looking at > the code though I see a number of XC_PAGE_SIZE that don't result in errors. > Might PAGE_SIZE be a typo then? > > > > With this patch xen_nic.c compiles: > > diff --git a/hw/xen_nic.c b/hw/xen_nic.c > index 048d865..3615c8c 100644 > --- a/hw/xen_nic.c > +++ b/hw/xen_nic.c > @@ -176,7 +176,7 @@ static void net_tx_packets(struct XenNetDev *netdev) > if (txreq.flags & NETTXF_csum_blank) { > /* have read-only mapping -> can't fill checksum in-place */ > if (!tmpbuf) > - tmpbuf = malloc(PAGE_SIZE); > + tmpbuf = malloc(XC_PAGE_SIZE); > memcpy(tmpbuf, page + txreq.offset, txreq.size); > net_checksum_calculate(tmpbuf, txreq.size); > qemu_send_packet(netdev->vs, tmpbuf, txreq.size); It also looks like there is no real need for using host or target page size, so we could use for example MIN(4096, txreq.size). > If then goes on to compile Xen stuff into sparc-softmmu and fails: > > CC sparc-softmmu/xen_machine_pv.o > /export/home/andreas/QEMU/qemu/hw/xen_machine_pv.c:116: > warning: initialization from incompatible pointer type > CC sparc-softmmu/xen_domainbuild.o > [...] > LINK sparc-softmmu/qemu-system-sparc > Undefined first referenced > symbol in file > xc_gnttab_map_grant_refs > ../libqemu_common.a(xen_disk.o) > xc_gnttab_map_grant_ref > ../libqemu_common.a(xen_disk.o) > xc_gnttab_munmap > ../libqemu_common.a(xen_disk.o) > xc_gnttab_open > ../libqemu_common.a(xen_backend.o) > ld: fatal: symbol referencing errors. No output written to > qemu-system-sparc > collect2: ld returned 1 exit status > gmake[1]: *** [qemu-system-sparc] Error 1 > make: *** [subdir-sparc-softmmu] Error 2 > > Same errors when linking i386-softmmu. > > OpenSolaris 2009.06 has SUNWxvm@3.1,5.11-111, I interpret this as being Xen > 3.1 - is that maybe too old? > Perhaps it's easier to just have QEMU's configure disable Xen support on > Solaris for now then? configure should probe for xc_gnttab symbols and disable Xen if these are not found. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] xen: net backend doesn't need linux headers. 2009-06-07 6:56 ` Blue Swirl @ 2009-06-08 7:14 ` Gerd Hoffmann 0 siblings, 0 replies; 8+ messages in thread From: Gerd Hoffmann @ 2009-06-08 7:14 UTC (permalink / raw) To: Blue Swirl; +Cc: Andreas Färber, xen-devel, xen-discuss, qemu-devel On 06/07/09 08:56, Blue Swirl wrote: >> - tmpbuf = malloc(PAGE_SIZE); >> + tmpbuf = malloc(XC_PAGE_SIZE); > It also looks like there is no real need for using host or target page > size, so we could use for example MIN(4096, txreq.size). No. XC_PAGE_SIZE is the max buffer size. As the buffer allocated here could be resused for multiple packets you'll have to use that, otherwise you'll overflow the buffer in case the second packet is larger than the first one. >> If then goes on to compile Xen stuff into sparc-softmmu and fails: Hmm, it shouldn't try that in the first place. Guess this is the result of this commit: http://git.savannah.gnu.org/cgit/qemu.git/commit/?id=2567f5796c38238d6f2055f074e347a0338140ce >> xc_gnttab_open >> collect2: ld returned 1 exit status >> Same errors when linking i386-softmmu. For i386-softmmu it should work. > configure should probe for xc_gnttab symbols and disable Xen if these > are not found. Strange. configure checks for xc_interface_open. Both xc_interface_open and xc_gnttab_open are in the same shared library. So it should work in theory, dunno what the problem here is. Hmm, the linker complains about xc_gnttab_* only, not about the other xc_* functions missing. Maybe solaris simply has no support for them? cheers, Gerd ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] xen: net backend doesn't need linux headers. 2009-06-06 19:43 ` Andreas Färber 2009-06-06 20:51 ` Andreas Färber @ 2009-06-08 7:00 ` Gerd Hoffmann 2009-06-13 12:30 ` Andreas Färber 1 sibling, 1 reply; 8+ messages in thread From: Gerd Hoffmann @ 2009-06-08 7:00 UTC (permalink / raw) To: Andreas Färber; +Cc: Blue Swirl, xen-devel, qemu-devel On 06/06/09 21:43, Andreas Färber wrote: > In file included from /export/home/andreas/QEMU/qemu/hw/xen_disk.c:43: > /export/home/andreas/QEMU/qemu/hw/xen_blkif.h:20: warning: #pragma > pack(push[, id], <n>) is not supported on this target > /export/home/andreas/QEMU/qemu/hw/xen_blkif.h:36: warning: #pragma > pack(pop[, id], <n>) is not supported on this target > CC xen_nic.o Hmm, is this a x86 or sparc machine? > /export/home/andreas/QEMU/qemu/hw/xen_nic.c:179: error: `PAGE_SIZE' > undeclared (first use in this function) > Looking at the code though I see a number of XC_PAGE_SIZE that don't > result in errors. Might PAGE_SIZE be a typo then? Yes, XC_PAGE_SIZE should be used here. cheers, Gerd ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] xen: net backend doesn't need linux headers. 2009-06-08 7:00 ` Gerd Hoffmann @ 2009-06-13 12:30 ` Andreas Färber 0 siblings, 0 replies; 8+ messages in thread From: Andreas Färber @ 2009-06-13 12:30 UTC (permalink / raw) To: Gerd Hoffmann; +Cc: Blue Swirl, xen-devel, qemu-devel Am 08.06.2009 um 09:00 schrieb Gerd Hoffmann: > On 06/06/09 21:43, Andreas Färber wrote: >> In file included from /export/home/andreas/QEMU/qemu/hw/xen_disk.c: >> 43: >> /export/home/andreas/QEMU/qemu/hw/xen_blkif.h:20: warning: #pragma >> pack(push[, id], <n>) is not supported on this target >> /export/home/andreas/QEMU/qemu/hw/xen_blkif.h:36: warning: #pragma >> pack(pop[, id], <n>) is not supported on this target >> CC xen_nic.o > > Hmm, is this a x86 or sparc machine? x86 (amd64) Andreas ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-06-13 12:31 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-06-02 7:05 [Qemu-devel] [PATCH] xen: net backend doesn't need linux headers Gerd Hoffmann 2009-06-06 15:52 ` Blue Swirl 2009-06-06 19:43 ` Andreas Färber 2009-06-06 20:51 ` Andreas Färber 2009-06-07 6:56 ` Blue Swirl 2009-06-08 7:14 ` Gerd Hoffmann 2009-06-08 7:00 ` Gerd Hoffmann 2009-06-13 12:30 ` Andreas Färber
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).