From: Dor L. <dor...@qu...> - 2007-08-25 00:19:51
|
This is the pci device side in qemu. It just used as a glue between the pci, tap and virtio code. Signed-off-by: Dor Laor <dor...@qu...> --- qemu/hw/paravirt_net.c | 213 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 213 insertions(+), 0 deletions(-) create mode 100644 qemu/hw/paravirt_net.c diff --git a/qemu/hw/paravirt_net.c b/qemu/hw/paravirt_net.c new file mode 100644 index 0000000..fdf2f1c --- /dev/null +++ b/qemu/hw/paravirt_net.c @@ -0,0 +1,213 @@ +/* + * QEMU para virtual network emulation + *=20 + * Copyright (c) 2007 Qumranet + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#include "vl.h" +#include "virtio.h" +#include "qemu-kvm.h" + +#define DEBUG_PARANET + +typedef struct PARANETState { + uint8_t macaddr[6]; + uint8_t mult[8]; /* multicast mask array */ + PCIDevice *pci_dev; + VLANClientState *vc; + struct virtio_device * vdev; + int tap_fd; +} PARANETState; + +#define MAX_PARANET_DEVICES 1 +static int used_devices =3D 0; +static PARANETState *paranet_devs[MAX_PARANET_DEVICES]; + +static void paranet_reset(void *opaque) +{ +} + +volatile int kvm_pvnet_pending_irq =3D 0; + +void paranet_update_irq(void *opaque) +{ + PARANETState *s =3D opaque; + + paravirt_set_irq(s->pci_dev->config[0x3c]); + + return; +} + +void paravirt_net_poll(void) +{ + int i; + + for (i=3D0; i<used_devices;i++) { + paranet_devs[i]->vdev->handle_input(paranet_devs[i]->vdev); + } +} + +static int paranet_receive(void *opaque, const uint8_t *buf, int len) +{ + printf("PARANET:paravirt_receive\n"); + return 0; +} +static int paranet_can_receive(void *opaque) +{ + return 0; +} + +static void paranet_ioport_write(void *opaque, uint32_t addr, uint32_t val) +{ + addr &=3D 0xf; +#ifdef DEBUG_PARANET + printf("PARANET: write addr=3D0x%x val=3D0x%02x\n", addr, val); +#endif + + switch (addr) { + default: + printf("%s: BUG\n", __FUNCTION__); + break; + } +} + +static uint32_t paranet_ioport_read(void *opaque, uint32_t addr) +{ + PARANETState* s=3D(PARANETState*)opaque; + uint32_t val =3D 0; + addr &=3D 0xf; + + switch (addr) { + case 0: + val =3D 0; + default: + printf("%s: BUG\n", __FUNCTION__); + break; + } + +#ifdef DEBUG_PARANET + printf("PARANET: read addr=3D0x%x, val=3D%x\n", addr, val); +#endif + return val; +} + +static void paranet_save(QEMUFile* f,void* opaque) +{ + PARANETState* s=3D(PARANETState*)opaque; + + if (s->pci_dev) + pci_device_save(s->pci_dev, f); + + qemu_put_buffer(f, s->macaddr, 6); + qemu_put_buffer(f, s->mult, 8); +} + +static int paranet_load(QEMUFile* f,void* opaque,int version_id) +{ + PARANETState* s=3D(PARANETState*)opaque; + int ret =3D 0; + + if (s->pci_dev) { + ret =3D pci_device_load(s->pci_dev, f); + if (ret < 0) + return ret; + } + + qemu_get_buffer(f, s->macaddr, 6); + qemu_get_buffer(f, s->mult, 8); + + return ret; +} + +/***********************************************************/ +/* PCI PARANET definitions */ + +typedef struct PCIPARANETState { + PCIDevice dev; + PARANETState PARANET; +} PCIPARANETState; + +static void paranet_map(PCIDevice *pci_dev, int region_num,=20 + uint32_t addr, uint32_t size, int type) +{ + PCIPARANETState *d =3D (PCIPARANETState *)pci_dev; + PARANETState *s =3D &d->PARANET; + + register_ioport_write(addr, 16, 1, paranet_ioport_write, s); + register_ioport_read(addr, 16, 1, paranet_ioport_read, s); +} + +void pci_paranet_init(PCIBus *bus, NICInfo *nd, int devfn) +{ + PCIPARANETState *d; + PARANETState *s; + uint8_t *pci_conf; + + printf("PARANET: pci_paranet_init start\n"); + + virtio_init(); + + d =3D (PCIPARANETState *)pci_register_device(bus, + "PARANET", sizeof(PCIPARANETState), + devfn,=20 + NULL, NULL); + pci_conf =3D d->dev.config; + pci_conf[0x00] =3D 0x02; // Qumranet vendor ID 0x5002 + pci_conf[0x01] =3D 0x50; + pci_conf[0x02] =3D 0x34; + pci_conf[0x03] =3D 0x12; + pci_conf[0x04] =3D 0x05; // command =3D I/O space, Bus Master + pci_conf[0x0a] =3D 0x00; // ethernet network controller=20 + pci_conf[0x0b] =3D 0x02; + pci_conf[0x0e] =3D 0x00; // header_type + pci_conf[0x3d] =3D 0x01; // interrupt pin 0, currently unused + =20 + pci_register_io_region(&d->dev, 0, 0x100,=20 + PCI_ADDRESS_SPACE_IO, paranet_map); + s =3D &d->PARANET; + s->pci_dev =3D (PCIDevice *)d; + memcpy(s->macaddr, nd->macaddr, 6); + paranet_reset(s); + paranet_devs[0] =3D s; + + s->vc =3D qemu_new_vlan_client(nd->vlan, NULL, + paranet_can_receive, s); + s->tap_fd =3D get_tap_fd(s->vc->vlan->first_client->opaque); + + snprintf(s->vc->info_str, sizeof(s->vc->info_str), + "kvm pv pci macaddr=3D%02x:%02x:%02x:%02x:%02x:%02x", + s->macaddr[0], + s->macaddr[1], + s->macaddr[2], + s->macaddr[3], + s->macaddr[4], + s->macaddr[5]); + + register_savevm("PARANET", 0, 1, paranet_save, paranet_load, s); + qemu_register_reset(paranet_reset, s); + + s->vdev =3D setup_virtnet(s, + used_devices, + s->tap_fd, + paranet_update_irq); + paranet_devs[used_devices++] =3D s; + + printf("PARANET: pci_paranet_init end\n"); +} ----- In simplicity there is elegance. Dor Laor ;) |
From: Dor L. <dor...@qu...> - 2007-08-29 06:40:59
|
PkkganVzdCBub3RpY2VkIHRoaXM6DQo+DQo+PiAtLS0gL2Rldi9udWxsDQo+PiArKysgYi9xZW11 L2h3L3BhcmF2aXJ0X25ldC5jDQo+PiBAQCAtMCwwICsxLDIxMyBAQA0KPj4gKy8qDQo+PiArICog UUVNVSBwYXJhIHZpcnR1YWwgbmV0d29yayBlbXVsYXRpb24NCj4+ICsgKg0KPj4gKyAqIENvcHly aWdodCAoYykgMjAwNyBRdW1yYW5ldA0KPj4gKyAqDQo+PiArICogUGVybWlzc2lvbiBpcyBoZXJl YnkgZ3JhbnRlZCwgZnJlZSBvZiBjaGFyZ2UsIHRvIGFueSBwZXJzb24NCj4+IG9idGFpbmluZyBh IGNvcHkNCj4+ICsgKiBvZiB0aGlzIHNvZnR3YXJlIGFuZCBhc3NvY2lhdGVkIGRvY3VtZW50YXRp b24gZmlsZXMgKHRoZQ0KPj4gIlNvZnR3YXJlIiksIHRvIGRlYWwNCj4+ICsgKiBpbiB0aGUgU29m dHdhcmUgd2l0aG91dCByZXN0cmljdGlvbiwgaW5jbHVkaW5nIHdpdGhvdXQgbGltaXRhdGlvbg0K Pj4gdGhlIHJpZ2h0cw0KPj4gKyAqIHRvIHVzZSwgY29weSwgbW9kaWZ5LCBtZXJnZSwgcHVibGlz aCwgZGlzdHJpYnV0ZSwgc3VibGljZW5zZSwNCj5hbmQvb3INCj4+IHNlbGwNCj4+ICsgKiBjb3Bp ZXMgb2YgdGhlIFNvZnR3YXJlLCBhbmQgdG8gcGVybWl0IHBlcnNvbnMgdG8gd2hvbSB0aGUgU29m dHdhcmUNCj4+IGlzDQo+PiArICogZnVybmlzaGVkIHRvIGRvIHNvLCBzdWJqZWN0IHRvIHRoZSBm b2xsb3dpbmcgY29uZGl0aW9uczoNCj4+ICsgKg0KPj4gKyAqIFRoZSBhYm92ZSBjb3B5cmlnaHQg bm90aWNlIGFuZCB0aGlzIHBlcm1pc3Npb24gbm90aWNlIHNoYWxsIGJlDQo+PiBpbmNsdWRlZCBp bg0KPj4gKyAqIGFsbCBjb3BpZXMgb3Igc3Vic3RhbnRpYWwgcG9ydGlvbnMgb2YgdGhlIFNvZnR3 YXJlLg0KPltjdXRdDQo+DQo+U2hvdWxkbid0IHlvdSB1c2UgdGhlIHN0YW5kYXJkIEdQTCBib2ls ZXJwbGF0ZT8gKElBTkFMLCBzbyBtYXliZSB0aGUNCj50ZXh0IGFib3ZlIGlzIGEgc3VwZXJzZXQg b2YgdGhlIEdQTCBhbmQgaXMgZmluZS4uLikNCj4NCj5MdWNhDQoNCg0KSSB0b29rIGl0IGZyb20g dGhlIHJ0bDgxMzkgZHJpdmVyLiBQZXJzb2FubHkgSSBkb27igJl0IG1pbmQgdG8gc3dpdGNoIHRv IHNvbWV0aGluZw0KYmV0dGVyIGZvciB0aGUgY29tbXVuaXR5Lg0K |
From: Anthony L. <an...@co...> - 2007-08-30 23:09:06
|
On Tue, 2007-08-28 at 23:40 -0700, Dor Laor wrote: > >I just noticed this: > > > >> --- /dev/null > >> +++ b/qemu/hw/paravirt_net.c > >> @@ -0,0 +1,213 @@ > >> +/* > >> + * QEMU para virtual network emulation > >> + * > >> + * Copyright (c) 2007 Qumranet > >> + * > >> + * Permission is hereby granted, free of charge, to any person > >> obtaining a copy > >> + * of this software and associated documentation files (the > >> "Software"), to deal > >> + * in the Software without restriction, including without limitation > >> the rights > >> + * to use, copy, modify, merge, publish, distribute, sublicense, > >and/or > >> sell > >> + * copies of the Software, and to permit persons to whom the Software > >> is > >> + * furnished to do so, subject to the following conditions: > >> + * > >> + * The above copyright notice and this permission notice shall be > >> included in > >> + * all copies or substantial portions of the Software. > >[cut] > > > >Shouldn't you use the standard GPL boilerplate? (IANAL, so maybe the > >text above is a superset of the GPL and is fine...) > > That text is the X11 license. It is not the GPL. Most device emulation in QEMU is not actually GPL'd but rather X11. Regards, Anthony Liguori > >Luca > > > I took it from the rtl8139 driver. Persoanly I don’t mind to switch to something > better for the community. > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > kvm-devel mailing list > kvm...@li... > https://lists.sourceforge.net/lists/listinfo/kvm-dev |
From: Christian B. <bor...@de...> - 2007-08-27 12:23:07
|
Am Samstag, 25. August 2007 schrieb Dor Laor: > + * Permission is hereby granted, free of charge, to any person > obtaining a copy Hi Dor, some of your patch lines seem line-wrapped. Is there place where I can download the whole series? Thanks Christian |
From: Dor L. <dor...@qu...> - 2007-08-29 06:46:41
|
>> + * Permission is hereby granted, free of charge, to any person >> obtaining a copy > >Hi Dor, > >some of your patch lines seem line-wrapped. Is there place where I can >download the whole series? Thanks > >Christian The code can now be accessed by git: git://kvm.qumranet.com/home/dor/src/virtio/kvm (kernel) and git://kvm.qumranet.com/home/dor/src/virtio/kvm-userspace. branch name virt-final. --Dor |
From: Cam M. <ca...@cs...> - 2007-08-29 15:26:48
|
Dor Laor wrote: > > The code can now be accessed by git: > git://kvm.qumranet.com/home/dor/src/virtio/kvm (kernel) and > git://kvm.qumranet.com/home/dor/src/virtio/kvm-userspace. > branch name virt-final. > --Dor > Hi Dor, I'm really new to git and don't quite grasp it's subtleties. Do I have to "git clone" your kvm kernel and user-space repos or is there some way to use your branch as a branch off Avi's? I tried finding an online reference, but none seem to cover this kind of setup. Thanks, Cam |
From: Luca <kro...@gm...> - 2007-08-29 15:36:51
|
On 8/29/07, Cam Macdonell <ca...@cs...> wrote: > Dor Laor wrote: > > The code can now be accessed by git: > > git://kvm.qumranet.com/home/dor/src/virtio/kvm (kernel) and > > git://kvm.qumranet.com/home/dor/src/virtio/kvm-userspace. > > branch name virt-final. > > --Dor > > I'm really new to git and don't quite grasp it's subtleties. Do I have > to "git clone" your kvm kernel and user-space repos or is there some way > to use your branch as a branch off Avi's? I tried finding an online > reference, but none seem to cover this kind of setup. If Dor's repository is based on the Avi's one (I think so) you can pull virt-final branch as a branch of you existing repository (see refspec parameter in git-pull). This is error prone though (after a while I tend to pull the wrong tree into the wrong branch ;-) ) I prefer to clone the whole tree (disk space is cheap...), sharing GIT object where possible, e.g. git clone --reference kvm.avi git://kvm.qumranet.com/home/dor/src/virtio/kvm kvm.dor where kvm.avi is you existing kvm git repository. Luca |
From: Avi K. <av...@qu...> - 2007-09-09 12:57:00
|
Luca wrote: > On 8/29/07, Cam Macdonell <ca...@cs...> wrote: > >> Dor Laor wrote: >> >>> The code can now be accessed by git: >>> git://kvm.qumranet.com/home/dor/src/virtio/kvm (kernel) and >>> git://kvm.qumranet.com/home/dor/src/virtio/kvm-userspace. >>> branch name virt-final. >>> --Dor >>> >> I'm really new to git and don't quite grasp it's subtleties. Do I have >> to "git clone" your kvm kernel and user-space repos or is there some way >> to use your branch as a branch off Avi's? I tried finding an online >> reference, but none seem to cover this kind of setup. >> > > If Dor's repository is based on the Avi's one (I think so) you can > pull virt-final branch as a branch of you existing repository (see > refspec parameter in git-pull). This is error prone though (after a > while I tend to pull the wrong tree into the wrong branch ;-) ) > I prefer to clone the whole tree (disk space is cheap...), sharing GIT > object where possible, e.g. > > git clone --reference kvm.avi > git://kvm.qumranet.com/home/dor/src/virtio/kvm kvm.dor > > where kvm.avi is you existing kvm git repository. > My preference pulling random branches and repos is 'git fetch' (or, for longer lived branches, 'git remote') which doesn't cause fake merges. -- error compiling committee.c: too many arguments to function |
From: Luca <kro...@gm...> - 2007-08-28 19:59:17
|
On 8/25/07, Dor Laor <dor...@qu...> wrote: I just noticed this: > --- /dev/null > +++ b/qemu/hw/paravirt_net.c > @@ -0,0 +1,213 @@ > +/* > + * QEMU para virtual network emulation > + * > + * Copyright (c) 2007 Qumranet > + * > + * Permission is hereby granted, free of charge, to any person > obtaining a copy > + * of this software and associated documentation files (the > "Software"), to deal > + * in the Software without restriction, including without limitation > the rights > + * to use, copy, modify, merge, publish, distribute, sublicense, and/or > sell > + * copies of the Software, and to permit persons to whom the Software > is > + * furnished to do so, subject to the following conditions: > + * > + * The above copyright notice and this permission notice shall be > included in > + * all copies or substantial portions of the Software. [cut] Shouldn't you use the standard GPL boilerplate? (IANAL, so maybe the text above is a superset of the GPL and is fine...) Luca |
From: Avi K. <av...@qu...> - 2007-09-09 12:58:45
|
Luca wrote: > On 8/25/07, Dor Laor <dor...@qu...> wrote: > > I just noticed this: > > >> --- /dev/null >> +++ b/qemu/hw/paravirt_net.c >> @@ -0,0 +1,213 @@ >> +/* >> + * QEMU para virtual network emulation >> + * >> + * Copyright (c) 2007 Qumranet >> + * >> + * Permission is hereby granted, free of charge, to any person >> obtaining a copy >> + * of this software and associated documentation files (the >> "Software"), to deal >> + * in the Software without restriction, including without limitation >> the rights >> + * to use, copy, modify, merge, publish, distribute, sublicense, and/or >> sell >> + * copies of the Software, and to permit persons to whom the Software >> is >> + * furnished to do so, subject to the following conditions: >> + * >> + * The above copyright notice and this permission notice shall be >> included in >> + * all copies or substantial portions of the Software. >> > [cut] > > Shouldn't you use the standard GPL boilerplate? (IANAL, so maybe the > text above is a superset of the GPL and is fine...) > > My preference is to just add a copyright and refer to some file in the top-level, so we don't restrict qemu's licensing unnecessarily (this could hinder merging). -- error compiling committee.c: too many arguments to function |
From: Cam M. <ca...@cs...> - 2007-08-29 17:11:51
|
Luca wrote: > On 8/29/07, Cam Macdonell <ca...@cs...> wrote: >> Dor Laor wrote: >>> The code can now be accessed by git: >>> git://kvm.qumranet.com/home/dor/src/virtio/kvm (kernel) and >>> git://kvm.qumranet.com/home/dor/src/virtio/kvm-userspace. >>> branch name virt-final. >>> --Dor >> I'm really new to git and don't quite grasp it's subtleties. Do I have >> to "git clone" your kvm kernel and user-space repos or is there some way >> to use your branch as a branch off Avi's? I tried finding an online >> reference, but none seem to cover this kind of setup. > > If Dor's repository is based on the Avi's one (I think so) you can > pull virt-final branch as a branch of you existing repository (see > refspec parameter in git-pull). This is error prone though (after a > while I tend to pull the wrong tree into the wrong branch ;-) ) > I prefer to clone the whole tree (disk space is cheap...), sharing GIT > object where possible, e.g. > > git clone --reference kvm.avi > git://kvm.qumranet.com/home/dor/src/virtio/kvm kvm.dor > Thanks Luca, I get this error: [cam@b5 ~/research/KVM]$ git clone --reference kvm git://kvm.qumranet.com/home/dor/src/virtio/kvm.git kvm.dor Initialized empty Git repository in /home/cam/research/KVM/kvm.dor/.git/ fatal: The remote end hung up unexpectedly fetch-pack from 'git://kvm.qumranet.com/home/dor/src/virtio/kvm.git' failed. Is there a problem with the repositor or am I doing something wrong? Thanks, Cam |
From: Luca <kro...@gm...> - 2007-08-29 17:18:28
|
On 8/29/07, Cam Macdonell <ca...@cs...> wrote: > Luca wrote: > > On 8/29/07, Cam Macdonell <ca...@cs...> wrote: > >> Dor Laor wrote: > >>> The code can now be accessed by git: > >>> git://kvm.qumranet.com/home/dor/src/virtio/kvm (kernel) and > >>> git://kvm.qumranet.com/home/dor/src/virtio/kvm-userspace. > >>> branch name virt-final. > >>> --Dor > >> I'm really new to git and don't quite grasp it's subtleties. Do I have > >> to "git clone" your kvm kernel and user-space repos or is there some way > >> to use your branch as a branch off Avi's? I tried finding an online > >> reference, but none seem to cover this kind of setup. > > > > If Dor's repository is based on the Avi's one (I think so) you can > > pull virt-final branch as a branch of you existing repository (see > > refspec parameter in git-pull). This is error prone though (after a > > while I tend to pull the wrong tree into the wrong branch ;-) ) > > I prefer to clone the whole tree (disk space is cheap...), sharing GIT > > object where possible, e.g. > > > > git clone --reference kvm.avi > > git://kvm.qumranet.com/home/dor/src/virtio/kvm kvm.dor > > > > Thanks Luca, > > I get this error: > > [cam@b5 ~/research/KVM]$ git clone --reference kvm > git://kvm.qumranet.com/home/dor/src/virtio/kvm.git kvm.dor > Initialized empty Git repository in /home/cam/research/KVM/kvm.dor/.git/ > fatal: The remote end hung up unexpectedly > fetch-pack from 'git://kvm.qumranet.com/home/dor/src/virtio/kvm.git' failed. > > Is there a problem with the repositor or am I doing something wrong? The command is correct. It seems that either the repository is not configured for export or the path is wrong. Luca |
From: Cam M. <ca...@cs...> - 2007-09-03 14:00:46
|
Luca wrote: > On 8/29/07, Cam Macdonell <ca...@cs...> wrote: >> >> I get this error: >> >> [cam@b5 ~/research/KVM]$ git clone --reference kvm >> git://kvm.qumranet.com/home/dor/src/virtio/kvm.git kvm.dor >> Initialized empty Git repository in /home/cam/research/KVM/kvm.dor/.git/ >> fatal: The remote end hung up unexpectedly >> fetch-pack from 'git://kvm.qumranet.com/home/dor/src/virtio/kvm.git' failed. >> >> Is there a problem with the repositor or am I doing something wrong? > > The command is correct. It seems that either the repository is not > configured for export or the path is wrong. > > Luca Hi Dor, I can't seem to grab your tree. Is your repository setup properly? Thanks, Cam |
From: Dor L. <dor...@qu...> - 2007-09-03 14:23:59
|
Now it should work. -Kernel repo: git clone git://kvm.qumranet.com/home/dor/src/virtio/kvm -Userspace repo: >git clone git://kvm.qumranet.com/home/dor/src/virtio/kvm-userspace Please use virt-final branch. Note that the repository will likely to undergo some changes in the following days. Dor. >-----Original Message----- >From: Christian Borntraeger [mailto:bor...@de...] >Sent: Wednesday, August 29, 2007 1:24 PM >To: Dor Laor >Subject: Re: [kvm-devel] [RFC][PATCH 5/6][KVM VIRTIO] Add the network >device code > >> The code can now be accessed by git: >> git://kvm.qumranet.com/home/dor/src/virtio/kvm (kernel) and >> git://kvm.qumranet.com/home/dor/src/virtio/kvm-userspace. >> branch name virt-final. > >Hmm, > >git clone git://kvm.qumranet.com/home/dor/src/virtio/kvm >git clone git://kvm.qumranet.com/home/dor/src/virtio/kvm.git >git clone git://kvm.qumranet.com/home/dor/src/virtio/kvm virt-final >git clone git://kvm.qumranet.com/home/dor/src/virtio/kvm.git virt-final > >all fail with >fatal: The remote end hung up unexpectedly > >Any ideas? > >Christian |
From: Cam M. <ca...@cs...> - 2007-09-03 21:28:46
|
Hi Dor, I was able to grab the virtio sources. However, the make -C kernel command to build the modules doesn't copy over all files. when I run: make -C kernel sync LINUX=/home/cam/research/KVM/dor/kvm/ the following files: linux/virtio.h linux/virtio_blk.h linux/virtio_net.h asm-x86_64/hypercall.h don't get copied into kvm-userspace/kernel/include after copying them manually, I get the compile to move forward until this happens: CC [M] /home/cam/research/KVM/dor/kvm-userspace/kernel/virtio_backend.o KVM/dor/kvm-userspace/kernel/virtio_backend.c: In function 'virtio_add_buf': KVM/dor/kvm-userspace/kernel/virtio_backend.c:104: warning: parameter names (without types) in function declaration KVM/dor/kvm-userspace/kernel/virtio_backend.c:131: error: 'prev' undeclared (first use in this function) KVM/dor/kvm-userspace/kernel/virtio_backend.c:131: error: (Each undeclared identifier is reported only once KVM/dor/kvm-userspace/kernel/virtio_backend.c:131: error: for each function it appears in.) make[3]: *** [KVM/dor/kvm-userspace/kernel/virtio_backend.o] Error 1 Hopefully I'll get to a point when I can fix these myself, but I'm not there yet :) Thanks, Cam |
From: Dor L. <dor...@qu...> - 2007-09-04 09:00:05
|
>Hi Dor, > >I was able to grab the virtio sources. However, the make -C kernel >command to build the modules doesn't copy over all files. > >when I run: > >make -C kernel sync LINUX=3D/home/cam/research/KVM/dor/kvm/ > >the following files: >linux/virtio.h >linux/virtio_blk.h >linux/virtio_net.h The above files are currently part of the guest kernel (not modules) so they shouldn't be copied. Instead you should compile the whole kernel and use it for the guest. I'll soon make modules out of them for better usability. >asm-x86_64/hypercall.h I'll add it to the sync entry. 10x >don't get copied into kvm-userspace/kernel/include > >after copying them manually, I get the compile to move forward until >this happens: > > CC [M] /home/cam/research/KVM/dor/kvm- >userspace/kernel/virtio_backend.o >KVM/dor/kvm-userspace/kernel/virtio_backend.c: In function >'virtio_add_buf': >KVM/dor/kvm-userspace/kernel/virtio_backend.c:104: warning: parameter >names (without types) in function declaration >KVM/dor/kvm-userspace/kernel/virtio_backend.c:131: error: 'prev' >undeclared (first use in this function) >KVM/dor/kvm-userspace/kernel/virtio_backend.c:131: error: (Each >undeclared identifier is reported only once >KVM/dor/kvm-userspace/kernel/virtio_backend.c:131: error: for each >function it appears in.) >make[3]: *** [KVM/dor/kvm-userspace/kernel/virtio_backend.o] Error 1 > >Hopefully I'll get to a point when I can fix these myself, but I'm not >there yet :) Did it happen after you passed all virtio*.h to kernel/include/linux? Strange, seems like uninitialized_var(prev) is not good? >Thanks, >Cam |
From: Cam M. <ca...@cs...> - 2007-09-04 13:42:34
|
Hi Dor, Dor Laor wrote: >> >> the following files: >> linux/virtio.h >> linux/virtio_blk.h >> linux/virtio_net.h > > The above files are currently part of the guest kernel (not modules) so > they shouldn't be copied. Instead you should compile the whole kernel > and > use it for the guest. I'll soon make modules out of them for better > usability. > But, correct if I'm wrong, they still need be copied (some how) into kvm-userspace build as it requires them. Also to be clear, do I use the standard kvm host modules then? Should I specify that kernel directory when I run "make -C kernel..."? >> asm-x86_64/hypercall.h > > I'll add it to the sync entry. > 10x > >> don't get copied into kvm-userspace/kernel/include >> >> after copying them manually, I get the compile to move forward until >> this happens: >> >> CC [M] /home/cam/research/KVM/dor/kvm- >> userspace/kernel/virtio_backend.o >> KVM/dor/kvm-userspace/kernel/virtio_backend.c: In function >> 'virtio_add_buf': >> KVM/dor/kvm-userspace/kernel/virtio_backend.c:104: warning: parameter >> names (without types) in function declaration >> KVM/dor/kvm-userspace/kernel/virtio_backend.c:131: error: 'prev' >> undeclared (first use in this function) >> KVM/dor/kvm-userspace/kernel/virtio_backend.c:131: error: (Each >> undeclared identifier is reported only once >> KVM/dor/kvm-userspace/kernel/virtio_backend.c:131: error: for each >> function it appears in.) >> make[3]: *** [KVM/dor/kvm-userspace/kernel/virtio_backend.o] Error 1 >> >> Hopefully I'll get to a point when I can fix these myself, but I'm not >> there yet :) > > Did it happen after you passed all virtio*.h to kernel/include/linux? > Strange, seems like uninitialized_var(prev) is not good? > Yes, I looked at the code and it seems that a definition of 'prev' is simply missing. Thanks for your help, Cam |