qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [Qemu-devel] [PATCH v2 1/7] block/ssh: don't call libss


From: Eric Blake
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH v2 1/7] block/ssh: don't call libssh2_init() in block_init()
Date: Wed, 30 Aug 2017 15:12:44 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

On 08/30/2017 03:11 PM, Jeff Cody wrote:
> On Wed, Aug 30, 2017 at 02:40:16PM -0500, Eric Blake wrote:
>> On 08/30/2017 11:56 AM, Jeff Cody wrote:
>>> We don't need libssh2 failure to be fatal (we could just opt to not
>>> register the driver on failure). But, it is probably a good idea to
>>> avoid external library calls during the block_init(), and call the
>>> libssh2 global init function on the first usage, returning any errors.
>>>

>>
>> Is returning 'ret' from libssh2_init() wise?
>>
>> If 'ret' is not important, you could simplify this:
>>
>> if (ssh_state_init(s, errp)) {
>>     return -1;
>> }
> 
> Good point, not sure if a non-zero ret from libssh2_init() provides meaning
> beyond 'error' for us.  Maybe return -EIO instead of -1, though?

You used -EIO for 5/7, so that does sound a bit better.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]