Re: [PATCH 4/4] bhyve: parse passthru argument from XML-config

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Daniel P. Berrangé <berrange@xxxxxxxxxx> writes:

>>  src/bhyve/bhyve_parse_command.c | 59 +++++++++++++++++++++++++++++++++
>>  1 file changed, 59 insertions(+)
>
> Should come with additions to  bhyveargv2xmltest.c data files

Done

>> +    if (!(hostdev = virDomainHostdevDefNew()))
>> +        return 0;
>
> This method can't fail so don't check for NULL.

Done

>> +    if (!(params = g_strsplit(addr, ":", -1))) {
>> +        virReportError(VIR_ERR_OPERATION_FAILED, _("Failed to parse PCI address %1$s"), addr);
>> +        goto error;
>> +    }
>> +    if (g_str_equal(addr, *params))
>> +        if (!(params = g_strsplit(addr, "/", -1))) {
>
> This overwrites the pointer currently stored in 'params'
> without free'ing it. The 'g_auto' will only free data
> when it goes out of scope, not when the pointer is
> overwritten directly.

Done

>> +            virReportError(VIR_ERR_OPERATION_FAILED, _("Failed to parse PCI address %1$s"), addr);
>> +            goto error;
>> +        }
>
> Add {} on the outer if too for clarity.

Done.

-- 
Alexander Shursha




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux