@@ -87,19 +87,19 @@ func (c *Criu) sendAndRecv(reqB []byte) ([]byte, int, error) {
8787}
8888
8989func (c * Criu ) doSwrk (reqType rpc.CriuReqType , opts * rpc.CriuOpts , nfy Notify ) error {
90- resp , err := c .doSwrkWithResp (reqType , opts , nfy )
90+ resp , err := c .doSwrkWithResp (reqType , opts , nfy , nil )
9191 if err != nil {
9292 return err
9393 }
9494 respType := resp .GetType ()
9595 if respType != reqType {
96- return errors .New ("unexpected responce " )
96+ return errors .New ("unexpected CRIU RPC response " )
9797 }
9898
9999 return nil
100100}
101101
102- func (c * Criu ) doSwrkWithResp (reqType rpc.CriuReqType , opts * rpc.CriuOpts , nfy Notify ) (* rpc.CriuResp , error ) {
102+ func (c * Criu ) doSwrkWithResp (reqType rpc.CriuReqType , opts * rpc.CriuOpts , nfy Notify , features * rpc. CriuFeatures ) (* rpc.CriuResp , error ) {
103103 var resp * rpc.CriuResp
104104
105105 req := rpc.CriuReq {
@@ -111,6 +111,10 @@ func (c *Criu) doSwrkWithResp(reqType rpc.CriuReqType, opts *rpc.CriuOpts, nfy N
111111 opts .NotifyScripts = proto .Bool (true )
112112 }
113113
114+ if features != nil {
115+ req .Features = features
116+ }
117+
114118 if c .swrkCmd == nil {
115119 err := c .Prepare ()
116120 if err != nil {
@@ -209,7 +213,7 @@ func (c *Criu) StartPageServer(opts *rpc.CriuOpts) error {
209213
210214// StartPageServerChld starts the page server and returns PID and port
211215func (c * Criu ) StartPageServerChld (opts * rpc.CriuOpts ) (int , int , error ) {
212- resp , err := c .doSwrkWithResp (rpc .CriuReqType_PAGE_SERVER_CHLD , opts , nil )
216+ resp , err := c .doSwrkWithResp (rpc .CriuReqType_PAGE_SERVER_CHLD , opts , nil , nil )
213217 if err != nil {
214218 return 0 , 0 , err
215219 }
@@ -220,7 +224,7 @@ func (c *Criu) StartPageServerChld(opts *rpc.CriuOpts) (int, int, error) {
220224// GetCriuVersion executes the VERSION RPC call and returns the version
221225// as an integer. Major * 10000 + Minor * 100 + SubLevel
222226func (c * Criu ) GetCriuVersion () (int , error ) {
223- resp , err := c .doSwrkWithResp (rpc .CriuReqType_VERSION , nil , nil )
227+ resp , err := c .doSwrkWithResp (rpc .CriuReqType_VERSION , nil , nil , nil )
224228 if err != nil {
225229 return 0 , err
226230 }
0 commit comments