Bug 864122 - virtualport parameter profileid in a <network> or <portgroup> causes failure to initialize guest interface
virtualport parameter profileid in a <network> or <portgroup> causes failure ...
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Laine Stump
Virtualization Bugs
Depends On:
  Show dependency treegraph
Reported: 2012-10-08 12:02 EDT by Laine Stump
Modified: 2013-02-21 02:25 EST (History)
9 users (show)

See Also:
Fixed In Version: libvirt-0.10.2-2.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-02-21 02:25:51 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Laine Stump 2012-10-08 12:02:23 EDT
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.


1) in the guest, define an interface as:

    <interface type='network'>
      <source network='ovs-test-net'/>

2) define and start a network called 'ovs-test-net' that uses an existing openvswitch bridge (see Bug 805564 for more details on this):

     <forward mode='bridge'/>
     <bridge name='ovsbr'/>
     <virtualport type='openvswitch'>
       <parameters profileid='testprofile'/>

3) start the guest.

You will get the error above.
Comment 1 Laine Stump 2012-10-08 12:03:21 EDT
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",
Comment 4 Huang Wenlong 2012-10-09 04:06:28 EDT
Verify this bug with: 

1)setup a openvswitch env 

2)create in the test guest, define an interface as:

    <interface type='network'>
      <source network='ovs-test-net'/>

2) define and start a network called 'ovs-test-net' that uses an existing openvswitch bridge :

     <forward mode='bridge'/>
     <bridge name='ovsbr'/>
     <virtualport type='openvswitch'>
       <parameters profileid='testprofile'/>

then start domain , it can start success no error.
Comment 5 errata-xmlrpc 2013-02-21 02:25:51 EST
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.


Note You need to log in before you can comment on or make changes to this bug.