Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1361944 - line 437 of xenapi_utils.c if logic seems to be a typo
Summary: line 437 of xenapi_utils.c if logic seems to be a typo
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-01 02:41 UTC by netcas
Modified: 2016-08-02 13:21 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-02 13:21:25 UTC


Attachments (Terms of Use)

Description netcas 2016-08-01 02:41:00 UTC
Description of problem:

Hello, guys! I am doing some experiment to control XenServer with libvirt, when I define a domain, it always fails and gives the following message:

error: Failed to define domain from /root/new.xml
error: internal error: Couldn't get VM information from XML

so I diving into the souce and found it always fails at network creating, and the code in libvirt-1.3.5\src\xenapi\xenapi_utils.c, line 437 is following:

        xen_vif_create(session, &vif, vif_record);
        if (!vif) {
            xen_vif_free(vif);
            xen_vif_record_free(vif_record);
            xen_network_record_free(net_rec);
            xen_network_set_free(net_set);
            return 0;
        }
        xen_vif_record_free(vif_record);
        xen_network_record_free(net_rec);
        ... ...
        return -1;

should this if be if (vif) {...}, if the vif is null, why need to free it?


Version-Release number of selected component (if applicable): 1.3.5


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Cole Robinson 2016-08-02 13:21:25 UTC
Thanks for the report! Unfortunately the xenapi driver in libvirt isn't actively developed and I don't think any of the maintainers have a xenapi setup to even test changes. That said, if you verify that the change fixes things for you, please generate a patch and send it to libvir-list@redhat.com, and if it's simple enough someone may apply it. See:

https://libvirt.org/hacking.html#patches

In the meantime, I'm closing this bug as DEFERRED, since otherwise it will just sit in the bug tracker indefinitely


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