qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Re: hi, may I ask some help on the paravirtualization of KVM?
       [not found]   ` <3a240e801003230646o65a87014xff6d0832fb8bccb@mail.gmail.com>
@ 2010-03-23 13:59     ` Amit Shah
  2010-03-23 14:09       ` Liang YANG
  0 siblings, 1 reply; 5+ messages in thread
From: Amit Shah @ 2010-03-23 13:59 UTC (permalink / raw)
  To: Liang YANG; +Cc: qemu list

Hello,

[any reason you dropped the CC list? CC'ing qemu-devel, where this is
relevant.]

On (Tue) Mar 23 2010 [21:46:28], Liang YANG wrote:
> I check the 'lspci -v' result, only find RTL-8139 realtek ethernet. I
> think the option model=virtio does't make effect.

Then something is wrong. I get a virtio ethernet device using
model=virtio.

Which qemu version are you using?

> Simultaneously, I have the a look at the code. The function pc_init1()
> seem not change the network model as the option assigned.
> 
> Do you ever meet this case?

I've not seen this.

> On Tue, Mar 23, 2010 at 9:08 PM, Amit Shah <amit.shah@redhat.com> wrote:
> > On (Sun) Mar 21 2010 [20:18:53], Liang YANG wrote:
> >> I want to set up the virtio-net for the GuestOS on KVM. Following is my steps:
> >>
> >> 1.Compile the kvm-88 and make, make install.
> >> 2.Compile the GuestOS(redhat) with kernel version 2.6.27.45(with
> >> virtio support). The required option are all selected.
> >>           o CONFIG_VIRTIO_PCI=y (Virtualization -> PCI driver for
> >> virtio devices)
> >>           o CONFIG_VIRTIO_BALLOON=y (Virtualization -> Virtio balloon driver)
> >>           o CONFIG_VIRTIO_BLK=y (Device Drivers -> Block -> Virtio block driver)
> >>           o CONFIG_VIRTIO_NET=y (Device Drivers -> Network device
> >> support -> Virtio network driver)
> >>           o CONFIG_VIRTIO=y (automatically selected)
> >>           o CONFIG_VIRTIO_RING=y (automatically selected)
> >> 3.Then start up the GuestOS by such command:
> >>           x86_64-softmmu/qemu-system-x86_64  -m 1024 /root/redhat.img
> >> -net nic,model=virtio -net tap,script=/etc/kvm/qemu-ifup
> >> 4.Result is this:
> >>           * The Guest OS start up.
> >>           * But the network not, no eth-X device found.
> >>           * lsmod | grep virtio get none module about virtio
> >
> > Since you selected the virtio options as 'y', they are directly compiled
> > into the kernel and hence you won't see the modules.
> >
> > Check your 'lspci -v' output. You should see the virtio device there.
> > You can also try some usual things like 'ifconfig eth0 up', etc., to get
> > the interface.
> >
> >                Amit
> > --
> > http://log.amitshah.net/
> >
> 
> 
> 
> -- 
> BestRegards.
> YangLiang
> _____________________________________________
>  Department of Computer Science .
>  School of Electronics Engineering & Computer Science .
> _____________________________________________

		Amit
-- 
http://log.amitshah.net/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] Re: hi, may I ask some help on the paravirtualization of KVM?
  2010-03-23 13:59     ` [Qemu-devel] Re: hi, may I ask some help on the paravirtualization of KVM? Amit Shah
@ 2010-03-23 14:09       ` Liang YANG
  2010-03-24  3:35         ` Liang YANG
  0 siblings, 1 reply; 5+ messages in thread
From: Liang YANG @ 2010-03-23 14:09 UTC (permalink / raw)
  To: Amit Shah; +Cc: qemu list

I use the qemu-kvm-0.12-3 version source file. Just follow the typical
three steps: ./configure && make && make install.

After I configure, following is output:

