Red Hat Bugzilla – Bug 864122
virtualport parameter profileid in a <network> or <portgroup> causes failure to initialize guest interface
Last modified: 2013-02-21 02:25:51 EST
If a guest <interface type='network'> points to a network and/or portgroup that specifies a "profileid" attribute in the virtualport <parameters> element, the interface will fail to be initialized, with an error message like the following: virNetDevVPortProfileMerge:380: corrupted profileid string This is because a successful return code for virStrcpyStatic() is being incorrectly interpreted as a failure. Example: 1) in the guest, define an interface as: <interface type='network'> <source network='ovs-test-net'/> </interface> 2) define and start a network called 'ovs-test-net' that uses an existing openvswitch bridge (see Bug 805564 for more details on this): <network> <name>ovs-test-net</name> <forward mode='bridge'/> <bridge name='ovsbr'/> <virtualport type='openvswitch'> <parameters profileid='testprofile'/> </virtualport> </network> 3) start the guest. You will get the error above.
This bug was originally reported/fixed upstream: commit 83aebf6de4e2902c621edcba65de1d1556bee454 Author: Kyle Mestery <kmestery@cisco.com> Date: Wed Oct 3 15:46:55 2012 -0400 Correct checking of virStrcpyStatic() return value Correct the check for the return value of virStrcpyStatic() when copying port-profile names. Fixes Open vSwitch ports which utilize port-profiles from network definitions. Signed-off-by: Kyle Mestery <kmestery@cisco.com> diff --git a/src/util/virnetdevvportprofile.c b/src/util/virnetdevvportprofile.c index d774fb1..ac7aa5f 100644 --- a/src/util/virnetdevvportprofile.c +++ b/src/util/virnetdevvportprofile.c @@ -374,7 +374,7 @@ virNetDevVPortProfileMerge(virNetDevVPortProfilePtr orig, orig->profileID, mods->profileID); return -1; } - if (virStrcpyStatic(orig->profileID, mods->profileID)) { + if (virStrcpyStatic(orig->profileID, mods->profileID) == NULL) { /* this should never happen - it indicates mods->profileID * isn't properly null terminated. */ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
Verify this bug with: libvirt-0.10.2-2.el6.x86_64 openvswitch-1.7.1-1.x86_64 1)setup a openvswitch env http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=blob_plain;f=INSTALL;hb=HEAD 2)create in the test guest, define an interface as: <interface type='network'> <source network='ovs-test-net'/> </interface> 2) define and start a network called 'ovs-test-net' that uses an existing openvswitch bridge : <network> <name>ovs-test-net</name> <forward mode='bridge'/> <bridge name='ovsbr'/> <virtualport type='openvswitch'> <parameters profileid='testprofile'/> </virtualport> </network> then start domain , it can start success no error.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2013-0276.html