-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50128/#review152287
-----------------------------------------------------------




src/docker/docker.hpp (lines 107 - 123)
<https://reviews.apache.org/r/50128/#comment221263>

    Instead of defining it here, what about move this definition to docker.cpp?
    
    You can define the declariation at #365 as
    
    ```
    std::ostream& operator<<(std::ostream& stream, const Docker::Device& 
device);
    ```
    
    Then implement the definition at the end of docker.cpp.
    
    ```
    std::ostream& operator<<(std::ostream& stream, const Docker::Device& device)
    {
      stream << device.hostPath.string() << ":";
      stream << device.containerPath.string() << ":";
    
      if (device.access.read) {
        stream << "r";
      }
      if (device.access.write) {
        stream << "w";
      }
      if (device.access.mknod) {
        stream << "m";
      }
    
      return stream;
    }
    ```
    
    You can take a look at 
https://github.com/apache/mesos/blob/master/src/slave/containerizer/mesos/isolators/gpu/allocator.hpp#L86
 for detail.



src/docker/docker.cpp (line 395)
<https://reviews.apache.org/r/50128/#comment221264>

    You already got the error here, so I would propose the message as:
    
    ```
    return Error("Failed to parse device from 'HostConfig.Devices' entry: " + 
device.error());
    ```



src/docker/docker.cpp (lines 754 - 756)
<https://reviews.apache.org/r/50128/#comment221265>

    What about keep here not touched?


- Guangya Liu


On 十月 11, 2016, 8:16 a.m., Yubo Li wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50128/
> -----------------------------------------------------------
> 
> (Updated 十月 11, 2016, 8:16 a.m.)
> 
> 
> Review request for mesos, Benjamin Mahler, Kevin Klues, and Rajat Phull.
> 
> 
> Bugs: MESOS-5795
>     https://issues.apache.org/jira/browse/MESOS-5795
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Wrapped helper functions to 'Docker::Device' to handle data
> parsing and serializing between 'Docker::Device' structure and
> string.
> 
> 
> Diffs
> -----
> 
>   src/docker/docker.hpp 9093371afc8ea792ba94f61c6875703e547ea6b0 
>   src/docker/docker.cpp 50fda393a42afefc70790a26b44911e4cf17185e 
> 
> Diff: https://reviews.apache.org/r/50128/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Yubo Li
> 
>

Reply via email to