qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Re: [Qemu-devel] [Qemu-discuss] qemu-kvm: -netdev user: Parameter 'id' is missing
       [not found] ` <500DACED.9080805@dev-zero.net>
@ 2012-07-23 21:41   ` anatoly techtonik
  2012-07-24 10:23     ` Stefan Hajnoczi
  0 siblings, 1 reply; 7+ messages in thread
From: anatoly techtonik @ 2012-07-23 21:41 UTC (permalink / raw)
  To: qemu-devel; +Cc: Mike Lovell

Forwarding per discussion in qemu-discuss.
Please CC.

---------- Forwarded message ----------
From: Mike Lovell <mike@dev-zero.net>
Date: Mon, Jul 23, 2012 at 10:58 PM
Subject: Re: [Qemu-discuss] qemu-kvm: -netdev user: Parameter 'id' is missing
To: qemu-discuss@nongnu.org


On 07/20/2012 04:10 PM, anatoly techtonik wrote:
>
> The documentation at http://wiki.qemu.org/Documentation/Networking
> makes people think that 'id' parameter for -netdev user is optional,
> which doesn't appear to be true:
>
>      $ qemu-kvm -hda image.img -netdev user
>      qemu-kvm: -netdev user: Parameter 'id' is missing
>
> --
> anatoly t.


it does look like there are a few places where it refers to -netdev
without id= but i just took a look through some of the code and it
does look to be required. i don't have a user account on the wiki so i
can't fix it or help get you an account to fix it. you might want to
check with qemu-devel on that.

mike

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

* Re: [Qemu-devel] [Qemu-discuss] qemu-kvm: -netdev user: Parameter 'id' is missing
  2012-07-23 21:41   ` [Qemu-devel] [Qemu-discuss] qemu-kvm: -netdev user: Parameter 'id' is missing anatoly techtonik
@ 2012-07-24 10:23     ` Stefan Hajnoczi
  2012-07-24 19:02       ` anatoly techtonik
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Hajnoczi @ 2012-07-24 10:23 UTC (permalink / raw)
  To: anatoly techtonik; +Cc: Mike Lovell, qemu-devel

On Mon, Jul 23, 2012 at 10:41 PM, anatoly techtonik <techtonik@gmail.com> wrote:
> Forwarding per discussion in qemu-discuss.
> Please CC.
>
> ---------- Forwarded message ----------
> From: Mike Lovell <mike@dev-zero.net>
> Date: Mon, Jul 23, 2012 at 10:58 PM
> Subject: Re: [Qemu-discuss] qemu-kvm: -netdev user: Parameter 'id' is missing
> To: qemu-discuss@nongnu.org
>
>
> On 07/20/2012 04:10 PM, anatoly techtonik wrote:
>>
>> The documentation at http://wiki.qemu.org/Documentation/Networking
>> makes people think that 'id' parameter for -netdev user is optional,
>> which doesn't appear to be true:
>>
>>      $ qemu-kvm -hda image.img -netdev user
>>      qemu-kvm: -netdev user: Parameter 'id' is missing

I have updated the wiki page.

A -netdev needs to be paired with a NIC -device.  That's why the
identifier is essential, it allows you to say -netdev
<type>,id=netdev0 -device <type>,netdev=netdev0.

Stefan

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