Install prefix    /usr/local
BIOS directory    /usr/local/share/qemu
binary directory  /usr/local/bin
Manual directory  /usr/local/share/man
ELF interp prefix /usr/gnemul/qemu-%M
Source path       /root/svt/qemu-kvm-0.12.3
C compiler        gcc
Host C compiler   gcc
CFLAGS            -O2 -g
QEMU_CFLAGS       -m32 -Wold-style-definition -Wold-style-declaration
-I. -I$(SRC_PATH) -U_FORTIFY_SOURCE -D_GNU_SOURCE
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes
-Wredundant-decls -Wall -Wundef -Wendif-labels -Wwrite-strings
-Wmissing-prototypes -fno-strict-aliasing
LDFLAGS           -Wl,--warn-common -m32 -g
make              make
install           install
host CPU          i386
host big endian   no
target list       x86_64-softmmu
tcg debug enabled no
gprof enabled     no
sparse enabled    no
strip binaries    yes
profiler          no
static build      no
-Werror enabled   no
SDL support       yes
curses support    yes
curl support      yes
check support     no
mingw32 support   no
Audio drivers     oss
Extra audio cards ac97 es1370 sb16
Block whitelist
Mixer emulation   no
VNC TLS support   yes
VNC SASL support  yes
xen support       no
CPU emulation     yes
brlapi support    no
bluez  support    no
Documentation     no
NPTL support      yes
GUEST_BASE        yes
PIE user targets  no
vde support       no
IO thread         no
Linux AIO support no
Install blobs     yes
KVM support       yes
KVM PIT support   yes
KVM device assig. yes
KVM trace support no
fdt support       no
preadv support    no
fdatasync         yes
uuid support      yes

All compile procedure seems normal. No warning exists. And I use this
command to start the GuestOS:
 ./x86_64-softmmu/qemu-system-x86_64 -m 1024 /root/redhat.img -net
nic, model=virtio -net tap, script=/etc/qemu-ifup

The qemu-ifup script is :
#!/bin/sh
#sample /etc/qemu-ifup to have bridged networking between qemu
instances and your real net
# You need "youruser ALL=(root) NOPASSWD: /etc/qemu-ifup" in /etc/sudoers
# You also need enough rights on /dev/tun
if [ $UID -ne 0 ]
then
    sudo $0 $1
    exit
fi
/sbin/ifconfig $1 promisc 0.0.0.0
if ! /sbin/ifconfig br0
then
    /usr/sbin/brctl addbr br0
    /usr/sbin/brctl addif br0 eth0
    /sbin/ifconfig br0 up
    addr=`/sbin/ip addr | grep eth0 | grep inet | sed -e 's/eth0/dev
br0/' -e s/inet//`
    /sbin/ip addr add $addr
fi
/usr/sbin/brctl addif br0 $1
/usr/sbin/brctl stp br0 off
/sbin/ip route | grep eth0 | while read route
do
newroute=`echo $route | sed s/eth0/br0/ `
/sbin/ip route del $route
/sbin/ip route add $newroute
done



