aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@amazon.com>2013-11-25 09:37:27 -0800
committerAnthony Liguori <aliguori@amazon.com>2013-11-25 09:37:27 -0800
commit0ff1e1dac4b6bccefc4b8a861ec2a643ecfb6e9d (patch)
treeec3803f73d5d69c6f888ad63f65b8f34514d939e
parent607bb022f2a44797cbf40e85e84da4134e2f0e01 (diff)
parent30c367ed446b6ea53245589a5cf373578ac075d7 (diff)
Merge remote-tracking branch 'stefanha/net' into staging
# By Vlad Yasevich # Via Stefan Hajnoczi * stefanha/net: qdev-properties-system.c: Allow vlan or netdev for -device, not both Message-id: 1385118544-28482-1-git-send-email-stefanha@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
-rw-r--r--hw/core/qdev-properties-system.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c
index 0eada32dcf..729efa81a2 100644
--- a/hw/core/qdev-properties-system.c
+++ b/hw/core/qdev-properties-system.c
@@ -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) {