* Re: [Qemu-devel] [Qemu-discuss] qemu-kvm: -netdev user: Parameter 'id' is missing
  2012-07-24 10:23     ` Stefan Hajnoczi
@ 2012-07-24 19:02       ` anatoly techtonik
  2012-07-25 15:00         ` Stefan Hajnoczi
  0 siblings, 1 reply; 7+ messages in thread
From: anatoly techtonik @ 2012-07-24 19:02 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: Mike Lovell, qemu-devel

On Tue, Jul 24, 2012 at 1:23 PM, Stefan Hajnoczi <stefanha@gmail.com> wrote:
> On Mon, Jul 23, 2012 at 10:41 PM, anatoly techtonik <techtonik@gmail.com> wrote:
>> Forwarding per discussion in qemu-discuss.
>> Please CC.
>>
>> ---------- Forwarded message ----------
>> From: Mike Lovell <mike@dev-zero.net>
>> Date: Mon, Jul 23, 2012 at 10:58 PM
>> Subject: Re: [Qemu-discuss] qemu-kvm: -netdev user: Parameter 'id' is missing
>> To: qemu-discuss@nongnu.org
>>
>>
>> On 07/20/2012 04:10 PM, anatoly techtonik wrote:
>>>
>>> The documentation at http://wiki.qemu.org/Documentation/Networking
>>> makes people think that 'id' parameter for -netdev user is optional,
>>> which doesn't appear to be true:
>>>
>>>      $ qemu-kvm -hda image.img -netdev user
>>>      qemu-kvm: -netdev user: Parameter 'id' is missing
>
> I have updated the wiki page.

Even with -net nic considered obsolete (is the whole -net family
obsolete?), it looks like there is no complete replacement for it. For
example, there is no equivalent for -net nic,model=? (referenced from
wiki). It is also strange to read proposal to "see the qemu man page
for the various options that you can pass to -net nic". Unfortunately,
-netdev is completely undocumented in man and there is no info that
-net nic and -net user are obsolete there. All this stuff is
confusing.

> A -netdev needs to be paired with a NIC -device.  That's why the
> identifier is essential, it allows you to say -netdev
> <type>,id=netdev0 -device <type>,netdev=netdev0.

It still says "The id option can be used with the -device...", where
"can be" looks like it should be replaced by "must".

Why is it impossible for -netdev to create NIC device automatically if
not explicitly set? As a user I don't really know which net device do
I need. This would greatly simplify user experience (and lower Qemu
bounce rate).

There is also a question about user mode. It is said "the guest is not
directly accessible from the host or the external network" and also
"You can isolate the guest from the host (and broader network) using
the restrict option". ??? Guest is already not directly accessible -
why use the restrict?
--
anatoly t.

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

* Re: [Qemu-devel] [Qemu-discuss] qemu-kvm: -netdev user: Parameter 'id' is missing
  2012-07-24 19:02       ` anatoly techtonik
@ 2012-07-25 15:00         ` Stefan Hajnoczi
  2012-07-25 15:53           ` Stefan Hajnoczi
  2012-07-26  8:21           ` anatoly techtonik
  0 siblings, 2 replies; 7+ messages in thread
From: Stefan Hajnoczi @ 2012-07-25 15:00 UTC (permalink / raw)
  To: anatoly techtonik; +Cc: Mike Lovell, qemu-devel

On Tue, Jul 24, 2012 at 8:02 PM, anatoly techtonik <techtonik@gmail.com> wrote:
> On Tue, Jul 24, 2012 at 1:23 PM, Stefan Hajnoczi <stefanha@gmail.com> wrote:
>> On Mon, Jul 23, 2012 at 10:41 PM, anatoly techtonik <techtonik@gmail.com> wrote:
>>> Forwarding per discussion in qemu-discuss.
>>> Please CC.
>>>
>>> ---------- Forwarded message ----------
>>> From: Mike Lovell <mike@dev-zero.net>
>>> Date: Mon, Jul 23, 2012 at 10:58 PM
>>> Subject: Re: [Qemu-discuss] qemu-kvm: -netdev user: Parameter 'id' is missing
>>> To: qemu-discuss@nongnu.org
>>>
>>>
>>> On 07/20/2012 04:10 PM, anatoly techtonik wrote:
>>>>
>>>> The documentation at http://wiki.qemu.org/Documentation/Networking
>>>> makes people think that 'id' parameter for -netdev user is optional,
>>>> which doesn't appear to be true:
>>>>
>>>>      $ qemu-kvm -hda image.img -netdev user
>>>>      qemu-kvm: -netdev user: Parameter 'id' is missing
>>
>> I have updated the wiki page.
>
> Even with -net nic considered obsolete (is the whole -net family
> obsolete?), it looks like there is no complete replacement for it. For
> example, there is no equivalent for -net nic,model=? (referenced from
> wiki). It is also strange to read proposal to "see the qemu man page
> for the various options that you can pass to -net nic". Unfortunately,
> -netdev is completely undocumented in man and there is no info that
> -net nic and -net user are obsolete there. All this stuff is
> confusing.

You are right that this is underdocumented and confusing.  Answers to
your points:

1. -device ? lists all device models built into QEMU.  This includes
NICs but they are not grouped in an easy-to-find way.  Here is an
example of the output:
name "e1000", bus PCI, desc "Intel Gigabit Ethernet"

2. -netdev is undocumented on the man page.  I'm fixing this and will
send the patch to qemu-devel.

3. There is a little bit of -netdev/-device documentation in
docs/qdev-device-use.txt.

>> A -netdev needs to be paired with a NIC -device.  That's why the
>> identifier is essential, it allows you to say -netdev
>> <type>,id=netdev0 -device <type>,netdev=netdev0.
>
> It still says "The id option can be used with the -device...", where
> "can be" looks like it should be replaced by "must".

Strictly speaking "can be" is correct because -device id= is optional.
 You can also do:
-net user -device virtio-net-pci,vlan=0

This is basically equivalent to:
-net user -net nic,model=virtio

What's going on here is that -device is used but with the legacy QEMU
"VLAN" feature that can be used to connect NICs and backends.

Things aren't as simple as they should be but I think the problem here
is really the documentation.  We can try to improve it so that it
doesn't leave open questions like this, maybe without going into every
nasty detail.

> Why is it impossible for -netdev to create NIC device automatically if
> not explicitly set? As a user I don't really know which net device do
> I need. This would greatly simplify user experience (and lower Qemu
> bounce rate).

There was a similar discussion about -drive for block devices just the
other day.  I don't think there's a good answer except that QEMU
command-line has historic baggage and that everyone has a different
use case so it can be hard to come up with a good simplified
command-line option set.

The area where I think we can fix things easily is by offering better
documentation.

> There is also a question about user mode. It is said "the guest is not
> directly accessible from the host or the external network" and also
> "You can isolate the guest from the host (and broader network) using
> the restrict option". ??? Guest is already not directly accessible -
> why use the restrict?

You are correct that the guest is not directly accessible from the
host.  I think what the line about isolation means to say is that you
can prevent the guest from communicating with anything besides the
emulated network inside QEMU.

restricted=on means:
 * No gateway or DNS fields in the DHCP reply - guest has no external
connectivity
 * No TCP connections to external host:port unless explicitly allowed
 * No UDP except for the built-in DHCP/TFTP server

You could use this if you don't want software inside the guest to
phone home, for example, but still want some basic network services
(like TFTP boot).

Stefan

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

* Re: [Qemu-devel] [Qemu-discuss] qemu-kvm: -netdev user: Parameter 'id' is missing
  2012-07-25 15:00         ` Stefan Hajnoczi