On Tue, Mar 23, 2010 at 9:59 PM, Amit Shah <amit.shah@redhat.com> wrote:
> Hello,
>
> [any reason you dropped the CC list? CC'ing qemu-devel, where this is
> relevant.]
>
> On (Tue) Mar 23 2010 [21:46:28], Liang YANG wrote:
>> I check the 'lspci -v' result, only find RTL-8139 realtek ethernet. I
>> think the option model=virtio does't make effect.
>
> Then something is wrong. I get a virtio ethernet device using
> model=virtio.
>
> Which qemu version are you using?
>
>> Simultaneously, I have the a look at the code. The function pc_init1()
>> seem not change the network model as the option assigned.
>>
>> Do you ever meet this case?
>
> I've not seen this.
>
>> On Tue, Mar 23, 2010 at 9:08 PM, Amit Shah <amit.shah@redhat.com> wrote:
>> > On (Sun) Mar 21 2010 [20:18:53], Liang YANG wrote:
>> >> I want to set up the virtio-net for the GuestOS on KVM. Following is my steps:
>> >>
>> >> 1.Compile the kvm-88 and make, make install.
>> >> 2.Compile the GuestOS(redhat) with kernel version 2.6.27.45(with
>> >> virtio support). The required option are all selected.
>> >>           o CONFIG_VIRTIO_PCI=y (Virtualization -> PCI driver for
>> >> virtio devices)
>> >>           o CONFIG_VIRTIO_BALLOON=y (Virtualization -> Virtio balloon driver)
>> >>           o CONFIG_VIRTIO_BLK=y (Device Drivers -> Block -> Virtio block driver)
>> >>           o CONFIG_VIRTIO_NET=y (Device Drivers -> Network device
>> >> support -> Virtio network driver)
>> >>           o CONFIG_VIRTIO=y (automatically selected)
>> >>           o CONFIG_VIRTIO_RING=y (automatically selected)
>> >> 3.Then start up the GuestOS by such command:
>> >>           x86_64-softmmu/qemu-system-x86_64  -m 1024 /root/redhat.img
>> >> -net nic,model=virtio -net tap,script=/etc/kvm/qemu-ifup
>> >> 4.Result is this:
>> >>           * The Guest OS start up.
>> >>           * But the network not, no eth-X device found.
>> >>           * lsmod | grep virtio get none module about virtio
>> >
>> > Since you selected the virtio options as 'y', they are directly compiled
>> > into the kernel and hence you won't see the modules.
>> >
>> > Check your 'lspci -v' output. You should see the virtio device there.
>> > You can also try some usual things like 'ifconfig eth0 up', etc., to get
>> > the interface.
>> >
>> >                Amit
>> > --
>> > http://log.amitshah.net/
>> >
>>
>>
>>
>> --
>> BestRegards.
>> YangLiang
>> _____________________________________________
>>  Department of Computer Science .
>>  School of Electronics Engineering & Computer Science .
>> _____________________________________________
>
>                Amit
> --
> http://log.amitshah.net/
>



-- 
BestRegards.
YangLiang
_____________________________________________
 Department of Computer Science .
 School of Electronics Engineering & Computer Science .
_____________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] Re: hi, may I ask some help on the paravirtualization of KVM?
  2010-03-23 14:09       ` Liang YANG
@ 2010-03-24  3:35         ` Liang YANG
  2010-03-24  4:13           ` Amit Shah
  2010-03-24 22:48           ` Charles Duffy
  0 siblings, 2 replies; 5+ messages in thread
From: Liang YANG @ 2010-03-24  3:35 UTC (permalink / raw)
  To: Amit Shah; +Cc: qemu list

Maybe I solove the problem.

I use the qemu-img make a new GustOS img. And install the debian5 on
the image file with option -net nic, model=virtio.
./x86_64-softmmu/qemu-system-x86_64 -hda debian.img -cdrom debian.iso
-net nic, model=virtio

Then I update the kernel image file with virtio, virtio_pci,
virtio_ring, virtio_blk, virtio_net modules added to file
/etc/initram-tools/modules.

Last, start the image Guest use qemu-system-x86_64 -net nic,
model=virtio. This time I can see virtio_net module in GuestOS, but it
doesn't work. The qemu didn't emulate the virtio net device. So I
update the code located in pc_init1(), where the net model is set.
After this time update, I can start the kvm-paravirtualization
successfully.

Thanks for your help.

