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

Re: [libvirt] [PATCH 3/7] add virAgentCommand()



On 08/20/2012 02:16 AM, MATSUDA, Daiki wrote:
> (2012/08/16 22:13), Martin Kletzander wrote:
>> On 08/15/2012 03:36 AM, MATSUDA Daiki wrote:
[...]
>>> +char *
>>> +virAgentCommand(virDomainPtr domain,
>>> +                const char *cmd,
>>> +                int timeout,
>>> +                unsigned int flags)
>>> +{
>>> +    virConnectPtr conn;
>>> +
>>> +    VIR_DEBUG("domain=%p, cmd=%s, timeout=%d, flags=%x",
>>> +              domain, cmd, timeout, flags);
>>> +
>>> +    if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
>>> +        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
>>> +        virDispatchError(NULL);
>>> +        return NULL;
>>> +    }
>>> +
>>> +    conn = domain->conn;
>>> +
>>> +    if (conn->driver->qemuAgentCommand) {
>>> +        return conn->driver->qemuAgentCommand(domain, cmd, timeout,
>>> flags);
>>
>> Shouldn't this be allowed only for read-only connections?
> 
> I do not uderstand what you say.
> 

I meant a check similar to this:

if (conn->flags & VIR_CONNECT_RO)
     virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);


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