@ 2012-07-25 15:53           ` Stefan Hajnoczi
  2012-07-26  8:21           ` anatoly techtonik
  1 sibling, 0 replies; 7+ messages in thread
From: Stefan Hajnoczi @ 2012-07-25 15:53 UTC (permalink / raw)
  To: anatoly techtonik; +Cc: Mike Lovell, qemu-devel

On Wed, Jul 25, 2012 at 4:00 PM, Stefan Hajnoczi <stefanha@gmail.com> wrote:
> On Tue, Jul 24, 2012 at 8:02 PM, anatoly techtonik <techtonik@gmail.com> wrote:
>> On Tue, Jul 24, 2012 at 1:23 PM, Stefan Hajnoczi <stefanha@gmail.com> wrote:
>>> On Mon, Jul 23, 2012 at 10:41 PM, anatoly techtonik <techtonik@gmail.com> wrote:
>>>> Forwarding per discussion in qemu-discuss.
>>>> Please CC.
>>>>
>>>> ---------- Forwarded message ----------
>>>> From: Mike Lovell <mike@dev-zero.net>
>>>> Date: Mon, Jul 23, 2012 at 10:58 PM
>>>> Subject: Re: [Qemu-discuss] qemu-kvm: -netdev user: Parameter 'id' is missing
>>>> To: qemu-discuss@nongnu.org
>>>>
>>>>
>>>> On 07/20/2012 04:10 PM, anatoly techtonik wrote:
>>>>>
>>>>> The documentation at http://wiki.qemu.org/Documentation/Networking
>>>>> makes people think that 'id' parameter for -netdev user is optional,
>>>>> which doesn't appear to be true:
>>>>>
>>>>>      $ qemu-kvm -hda image.img -netdev user
>>>>>      qemu-kvm: -netdev user: Parameter 'id' is missing
>>>
>>> I have updated the wiki page.
>>
>> Even with -net nic considered obsolete (is the whole -net family
>> obsolete?), it looks like there is no complete replacement for it. For
>> example, there is no equivalent for -net nic,model=? (referenced from
>> wiki). It is also strange to read proposal to "see the qemu man page
>> for the various options that you can pass to -net nic". Unfortunately,
>> -netdev is completely undocumented in man and there is no info that
>> -net nic and -net user are obsolete there. All this stuff is
>> confusing.
>
> You are right that this is underdocumented and confusing.  Answers to
> your points:

I have restructured the wiki page.  Most of it focusses on
-netdev/-device now.  There is a separate section at the bottom on
-net.

Some distractions were removed and I hope it's slightly easier to get into.

Next I will write the -netdev man page section.

If you would like a wiki account please let me know your preferred username.

Stefan

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