On Tue, Mar 23, 2010 at 10:09 PM, Liang YANG <brinewsor@gmail.com> wrote:
> I use the qemu-kvm-0.12-3 version source file. Just follow the typical
> three steps: ./configure && make && make install.
>
> After I configure, following is output:
>
> Install prefix    /usr/local
> BIOS directory    /usr/local/share/qemu
> binary directory  /usr/local/bin
> Manual directory  /usr/local/share/man
> ELF interp prefix /usr/gnemul/qemu-%M
> Source path       /root/svt/qemu-kvm-0.12.3
> C compiler        gcc
> Host C compiler   gcc
> CFLAGS            -O2 -g
> QEMU_CFLAGS       -m32 -Wold-style-definition -Wold-style-declaration
> -I. -I$(SRC_PATH) -U_FORTIFY_SOURCE -D_GNU_SOURCE
> -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes
> -Wredundant-decls -Wall -Wundef -Wendif-labels -Wwrite-strings
> -Wmissing-prototypes -fno-strict-aliasing
> LDFLAGS           -Wl,--warn-common -m32 -g
> make              make
> install           install
> host CPU          i386
> host big endian   no
> target list       x86_64-softmmu
> tcg debug enabled no
> gprof enabled     no
> sparse enabled    no
> strip binaries    yes
> profiler          no
> static build      no
> -Werror enabled   no
> SDL support       yes
> curses support    yes
> curl support      yes
> check support     no
> mingw32 support   no
> Audio drivers     oss
> Extra audio cards ac97 es1370 sb16
> Block whitelist
> Mixer emulation   no
> VNC TLS support   yes
> VNC SASL support  yes
> xen support       no
> CPU emulation     yes
> brlapi support    no
> bluez  support    no
> Documentation     no
> NPTL support      yes
> GUEST_BASE        yes
> PIE user targets  no
> vde support       no
> IO thread         no
> Linux AIO support no
> Install blobs     yes
> KVM support       yes
> KVM PIT support   yes
> KVM device assig. yes
> KVM trace support no
> fdt support       no
> preadv support    no
> fdatasync         yes
> uuid support      yes
>
> All compile procedure seems normal. No warning exists. And I use this
> command to start the GuestOS:
>  ./x86_64-softmmu/qemu-system-x86_64 -m 1024 /root/redhat.img -net
> nic, model=virtio -net tap, script=/etc/qemu-ifup
>
> The qemu-ifup script is :
> #!/bin/sh
> #sample /etc/qemu-ifup to have bridged networking between qemu
> instances and your real net
> # You need "youruser ALL=(root) NOPASSWD: /etc/qemu-ifup" in /etc/sudoers
> # You also need enough rights on /dev/tun
> if [ $UID -ne 0 ]
> then
>    sudo $0 $1
>    exit
> fi
> /sbin/ifconfig $1 promisc 0.0.0.0
> if ! /sbin/ifconfig br0
> then
>    /usr/sbin/brctl addbr br0
>    /usr/sbin/brctl addif br0 eth0
>    /sbin/ifconfig br0 up
>    addr=`/sbin/ip addr | grep eth0 | grep inet | sed -e 's/eth0/dev
> br0/' -e s/inet//`
>    /sbin/ip addr add $addr
> fi
> /usr/sbin/brctl addif br0 $1
> /usr/sbin/brctl stp br0 off
> /sbin/ip route | grep eth0 | while read route
> do
> newroute=`echo $route | sed s/eth0/br0/ `
> /sbin/ip route del $route
> /sbin/ip route add $newroute
> done
>
>
>
> On Tue, Mar 23, 2010 at 9:59 PM, Amit Shah <amit.shah@redhat.com> wrote:
>> Hello,
>>
>> [any reason you dropped the CC list? CC'ing qemu-devel, where this is
>> relevant.]
>>
>> On (Tue) Mar 23 2010 [21:46:28], Liang YANG wrote:
>>> I check the 'lspci -v' result, only find RTL-8139 realtek ethernet. I
>>> think the option model=virtio does't make effect.
>>
>> Then something is wrong. I get a virtio ethernet device using
>> model=virtio.
>>
>> Which qemu version are you using?
>>
>>> Simultaneously, I have the a look at the code. The function pc_init1()
>>> seem not change the network model as the option assigned.
>>>
>>> Do you ever meet this case?
>>
>> I've not seen this.
>>
>>> On Tue, Mar 23, 2010 at 9:08 PM, Amit Shah <amit.shah@redhat.com> wrote:
>>> > On (Sun) Mar 21 2010 [20:18:53], Liang YANG wrote:
>>> >> I want to set up the virtio-net for the GuestOS on KVM. Following is my steps:
>>> >>
>>> >> 1.Compile the kvm-88 and make, make install.
>>> >> 2.Compile the GuestOS(redhat) with kernel version 2.6.27.45(with
>>> >> virtio support). The required option are all selected.
>>> >>           o CONFIG_VIRTIO_PCI=y (Virtualization -> PCI driver for
>>> >> virtio devices)
>>> >>           o CONFIG_VIRTIO_BALLOON=y (Virtualization -> Virtio balloon driver)
>>> >>           o CONFIG_VIRTIO_BLK=y (Device Drivers -> Block -> Virtio block driver)
>>> >>           o CONFIG_VIRTIO_NET=y (Device Drivers -> Network device
>>> >> support -> Virtio network driver)
>>> >>           o CONFIG_VIRTIO=y (automatically selected)
>>> >>           o CONFIG_VIRTIO_RING=y (automatically selected)
>>> >> 3.Then start up the GuestOS by such command:
>>> >>           x86_64-softmmu/qemu-system-x86_64  -m 1024 /root/redhat.img
>>> >> -net nic,model=virtio -net tap,script=/etc/kvm/qemu-ifup
>>> >> 4.Result is this:
>>> >>           * The Guest OS start up.
>>> >>           * But the network not, no eth-X device found.
>>> >>           * lsmod | grep virtio get none module about virtio
>>> >
>>> > Since you selected the virtio options as 'y', they are directly compiled
>>> > into the kernel and hence you won't see the modules.
>>> >
>>> > Check your 'lspci -v' output. You should see the virtio device there.
>>> > You can also try some usual things like 'ifconfig eth0 up', etc., to get
>>> > the interface.
>>> >
>>> >                Amit
>>> > --
>>> > http://log.amitshah.net/
>>> >
>>>
>>>
>>>
>>> --
>>> BestRegards.
>>> YangLiang
>>> _____________________________________________
>>>  Department of Computer Science .
>>>  School of Electronics Engineering & Computer Science .
>>> _____________________________________________
>>
>>                Amit
>> --
>> http://log.amitshah.net/
>>
>
>
>
> --
> BestRegards.
> YangLiang
> _____________________________________________
>  Department of Computer Science .
>  School of Electronics Engineering & Computer Science .
> _____________________________________________
>



