@@ -75,8 +75,6 @@ func (v *Virt) Info(ctx context.Context) (*enginetypes.Info, error) {
75
75
76
76
// Execute executes a command in vm
77
77
func (v * Virt ) Execute (ctx context.Context , ID string , config * enginetypes.ExecConfig ) (pid string , stdout , stderr io.ReadCloser , stdin io.WriteCloser , err error ) {
78
- log .Debugf (ctx , "execute opts on %s: %v" , ID , config )
79
- defer log .Debugf (ctx , "execute opts done" )
80
78
if config .Tty {
81
79
flags := virttypes.AttachGuestFlags {Safe : true , Force : true }
82
80
stream , err := v .client .AttachGuest (ctx , ID , config .Cmd , flags )
@@ -155,7 +153,7 @@ func (v *Virt) NetworkList(ctx context.Context, drivers []string) (nets []*engin
155
153
156
154
// BuildRefs builds references, it's not necessary for virt. presently.
157
155
func (v * Virt ) BuildRefs (ctx context.Context , name string , tags []string ) (refs []string ) {
158
- log .Warnf (ctx , "BuildRefs does not implement" )
156
+ log .Warn (ctx , "BuildRefs does not implement" )
159
157
return
160
158
}
161
159
@@ -195,7 +193,7 @@ func (v *Virt) VirtualizationCreate(ctx context.Context, opts *enginetypes.Virtu
195
193
// VirtualizationResourceRemap .
196
194
func (v * Virt ) VirtualizationResourceRemap (ctx context.Context , opts * enginetypes.VirtualizationRemapOptions ) (<- chan enginetypes.VirtualizationRemapMessage , error ) {
197
195
// VM does not support binding cores.
198
- log .Debugf (ctx , "virtualizationResourceRemap is not supported by vm" )
196
+ log .Warn (ctx , "virtualizationResourceRemap is not supported by vm" )
199
197
ch := make (chan enginetypes.VirtualizationRemapMessage )
200
198
defer close (ch )
201
199
return ch , nil
@@ -247,12 +245,15 @@ func (v *Virt) VirtualizationInspect(ctx context.Context, ID string) (*enginetyp
247
245
248
246
// VirtualizationLogs streams a specific guest's log.
249
247
func (v * Virt ) VirtualizationLogs (ctx context.Context , opts * enginetypes.VirtualizationLogStreamOptions ) (stdout io.ReadCloser , stderr io.ReadCloser , err error ) {
250
- msg , err := v .client .Log (ctx , 15 , opts .ID )
251
- if err != nil {
252
- return nil , nil , err
248
+ n := - 1
249
+ if opts .Tail != "all" && opts .Tail != "" {
250
+ if n , err = strconv .Atoi (opts .Tail ); err != nil {
251
+ return nil , nil , err
252
+ }
253
253
}
254
- reader := ioutil .NopCloser (strings .NewReader (strings .Join (msg , "\n " )))
255
- return reader , nil , nil
254
+
255
+ stream , err := v .client .Log (ctx , n , opts .ID )
256
+ return stream , nil , err
256
257
}
257
258
258
259
// VirtualizationAttach attaches something to a guest.
0 commit comments