Add a blog post about the new -nic parameter
PATCH 1/1 Add a blog post about the new -nic parameter
QEMU v2.12 features a new, useful parameter called "-nic". Let's throw some light on this new parameter with a new blog post.
--- _posts/2018-05-30-nic-parameter.md | 126 +++++++++++++++++++++++++++++ screenshots/2018-05-30-qemu-cli-net.png | Bin 0 -> 24020 bytes screenshots/2018-05-30-qemu-cli-netdev.png | Bin 0 -> 13553 bytes 3 files changed, 126 insertions(+) create mode 100644 _posts/2018-05-30-nic-parameter.md create mode 100644 screenshots/2018-05-30-qemu-cli-net.png create mode 100644 screenshots/2018-05-30-qemu-cli-netdev.png
_posts/2018-05-30-nic-parameter.md new file +126 -0
@@ -0,0 +1,126 @@ +--- +layout: post +title: "QEMU's new -nic command line parameter" +date: 2018-05-30 14:00:00 +0200 +author: Thomas Huth +categories: [features, parameters, 'qemu 2.12'] +--- +QEMU v2.12 has a new command line parameter, the `-nic` parameter, which can +be used to configure a network connection for the guest quite easily, since +it sets up both, the guest NIC and the host network backend in one go. +If you've read the +[ChangeLog of QEMU v2.12](https://wiki.qemu.org/ChangeLog/2.12) or the current +[documentation of QEMU](https://qemu.weilnetz.de/doc/qemu-doc.html) +you might already have spotted this new `-nic` parameter, and maybe you've +thought "Why yet another parameter for configuring the network?". To answer +that question, we've got to have look at the basics and other options first. +To configure a network interface for a guest, you've got to consider two +sides: + +1. The emulated hardware that the guest sees, i.e. the so-called NIC (network +interface controller). On systems that support PCI cards, these typically +could be an e1000 network card, a rtl8139 network card or a virtio-net device. + +2. The network backend on the host side, i.e. the interface that QEMU uses +to exchange network packets with the outside (like other QEMU instances +or other real hosts in your intranet or in the internet). The common host +backends are the "user" (a.k.a. SLIRP) backend which provides access to +the host's network via NAT, the "tap" backend which allows the guest to +directly access the host's network, or the "socket" backend which can be +used to connect multiple QEMU instances to simulate a shared network for +the their guests. + +The legacy -net option +---------------------- + +QEMU's initial way of configuring the network for the guest was the `-net` +option. The emulated NIC hardware can be chosen with the +`-net nic,model=xyz,...` parameter, and the host backend with the +`-net <backend>,...` parameter (e.g. `-net user` for the SLIRP backend). +The emulated NIC and the host backend are not directly connected here, but +via an emulated hub (called "vlan" in QEMU), so if you start QEMU with +`-net nic,model=e1000 -net user -net nic,model=virtio -net tap` for example, +you get a setup where all the NICs and host backends are connected together +via a hub: + + + +That means the e1000 NIC also gets the network traffic from the virtio-net +NIC and both host backends... this is probably not what the user expected, +who likely wanted to have two separate network connections instead. To achieve +this with the `-net` parameter, you've got to use the "vlan" option instead, +for example `-net nic,model=e1000,vlan=0 -net user,vlan=0 +-net nic,model=virtio,vlan=1 -net tap,vlan=1` moves the virtio-net NIC +and the "tap" backend to another hub (with ID #1). Please note that the +"vlan" option will be dropped in QEMU v3.0 since the term was rather +[confusing](https://bugs.launchpad.net/qemu/+bug/658904) (it's not related +to IEEE 802.1Q for example) and caused a lot of misconfigurations in the past. + +The modern -netdev option +------------------------- + +Beside the confusing "vlan" option of the `-net` parameter, there is one +more major drawback with that legacy option: Since you always get the +emulated hub here inbetween to which multiple NICs and host backends could be +attached, you can not use this concept for situations where the NIC frontend +has to work very closely together with the host backend, e.g. when you want +to use vhost acceleration for virtio-net. + +To configure a network connection where the emulated NIC is directly connected +to a host network backend without a hub inbetween, you've got to use the +`-netdev` option for the backend, together with `-device` for the guest NIC +hardware. Assuming that you want to configure the same devices as in the +`-net` example above, you could use `-netdev user,id=n1 -device e1000,netdev=n1 +-netdev tap,id=n2 -device virtio-net,netdev=n2` for example. This will give you +straight 1:1 connections between the NICs and the host backends: + + + +Note that you can also still connect the devices to a hub with the special +`-netdev hubport` backend, but in most of the normal use cases, the use +of a hub is not required anymore. + +Now while `-netdev` together with `-device` provide a very flexible and +extensive way to configure a network connection, there are still two +drawbacks with this option pair which prevented us from deprecating the +legacy `-net` parameter completely: + +1. The `-device` parameter can only be used for pluggable NICs. Boards +(e.g. embedded boards) which feature an on-board NIC can not be configured +with `-device` yet, so `-net nic` must be used here instead. + +2. In some cases, the `-net` parameter is easier to use (less to type). +For example, assuming you want to set up a "tap" network connection and +you've got the default scripts /etc/qemu-ifup and -down already in place, +it's enough to type `-net nic -net tap` to start your guest. To do the +same with `-netdev`, you always got to specify an ID here, too, for +example like this: `-netdev tap,id=n1 -device e1000,netdev=n1`. + +The new -nic option +------------------- + +Looking at the disadvantages listed above, it should be clear that there +is a need for a convenience option that is + + * easier to use (i.e. less to type) than `-netdev <backend>,id=<id> + -device <dev>,netdev=<id>` + * can be used to configure on-board / non-pluggable NICs, too + * does not use a hub between the NIC and the host backend. + +This is where the new `-nic` option kicks in: This option can be used +to configure both, the guest's NIC hardware and the host backend in +one go. For example, instead of `-netdev tap,id=n1 -device e1000,netdev=n1` +you can simply type `-nic tap,model=e1000`. If you don't care about the +exact NIC model type, you can even omit the `model=...` option and type +`-nic tap`. This is even shorter and more convenient than the previous +shortest way of typing `-net nic -net tap`. To get a list of NIC models +that you can use with this option, you can simply run QEMU with +`-nic model=help`. + +Beside being easier to use, the `-nic` option can be used to configure +on-board NICs, too (just like the `-net` option). For machines that have +on-board NICs, the first `-nic` parameter configures the first on-board NIC, +the second `-nic` parameter configures the second on-board NIC, and so forth. +You obviously have got to omit the `model=...` option from the `-nic` +parameter in this case, though (or use the right model name of the on-board +NIC).
screenshots/2018-05-30-qemu-cli-net.png new file binary +0 -0
screenshots/2018-05-30-qemu-cli-netdev.png new file binary +0 -0
Signature · 1 line
1.8.3.1
Quoted 2 lines · Thomas Huth
QEMU v2.12 features a new, useful parameter called "-nic". Let's throw some light on this new parameter with a new blog post.
Nice!
Quoted 16 lines
Signed-off-by Thomas Huth <[email protected]>--- _posts/2018-05-30-nic-parameter.md | 126 +++++++++++++++++++++++++++++ screenshots/2018-05-30-qemu-cli-net.png | Bin 0 -> 24020 bytes screenshots/2018-05-30-qemu-cli-netdev.png | Bin 0 -> 13553 bytes 3 files changed, 126 insertions(+) create mode 100644 _posts/2018-05-30-nic-parameter.md create mode 100644 screenshots/2018-05-30-qemu-cli-net.png create mode 100644 screenshots/2018-05-30-qemu-cli-netdev.png_posts/2018-05-30-nic-parameter.md new file +0
-0
_posts/2018-05-30-nic-parameter.md line 8
Quoted 8 lines
_posts/2018-05-30-nic-parameter.md new file +8
-0@@ -0,0 +1,126 @@ +--- +layout: post +title: "QEMU's new -nic command line parameter" +date: 2018-05-30 14:00:00 +0200 +author: Thomas Huth +categories: [features, parameters, 'qemu 2.12'] +--- +QEMU v2.12 has a new command line parameter, the `-nic` parameter, which can
"Option" instead of parameter perhaps? Let's reserve "parameter" for the key/value pairs.
_posts/2018-05-30-nic-parameter.md line 16
Quoted 8 lines
_posts/2018-05-30-nic-parameter.md new file +8
-0+be used to configure a network connection for the guest quite easily, since +it sets up both, the guest NIC and the host network backend in one go. +If you've read the +[ChangeLog of QEMU v2.12](https://wiki.qemu.org/ChangeLog/2.12) or the current +[documentation of QEMU](https://qemu.weilnetz.de/doc/qemu-doc.html) +you might already have spotted this new `-nic` parameter, and maybe you've +thought "Why yet another parameter for configuring the network?". To answer +that question, we've got to have look at the basics and other options first.
I think the introduction could be improved. Something like:
If you used QEMU in the past, you are probably familiar with the -net command line option, which can be used to configure a network connection for the guest. Some of you may also be familiar with -netdev, which configures a network _backend_. Yet, QEMU v2.12 introduces a third way to configure NICs, the -nic option.
The [ChangeLog of QEMU v2.12](https://wiki.qemu.org/ChangeLog/2.12#Network) says that -nic can "quickly create a network front-end (emulated NIC) and a host back-end". But why did QEMU need yet another way to configure the network, and how does it compare with -net and -netdev? To answer these questions, we need to look at the model behind network virtualization in QEMU.
_posts/2018-05-30-nic-parameter.md line 18
Quoted 2 lines
_posts/2018-05-30-nic-parameter.md new file +2
-0+To configure a network interface for a guest, you've got to consider two +sides:
As hinted by the ChangeLog entry, a network interface consists of two separate entities:
_posts/2018-05-30-nic-parameter.md line 22
Quoted 3 lines
_posts/2018-05-30-nic-parameter.md new file +3
-0+1. The emulated hardware that the guest sees, i.e. the so-called NIC (network +interface controller). On systems that support PCI cards, these typically +could be an e1000 network card, a rtl8139 network card or a virtio-net device.
This entity is also called the "front-end"
_posts/2018-05-30-nic-parameter.md line 23
Quoted 2 lines
_posts/2018-05-30-nic-parameter.md new file +2
-0+ +2. The network backend on the host side, i.e. the interface that QEMU uses
Please standardize on either front-end/back-end, or frontend/backend. The squiggly red line in Thunderbird suggests that the former is more correct, though.
_posts/2018-05-30-nic-parameter.md line 31
Quoted 7 lines
_posts/2018-05-30-nic-parameter.md new file +7
-0+to exchange network packets with the outside (like other QEMU instances +or other real hosts in your intranet or in the internet). The common host +backends are the "user" (a.k.a. SLIRP) backend which provides access to +the host's network via NAT, the "tap" backend which allows the guest to +directly access the host's network, or the "socket" backend which can be +used to connect multiple QEMU instances to simulate a shared network for +the their guests.
Perhaps we can already say here:
---
Based on this, it is already possible to define the difference between -net, -netdev and -nic: -net can create _either_ a front-end or a back-end (and also does other things); -netdev can only create a back-end; while a single occurrence of -nic will create _both_ a front-end and a back-end.
---
but I'm not sure is an improvement.
_posts/2018-05-30-nic-parameter.md
Quoted 5 lines
_posts/2018-05-30-nic-parameter.md new file +5
-0+The legacy -net option +---------------------- + +QEMU's initial way of configuring the network for the guest was the `-net` +option.
If you don't say it above, you should say here "-net can create either a front-end or a back-end, depending on its argument. net nic,... will create a front-end, while -net _backend-type_,... (e.g. -net user for SLIRP) will create a backend."
The emulated NIC hardware can be chosen with the
_posts/2018-05-30-nic-parameter.md line 40
Quoted 3 lines
_posts/2018-05-30-nic-parameter.md new file +3
-0+`-net nic,model=xyz,...` parameter, and the host backend with the +`-net <backend>,...` parameter (e.g. `-net user` for the SLIRP backend). +The emulated NIC and the host backend are not directly connected here, but
Perhaps "However" or "In addition" at the beginning of this sentence?
_posts/2018-05-30-nic-parameter.md line 41
Quoted 1 line
_posts/2018-05-30-nic-parameter.md new file +1
-0+via an emulated hub (called "vlan" in QEMU), so if you start QEMU with
Not sure you should mention "vlan" here. Perhaps only below when you explain the argument?
Do you want to mention the correct usage of vlan/hub here, e.g. -net nic,model=e1000 -net nic,model=virtio -net user?
_posts/2018-05-30-nic-parameter.md
Quoted 9 lines
_posts/2018-05-30-nic-parameter.md new file +9
-0+`-net nic,model=e1000 -net user -net nic,model=virtio -net tap` for example, +you get a setup where all the NICs and host backends are connected together +via a hub: + + + +That means the e1000 NIC also gets the network traffic from the virtio-net +NIC and both host backends... this is probably not what the user expected, +who likely wanted to have two separate network connections instead.
... "what the user expected; it's more likely that they wanted two separate networks in the guest, one for each NIC".
Quoted 2 lines
To achieve
+this with the-netparameter, you've got to use the "vlan" option instead,
Because -net always connects its NIC to a hub, you would have to tell QEMU to use _two separate hubs_, using the "vlan" parameter, for example...
(Contractions should be avoided in written English. So "you have to", "you should", etc. is preferrable to "you've got to". That also sounds very informal to me, but at this point I'm going to wave my hands and say I'm not a native speaker).
_posts/2018-05-30-nic-parameter.md line 57
Quoted 6 lines
_posts/2018-05-30-nic-parameter.md new file +6
-0+for example `-net nic,model=e1000,vlan=0 -net user,vlan=0 +-net nic,model=virtio,vlan=1 -net tap,vlan=1` moves the virtio-net NIC +and the "tap" backend to another hub (with ID #1). Please note that the +"vlan" option will be dropped in QEMU v3.0 since the term was rather +[confusing](https://bugs.launchpad.net/qemu/+bug/658904) (it's not related +to IEEE 802.1Q for example) and caused a lot of misconfigurations in the past.
In order to use multiple hubs as in this example, you will have to declare each hub port manually. This will be the topic of a separate blog post. (Right? :))
_posts/2018-05-30-nic-parameter.md line 67
Quoted 9 lines
_posts/2018-05-30-nic-parameter.md new file +9
-0+The modern -netdev option +------------------------- + +Beside the confusing "vlan" option of the `-net` parameter, there is one +more major drawback with that legacy option: Since you always get the +emulated hub here inbetween to which multiple NICs and host backends could be +attached, you can not use this concept for situations where the NIC frontend +has to work very closely together with the host backend, e.g. when you want +to use vhost acceleration for virtio-net.
... with that option: the emulated hub between the NIC and the backend gets in the way when the NIC front-end has to work closely together with the host back-end. For example, vhost acceleration is disabled if you create a virtio-net device with -net nic,model=virtio.
_posts/2018-05-30-nic-parameter.md
Quoted 3 lines
_posts/2018-05-30-nic-parameter.md new file +3
-0+ +To configure a network connection where the emulated NIC is directly connected +to a host network backend without a hub inbetween,
Is "inbetween" actually an English word? I would say "... to a host network back-end, without a hub in between,".
Quoted 1 line
you've got to use the
(Another occurrence of "you've got to").
Quoted 10 lines
+
-netdevoption for the backend, together with-devicefor the guest NIC_posts/2018-05-30-nic-parameter.md new file +9
-0+hardware. Assuming that you want to configure the same devices as in the +`-net` example above, you could use `-netdev user,id=n1 -device e1000,netdev=n1 +-netdev tap,id=n2 -device virtio-net,netdev=n2` for example. This will give you +straight 1:1 connections between the NICs and the host backends: + + + +Note that you can also still connect the devices to a hub with the special +`-netdev hubport` backend, but in most of the normal use cases, the use
_posts/2018-05-30-nic-parameter.md line 90
Quoted 10 lines
_posts/2018-05-30-nic-parameter.md new file +10
-0+of a hub is not required anymore. + +Now while `-netdev` together with `-device` provide a very flexible and +extensive way to configure a network connection, there are still two +drawbacks with this option pair which prevented us from deprecating the +legacy `-net` parameter completely: + +1. The `-device` parameter can only be used for pluggable NICs. Boards +(e.g. embedded boards) which feature an on-board NIC can not be configured +with `-device` yet, so `-net nic` must be used here instead.
This is actually okay, you can use net nic,netdev=... IIRC.
Quoted 7 lines
+2. In some cases, the
-netparameter is easier to use (less to type)._posts/2018-05-30-nic-parameter.md new file +6
-0+For example, assuming you want to set up a "tap" network connection and +you've got the default scripts /etc/qemu-ifup and -down already in place, +it's enough to type `-net nic -net tap` to start your guest. To do the +same with `-netdev`, you always got to specify an ID here, too, for +example like this: `-netdev tap,id=n1 -device e1000,netdev=n1`. +
_posts/2018-05-30-nic-parameter.md line 108
Quoted 10 lines
_posts/2018-05-30-nic-parameter.md new file +10
-0+The new -nic option +------------------- + +Looking at the disadvantages listed above, it should be clear that there +is a need for a convenience option that is + + * easier to use (i.e. less to type) than `-netdev <backend>,id=<id> + -device <dev>,netdev=<id>` + * can be used to configure on-board / non-pluggable NICs, too + * does not use a hub between the NIC and the host backend.
s/use a hub/place a hub/
_posts/2018-05-30-nic-parameter.md
Quoted 2 lines
_posts/2018-05-30-nic-parameter.md new file +2
-0+ +This is where the new `-nic` option kicks in: This option can be used
If you feel the need to put an uppercase letter after a colon, it probably should be a period instead.
Quoted 1 line
+to configure both, the guest's NIC hardware and the host backend in
s/both,/both/ (German influence?)
Quoted 5 lines
_posts/2018-05-30-nic-parameter.md new file +5
-0+one go. For example, instead of `-netdev tap,id=n1 -device e1000,netdev=n1` +you can simply type `-nic tap,model=e1000`. If you don't care about the +exact NIC model type, you can even omit the `model=...` option and type +`-nic tap`. This is even shorter and more convenient than the previous +shortest way of typing `-net nic -net tap`. To get a list of NIC models
_posts/2018-05-30-nic-parameter.md line 126
Quoted 10 lines
_posts/2018-05-30-nic-parameter.md new file +10
-0+that you can use with this option, you can simply run QEMU with +`-nic model=help`. + +Beside being easier to use, the `-nic` option can be used to configure +on-board NICs, too (just like the `-net` option). For machines that have +on-board NICs, the first `-nic` parameter configures the first on-board NIC, +the second `-nic` parameter configures the second on-board NIC, and so forth. +You obviously have got to omit the `model=...` option from the `-nic` +parameter in this case, though (or use the right model name of the on-board +NIC).
Perhaps this last paragraph can be eliminated?
Some conclusions are missing. Maybe something about deprecation in general, and how we always try to improve on the usability of the command line when deprecating options?
Thanks,
Paolo
Quoted 713 lines
screenshots/2018-05-30-qemu-cli-net.png new file binary +0
-0screenshots/2018-05-30-qemu-cli-netdev.png new file binary +0
-0
Quoted 7 lines · Paolo Bonzini
Quoted 2 lines · Thomas Huth
QEMU v2.12 features a new, useful parameter called "-nic". Let's throw some light on this new parameter with a new blog post.
Nice!
Quoted 7 lines
Quoted 1 line
+QEMU v2.12 has a new command line parameter, the
-nicparameter, which can"Option" instead of parameter perhaps? Let's reserve "parameter" for the key/value pairs.
_posts/2018-05-30-nic-parameter.md line 10
Quoted 2 lines
_posts/2018-05-30-nic-parameter.md new file +2
-0+be used to configure a network connection for the guest quite easily, since +it sets up both, the guest NIC and the host network backend in one go.
s/both,/both/
Quoted 38 lines
_posts/2018-05-30-nic-parameter.md line 16
Quoted 6 lines
_posts/2018-05-30-nic-parameter.md new file +6
-0+If you've read the +[ChangeLog of QEMU v2.12](https://wiki.qemu.org/ChangeLog/2.12) or the current +[documentation of QEMU](https://qemu.weilnetz.de/doc/qemu-doc.html) +you might already have spotted this new `-nic` parameter, and maybe you've +thought "Why yet another parameter for configuring the network?". To answer +that question, we've got to have look at the basics and other options first.I think the introduction could be improved. Something like:
If you used QEMU in the past, you are probably familiar with the
-netcommand line option, which can be used to configure a network connection for the guest. Some of you may also be familiar with-netdev, which configures a network _backend_. Yet, QEMU v2.12 introduces a third way to configure NICs, the-nicoption.The [ChangeLog of QEMU v2.12](https://wiki.qemu.org/ChangeLog/2.12#Network) says that
-niccan "quickly create a network front-end (emulated NIC) and a host back-end". But why did QEMU need yet another way to configure the network, and how does it compare with-netand-netdev? To answer these questions, we need to look at the model behind network virtualization in QEMU._posts/2018-05-30-nic-parameter.md line 18
Quoted 2 lines
_posts/2018-05-30-nic-parameter.md new file +2
-0+To configure a network interface for a guest, you've got to consider two +sides:As hinted by the ChangeLog entry, a network interface consists of two separate entities:
_posts/2018-05-30-nic-parameter.md line 22
Quoted 3 lines
+1. The emulated hardware that the guest sees, i.e. the so-called NIC (network
_posts/2018-05-30-nic-parameter.md new file +2
-0+interface controller). On systems that support PCI cards, these typically +could be an e1000 network card, a rtl8139 network card or a virtio-net device.This entity is also called the "front-end"
Quoted 2 lines
+
+2. The network backend on the host side, i.e. the interface that QEMU uses
Quoted 6 lines
Please standardize on either front-end/back-end, or frontend/backend. The squiggly red line in Thunderbird suggests that the former is more correct, though.
_posts/2018-05-30-nic-parameter.md line 26
Quoted 2 lines
_posts/2018-05-30-nic-parameter.md new file +2
-0+to exchange network packets with the outside (like other QEMU instances +or other real hosts in your intranet or in the internet). The common host
s/or in the internet/or the internet/
Quoted 5 lines
_posts/2018-05-30-nic-parameter.md line 31
Quoted 5 lines
_posts/2018-05-30-nic-parameter.md new file +5
-0+backends are the "user" (a.k.a. SLIRP) backend which provides access to +the host's network via NAT, the "tap" backend which allows the guest to +directly access the host's network, or the "socket" backend which can be +used to connect multiple QEMU instances to simulate a shared network for +the their guests.
s/the their/their/
Quoted 55 lines
Perhaps we can already say here:
---
Based on this, it is already possible to define the difference between-net,-netdevand-nic:-netcan create _either_ a front-end or a back-end (and also does other things);-netdevcan only create a back-end; while a single occurrence of-nicwill create _both_ a front-end and a back-end.
---but I'm not sure is an improvement.
_posts/2018-05-30-nic-parameter.md
Quoted 5 lines
_posts/2018-05-30-nic-parameter.md new file +5
-0+The legacy -net option +---------------------- + +QEMU's initial way of configuring the network for the guest was the `-net` +option.If you don't say it above, you should say here "
-netcan create either a front-end or a back-end, depending on its argument.net nic,...will create a front-end, while-net _backend-type_,...(e.g.-net userfor SLIRP) will create a backend."The emulated NIC hardware can be chosen with the
Quoted 3 lines
+
-net nic,model=xyz,...parameter, and the host backend with the +-net <backend>,...parameter (e.g.-net userfor the SLIRP backend). +The emulated NIC and the host backend are not directly connected here, butPerhaps "However" or "In addition" at the beginning of this sentence?
Quoted 1 line
+via an emulated hub (called "vlan" in QEMU), so if you start QEMU with
Not sure you should mention "vlan" here. Perhaps only below when you explain the argument?
Do you want to mention the correct usage of vlan/hub here, e.g.
-net nic,model=e1000 -net nic,model=virtio -net user?_posts/2018-05-30-nic-parameter.md
Quoted 9 lines
+
-net nic,model=e1000 -net user -net nic,model=virtio -net tapfor example,_posts/2018-05-30-nic-parameter.md new file +8
-0+you get a setup where all the NICs and host backends are connected together +via a hub: + + + +That means the e1000 NIC also gets the network traffic from the virtio-net +NIC and both host backends... this is probably not what the user expected, +who likely wanted to have two separate network connections instead.... "what the user expected; it's more likely that they wanted two separate networks in the guest, one for each NIC".
Quoted 2 lines
To achieve
+this with the-netparameter, you've got to use the "vlan" option instead,
Quoted 7 lines
Because
-netalways connects its NIC to a hub, you would have to tell QEMU to use_twoseparatehubs_, using the "vlan" parameter, for example...(Contractions should be avoided in written English. So "you have to", "you should", etc. is preferrable to "you've got to". That also sounds very informal to me, but at this point I'm going to wave my hands and say I'm not a native speaker).
Your rewrite without the contraction seems fine to me.
Quoted 12 lines
_posts/2018-05-30-nic-parameter.md line 57
Quoted 7 lines
_posts/2018-05-30-nic-parameter.md new file +6
-0+for example `-net nic,model=e1000,vlan=0 -net user,vlan=0 +-net nic,model=virtio,vlan=1 -net tap,vlan=1` moves the virtio-net NIC +and the "tap" backend to another hub (with ID #1). Please note that the +"vlan" option will be dropped in QEMU v3.0 since the term was rather +[confusing](https://bugs.launchpad.net/qemu/+bug/658904) (it's not related +to IEEE 802.1Q for example) and caused a lot of misconfigurations in the past.In order to use multiple hubs as in this example, you will have to declare each hub port manually. This will be the topic of a separate blog post. (Right? :))
Quoted 6 lines
_posts/2018-05-30-nic-parameter.md line 64
Quoted 6 lines
_posts/2018-05-30-nic-parameter.md new file +6
-0+The modern -netdev option +------------------------- + +Beside the confusing "vlan" option of the `-net` parameter, there is one +more major drawback with that legacy option: Since you always get the +emulated hub here inbetween to which multiple NICs and host backends could be
s/inbetween/in between/
Quoted 16 lines
_posts/2018-05-30-nic-parameter.md line 67
Quoted 3 lines
_posts/2018-05-30-nic-parameter.md new file +3
-0+attached, you can not use this concept for situations where the NIC frontend +has to work very closely together with the host backend, e.g. when you want +to use vhost acceleration for virtio-net.... with that option: the emulated hub between the NIC and the backend gets in the way when the NIC front-end has to work closely together with the host back-end. For example, vhost acceleration is disabled if you create a virtio-net device with
-net nic,model=virtio._posts/2018-05-30-nic-parameter.md
Quoted 3 lines
_posts/2018-05-30-nic-parameter.md new file +3
-0+ +To configure a network connection where the emulated NIC is directly connected +to a host network backend without a hub inbetween,Is "inbetween" actually an English word? I would say "... to a host network back-end, without a hub in between,".
Quoted 8 lines
Quoted 1 line
you've got to use the
(Another occurrence of "you've got to").
Quoted 4 lines
+
-netdevoption for the backend, together with-devicefor the guest NIC +hardware. Assuming that you want to configure the same devices as in the +-netexample above, you could use-netdev user,id=n1 -device e1000,netdev=n1 +-netdev tap,id=n2 -device virtio-net,netdev=n2for example. This will give you
Two uses of the word 'example' in the same sentence; are both needed?
Quoted 71 lines
Quoted 6 lines
_posts/2018-05-30-nic-parameter.md new file +6
-0+straight 1:1 connections between the NICs and the host backends: + + + +Note that you can also still connect the devices to a hub with the special +`-netdev hubport` backend, but in most of the normal use cases, the use_posts/2018-05-30-nic-parameter.md line 90
Quoted 10 lines
_posts/2018-05-30-nic-parameter.md new file +10
-0+of a hub is not required anymore. + +Now while `-netdev` together with `-device` provide a very flexible and +extensive way to configure a network connection, there are still two +drawbacks with this option pair which prevented us from deprecating the +legacy `-net` parameter completely: + +1. The `-device` parameter can only be used for pluggable NICs. Boards +(e.g. embedded boards) which feature an on-board NIC can not be configured +with `-device` yet, so `-net nic` must be used here instead.This is actually okay, you can use
net nic,netdev=...IIRC.Quoted 7 lines
+2. In some cases, the
-netparameter is easier to use (less to type)._posts/2018-05-30-nic-parameter.md new file +6
-0+For example, assuming you want to set up a "tap" network connection and +you've got the default scripts /etc/qemu-ifup and -down already in place, +it's enough to type `-net nic -net tap` to start your guest. To do the +same with `-netdev`, you always got to specify an ID here, too, for +example like this: `-netdev tap,id=n1 -device e1000,netdev=n1`. +_posts/2018-05-30-nic-parameter.md line 108
Quoted 10 lines
_posts/2018-05-30-nic-parameter.md new file +10
-0+The new -nic option +------------------- + +Looking at the disadvantages listed above, it should be clear that there +is a need for a convenience option that is + + * easier to use (i.e. less to type) than `-netdev <backend>,id=<id> + -device <dev>,netdev=<id>` + * can be used to configure on-board / non-pluggable NICs, too + * does not use a hub between the NIC and the host backend.s/use a hub/place a hub/
Review
Quoted 2 lines
(quoted diff) +2
-0+ +This is where the new `-nic` option kicks in: This option can be usedIf you feel the need to put an uppercase letter after a colon, it probably should be a period instead.
Quoted 1 line
+to configure both, the guest's NIC hardware and the host backend in
s/both,/both/ (German influence?)
Quoted 5 lines
_posts/2018-05-30-nic-parameter.md new file +5
-0+one go. For example, instead of `-netdev tap,id=n1 -device e1000,netdev=n1` +you can simply type `-nic tap,model=e1000`. If you don't care about the +exact NIC model type, you can even omit the `model=...` option and type +`-nic tap`. This is even shorter and more convenient than the previous +shortest way of typing `-net nic -net tap`. To get a list of NIC models_posts/2018-05-30-nic-parameter.md line 126
Quoted 10 lines
_posts/2018-05-30-nic-parameter.md new file +10
-0+that you can use with this option, you can simply run QEMU with +`-nic model=help`. + +Beside being easier to use, the `-nic` option can be used to configure +on-board NICs, too (just like the `-net` option). For machines that have +on-board NICs, the first `-nic` parameter configures the first on-board NIC, +the second `-nic` parameter configures the second on-board NIC, and so forth. +You obviously have got to omit the `model=...` option from the `-nic` +parameter in this case, though (or use the right model name of the on-board +NIC).Perhaps this last paragraph can be eliminated?
Some conclusions are missing. Maybe something about deprecation in general, and how we always try to improve on the usability of the command line when deprecating options?
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org