* Re: [Qemu-devel] [Qemu-discuss] qemu-kvm: -netdev user: Parameter 'id' is missing
  2012-07-25 15:00         ` Stefan Hajnoczi
  2012-07-25 15:53           ` Stefan Hajnoczi
@ 2012-07-26  8:21           ` anatoly techtonik
  2012-07-26  9:25             ` Stefan Hajnoczi
  1 sibling, 1 reply; 7+ messages in thread
From: anatoly techtonik @ 2012-07-26  8:21 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: Mike Lovell, qemu-devel

On Wed, Jul 25, 2012 at 6:00 PM, Stefan Hajnoczi <stefanha@gmail.com> wrote:
> On Tue, Jul 24, 2012 at 8:02 PM, anatoly techtonik <techtonik@gmail.com> wrote:
>> On Tue, Jul 24, 2012 at 1:23 PM, Stefan Hajnoczi <stefanha@gmail.com> wrote:
>>> On Mon, Jul 23, 2012 at 10:41 PM, anatoly techtonik <techtonik@gmail.com> wrote:
>>>> Forwarding per discussion in qemu-discuss.
>>>> Please CC.
>>>>
>>>> ---------- Forwarded message ----------
>>>> From: Mike Lovell <mike@dev-zero.net>
>>>> Date: Mon, Jul 23, 2012 at 10:58 PM
>>>> Subject: Re: [Qemu-discuss] qemu-kvm: -netdev user: Parameter 'id' is missing
>>>> To: qemu-discuss@nongnu.org
>>>>
>>>>
>>>> On 07/20/2012 04:10 PM, anatoly techtonik wrote:
>>>>>
>>>>> The documentation at http://wiki.qemu.org/Documentation/Networking
>>>>> makes people think that 'id' parameter for -netdev user is optional,
>>>>> which doesn't appear to be true:
>>>>>
>>>>>      $ qemu-kvm -hda image.img -netdev user
>>>>>      qemu-kvm: -netdev user: Parameter 'id' is missing
>>>
>>> I have updated the wiki page.
>>
>> Even with -net nic considered obsolete (is the whole -net family
>> obsolete?), it looks like there is no complete replacement for it. For
>> example, there is no equivalent for -net nic,model=? (referenced from
>> wiki). It is also strange to read proposal to "see the qemu man page
>> for the various options that you can pass to -net nic". Unfortunately,
>> -netdev is completely undocumented in man and there is no info that
>> -net nic and -net user are obsolete there. All this stuff is
>> confusing.
>
> You are right that this is underdocumented and confusing.  Answers to
> your points:
>
> 1. -device ? lists all device models built into QEMU.  This includes
> NICs but they are not grouped in an easy-to-find way.  Here is an
> example of the output:
> name "e1000", bus PCI, desc "Intel Gigabit Ethernet"

I've seen it. 3 page long list of devices is not practical for every day use.

>>> A -netdev needs to be paired with a NIC -device.  That's why the
>>> identifier is essential, it allows you to say -netdev
>>> <type>,id=netdev0 -device <type>,netdev=netdev0.
>>
>> It still says "The id option can be used with the -device...", where
>> "can be" looks like it should be replaced by "must".
>
> Strictly speaking "can be" is correct because -device id= is optional.
>  You can also do:
> -net user -device virtio-net-pci,vlan=0
>
> This is basically equivalent to:
> -net user -net nic,model=virtio

-net user  is deprecated, no?

> What's going on here is that -device is used but with the legacy QEMU
> "VLAN" feature that can be used to connect NICs and backends.
>
> Things aren't as simple as they should be but I think the problem here
> is really the documentation.  We can try to improve it so that it
> doesn't leave open questions like this, maybe without going into every
> nasty detail.

Yes, it would be nice if documentation was user story oriented, going
gradually from the simplest use stories (tutorials) to more difficult:
1. download stuff from internet from guest (NAT) (OS updates, software
installation)
2. run services on guest accessible from host (web server and stuff)
without specialized configuration (i.e. port forwarding)
3. services on guest accessible from other guests (web development
scenarios - guest servers for db, web, client on host)
..
x. routers, vlans, networks, bridges and other hardcore hardware emulation stuff

>> Why is it impossible for -netdev to create NIC device automatically if
>> not explicitly set? As a user I don't really know which net device do
>> I need. This would greatly simplify user experience (and lower Qemu
>> bounce rate).
>
> There was a similar discussion about -drive for block devices just the
> other day.  I don't think there's a good answer except that QEMU
> command-line has historic baggage and that everyone has a different
> use case so it can be hard to come up with a good simplified
> command-line option set.

