Skip to contentSkip to conversation

net patches

GIT PULL Stefan Hajnoczi 1 participant 2 messages Nov 22, 2013

lore
Share & tools
lore
#0 lore raw

Bug fix for netdev/vlan configuration.

The following changes since commit 607bb022f2a44797cbf40e85e84da4134e2f0e01:

Update version for 1.7.0-rc1 release (2013-11-21 08:11:47 -0800)

are available in the git repository at:

git://github.com/stefanha/qemu.git net

for you to fetch changes up to 30c367ed446b6ea53245589a5cf373578ac075d7:

qdev-properties-system.c: Allow vlan or netdev for -device, not both (2013-11-22 09:47:00 +0100)

----------------------------------------------------------------
Vlad Yasevich (1):
qdev-properties-system.c: Allow vlan or netdev for -device, not both

 hw/core/qdev-properties-system.c | 9 +++++++++
 1 file changed, 9 insertions(+)
Signature · 1 line
1.8.4.2
#1 lore raw

[Qemu-devel] [PULL 1/1] qdev-properties-system.c: Allow vlan or netdev for -device, not both

From: Vlad Yasevich <[email protected]>

It is currently possible to specify things like:

	-device e1000,netdev=foo,vlan=1

With this usage, whichever argument was specified last (vlan or netdev) overwrites what was previousely set and results in a non-working configuration. Even worse, when used with multiqueue devices, it causes a segmentation fault on exit in qemu_free_net_client.

That patch treates the above command line options as invalid and generates an error at start-up.

---
 hw/core/qdev-properties-system.c | 9 +++++++++
 1 file changed, 9 insertions(+)
hw/core/qdev-properties-system.c +9 -0
index 0eada32..729efa8 100644
@@ -205,6 +205,11 @@ static int parse_netdev(DeviceState *dev, const char *str, void **ptr)
             goto err;
         }
 
+        if (ncs[i]) {
+            ret = -EINVAL;
+            goto err;
+        }
+
         ncs[i] = peers[i];
         ncs[i]->queue_index = i;
     }
@@ -301,6 +306,10 @@ static void set_vlan(Object *obj, Visitor *v, void *opaque,
         *ptr = NULL;
         return;
     }
+    if (*ptr) {
+        error_set_from_qdev_prop_error(errp, -EINVAL, dev, prop, name);
+        return;
+    }
 
     hubport = net_hub_port_find(id);
     if (!hubport) {
Signature · 1 line
1.8.4.2