-- 
BestRegards.
YangLiang
_____________________________________________
 Department of Computer Science .
 School of Electronics Engineering & Computer Science .
_____________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] Re: hi, may I ask some help on the paravirtualization of KVM?
  2010-03-24  3:35         ` Liang YANG
@ 2010-03-24  4:13           ` Amit Shah
  2010-03-24 22:48           ` Charles Duffy
  1 sibling, 0 replies; 5+ messages in thread
From: Amit Shah @ 2010-03-24  4:13 UTC (permalink / raw)
  To: Liang YANG; +Cc: qemu list

On (Wed) Mar 24 2010 [11:35:09], Liang YANG wrote:
> 
> Last, start the image Guest use qemu-system-x86_64 -net nic,
> model=virtio. This time I can see virtio_net module in GuestOS, but it
> doesn't work. The qemu didn't emulate the virtio net device. So I
> update the code located in pc_init1(), where the net model is set.
> After this time update, I can start the kvm-paravirtualization
> successfully.

So this is a bug; can you please post the patch you made? I don't think
anyone else has complained of this so must be specific to your setup.

		Amit
-- 
http://log.amitshah.net/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] Re: hi, may I ask some help on the paravirtualization of KVM?
  2010-03-24  3:35         ` Liang YANG
  2010-03-24  4:13           ` Amit Shah
@ 2010-03-24 22:48           ` Charles Duffy
  1 sibling, 0 replies; 5+ messages in thread
From: Charles Duffy @ 2010-03-24 22:48 UTC (permalink / raw)
  To: qemu-devel

Liang YANG wrote:
> Maybe I solove the problem.
> 
> I use the qemu-img make a new GustOS img. And install the debian5 on
> the image file with option -net nic, model=virtio.
> ./x86_64-softmmu/qemu-system-x86_64 -hda debian.img -cdrom debian.iso
> -net nic, model=virtio

This email reads as:

   -net nic, model=virtio

If this is in fact what you're running with, the whitespace is broken; 
correct would be to have no space after the comma, as so:

   -net nic,model=virtio

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-03-24 22:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <3a240e801003210518y4f18a3cfnc14f6df45d71b4b1@mail.gmail.com>
     [not found] ` <20100323130813.GN19148@amit-x200.redhat.com>
     [not found]   ` <3a240e801003230646o65a87014xff6d0832fb8bccb@mail.gmail.com>
2010-03-23 13:59     ` [Qemu-devel] Re: hi, may I ask some help on the paravirtualization of KVM? Amit Shah
2010-03-23 14:09       ` Liang YANG
2010-03-24  3:35         ` Liang YANG
2010-03-24  4:13           ` Amit Shah
2010-03-24 22:48           ` Charles Duffy

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