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

Re: [PATCH 2/4] golang/xenlight: add DeviceNicAdd/Remove wrappers


  • To: Nick Rosbrook <rosbrookn@xxxxxxxxx>
  • From: George Dunlap <George.Dunlap@xxxxxxxxxx>
  • Date: Wed, 22 Apr 2020 18:18:51 +0000
  • Accept-language: en-GB, en-US
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=George.Dunlap@xxxxxxxxxx; spf=Pass smtp.mailfrom=George.Dunlap@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: Nick Rosbrook <rosbrookn@xxxxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Ian Jackson <Ian.Jackson@xxxxxxxxxx>
  • Delivery-date: Wed, 22 Apr 2020 18:19:04 +0000
  • Ironport-sdr: fIVwoBWs+roMvmT/HyCk6mTpUgVvs7AZoKZWWpidOqVlIGWaB/L9uvHu2XRJi28NfzeKkZ3U0P TFa3hzZ3PFoG73ehyFlb14NmPSUCGFFn32QwGtmY0doyDsI74RWNEDJ0TwxttsSB+zV+KYuGah mIPCoLdJgOqN8t+0nRkVZUEopnrKwRi/Agtei7vVnzRnmfxPEqh2uxAp18Hgw7bO2TiymBKPpg z8/ekc2xSxF82/+VAbT4r4I685GnnVrI0xWufVKvgqZfvFOiwzj9f19oieUq09jUQGjD7HNCYU QAk=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHWERYbVTK8PO5Z/kOuRmMVsD4Gv6iFYT+A
  • Thread-topic: [PATCH 2/4] golang/xenlight: add DeviceNicAdd/Remove wrappers


> On Apr 12, 2020, at 11:02 PM, Nick Rosbrook <rosbrookn@xxxxxxxxx> wrote:
> 
> Add DeviceNicAdd and DeviceNicRemove as wrappers for
> libxl_device_nic_add and libxl_device_nic_remove.
> 
> Signed-off-by: Nick Rosbrook <rosbrookn@xxxxxxxxxxxx>
> ---
> tools/golang/xenlight/xenlight.go | 34 +++++++++++++++++++++++++++++++
> 1 file changed, 34 insertions(+)
> 
> diff --git a/tools/golang/xenlight/xenlight.go 
> b/tools/golang/xenlight/xenlight.go
> index 8492bcec4e..a56f913b81 100644
> --- a/tools/golang/xenlight/xenlight.go
> +++ b/tools/golang/xenlight/xenlight.go
> @@ -1068,3 +1068,37 @@ func (Ctx *Context) PrimaryConsoleGetTty(domid uint32) 
> (path string, err error)
>       path = C.GoString(cpath)
>       return
> }
> +
> +// DeviceNicAdd adds a nic to a domain.
> +func (Ctx *Context) DeviceNicAdd(domid Domid, nic *DeviceNic) error {
> +     var cnic C.libxl_device_nic
> +
> +     if err := nic.toC(&cnic); err != nil {
> +             return err
> +     }
> +     defer C.libxl_device_nic_dispose(&cnic)
> +
> +     ret := C.libxl_device_nic_add(Ctx.ctx, C.uint32_t(domid), &cnic, nil)
> +     if ret != 0 {
> +             return Error(ret)
> +     }
> +
> +     return nil
> +}
> +
> +// DeviceNicRemove removes a nic from a domain.

I feel like I want to say here what it is you actually have to fill in to 
remove the nic; but after 10 minutes of poking around the code, I’m not 
actually sure myself. :-)  (I think it *might* be just Devid and BackendDomid.)

So I’ll give this for now:

Reviewed-by: George Dunlap <george.dunlap@xxxxxxxxxx>

And if I find it before I finish reviewing the end of the series, we can check 
it in and look at improving the documentation later.

 -George

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.