Do you maintain a list of use cases? It should be easy to forward
people to it when they face with this problem on not-intuitive
interface. Then outsiders can try to help with prototyping this
interface too. For example, with Python's argparse.

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

* Re: [Qemu-devel] [Qemu-discuss] qemu-kvm: -netdev user: Parameter 'id' is missing
  2012-07-26  8:21           ` anatoly techtonik
@ 2012-07-26  9:25             ` Stefan Hajnoczi
  0 siblings, 0 replies; 7+ messages in thread
From: Stefan Hajnoczi @ 2012-07-26  9:25 UTC (permalink / raw)
  To: anatoly techtonik; +Cc: Mike Lovell, qemu-devel

On Thu, Jul 26, 2012 at 9:21 AM, anatoly techtonik <techtonik@gmail.com> wrote:
> On Wed, Jul 25, 2012 at 6:00 PM, Stefan Hajnoczi <stefanha@gmail.com> wrote:
>> On Tue, Jul 24, 2012 at 8:02 PM, anatoly techtonik <techtonik@gmail.com> wrote:
>>> On Tue, Jul 24, 2012 at 1:23 PM, Stefan Hajnoczi <stefanha@gmail.com> wrote:
>>>> On Mon, Jul 23, 2012 at 10:41 PM, anatoly techtonik <techtonik@gmail.com> wrote:
>>>> A -netdev needs to be paired with a NIC -device.  That's why the
>>>> identifier is essential, it allows you to say -netdev
>>>> <type>,id=netdev0 -device <type>,netdev=netdev0.
>>>
>>> It still says "The id option can be used with the -device...", where
>>> "can be" looks like it should be replaced by "must".
>>
>> Strictly speaking "can be" is correct because -device id= is optional.
>>  You can also do:
>> -net user -device virtio-net-pci,vlan=0
>>
>> This is basically equivalent to:
>> -net user -net nic,model=virtio
>
> -net user  is deprecated, no?

Yes.  What I'm showing is that you can use -device without a netdev's
id.  So it isn't a "must" as you asked above.

But I think this detail is not helpful on the Networking wiki page.
The wiki edit I did yesterday removes the issue entirely.

>> What's going on here is that -device is used but with the legacy QEMU
>> "VLAN" feature that can be used to connect NICs and backends.
>>
>> Things aren't as simple as they should be but I think the problem here
>> is really the documentation.  We can try to improve it so that it
>> doesn't leave open questions like this, maybe without going into every
>> nasty detail.
>
> Yes, it would be nice if documentation was user story oriented, going
> gradually from the simplest use stories (tutorials) to more difficult:
> 1. download stuff from internet from guest (NAT) (OS updates, software
> installation)
> 2. run services on guest accessible from host (web server and stuff)
> without specialized configuration (i.e. port forwarding)
> 3. services on guest accessible from other guests (web development
> scenarios - guest servers for db, web, client on host)
> ..
> x. routers, vlans, networks, bridges and other hardcore hardware emulation stuff

Absolutely.  Especially a quickstart would be handy.  For many people
it's not necessary to understand how QEMU networking works, they just
want their VM to access the internet.

>>> Why is it impossible for -netdev to create NIC device automatically if
>>> not explicitly set? As a user I don't really know which net device do
>>> I need. This would greatly simplify user experience (and lower Qemu
>>> bounce rate).
>>
>> There was a similar discussion about -drive for block devices just the
>> other day.  I don't think there's a good answer except that QEMU
>> command-line has historic baggage and that everyone has a different
>> use case so it can be hard to come up with a good simplified
>> command-line option set.
>
> Do you maintain a list of use cases? It should be easy to forward
> people to it when they face with this problem on not-intuitive
> interface. Then outsiders can try to help with prototyping this
> interface too. For example, with Python's argparse.

I'm not aware of a list, sorry.

Stefan

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

end of thread, other threads:[~2012-07-26  9:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CAPkN8xLoZ+Ls+RWgDwp3p5zWe_TiYq9+3TbjRFEzAKZMXPYyyg@mail.gmail.com>
     [not found] ` <500DACED.9080805@dev-zero.net>
2012-07-23 21:41   ` [Qemu-devel] [Qemu-discuss] qemu-kvm: -netdev user: Parameter 'id' is missing anatoly techtonik
2012-07-24 10:23     ` Stefan Hajnoczi
2012-07-24 19:02       ` anatoly techtonik
2012-07-25 15:00         ` Stefan Hajnoczi
2012-07-25 15:53           ` Stefan Hajnoczi
2012-07-26  8:21           ` anatoly techtonik
2012-07-26  9:25             ` Stefan Hajnoczi

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