if err := connectionPty.fromC(xc);err != nil {
return fmt.Errorf("converting field connectionPty: %v", err)
}
-x.ConnectionUnion = connectionPty
+x.ConnectionUnion = &connectionPty
case ChannelConnectionSocket:
x.ConnectionUnion = nil
case ChannelConnectionUnknown:
case ChannelConnectionUnknown:
break
case ChannelConnectionPty:
-tmp, ok := x.ConnectionUnion.(ChannelinfoConnectionUnionPty)
+tmp, ok := x.ConnectionUnion.(*ChannelinfoConnectionUnionPty)
if !ok {
return errors.New("wrong type for union key connection")
}
if err := typeHvm.fromC(xc);err != nil {
return fmt.Errorf("converting field typeHvm: %v", err)
}
-x.TypeUnion = typeHvm
+x.TypeUnion = &typeHvm
case DomainTypeInvalid:
x.TypeUnion = nil
case DomainTypePv:
if err := typePv.fromC(xc);err != nil {
return fmt.Errorf("converting field typePv: %v", err)
}
-x.TypeUnion = typePv
+x.TypeUnion = &typePv
case DomainTypePvh:
var typePvh DomainBuildInfoTypeUnionPvh
if err := typePvh.fromC(xc);err != nil {
return fmt.Errorf("converting field typePvh: %v", err)
}
-x.TypeUnion = typePvh
+x.TypeUnion = &typePvh
default:
return fmt.Errorf("invalid union key '%v'", x.Type)}
x.ArchArm.GicVersion = GicVersion(xc.arch_arm.gic_version)
xc._type = C.libxl_domain_type(x.Type)
switch x.Type{
case DomainTypeHvm:
-tmp, ok := x.TypeUnion.(DomainBuildInfoTypeUnionHvm)
+tmp, ok := x.TypeUnion.(*DomainBuildInfoTypeUnionHvm)
if !ok {
return errors.New("wrong type for union key type")
}
hvmBytes := C.GoBytes(unsafe.Pointer(&hvm),C.sizeof_libxl_domain_build_info_type_union_hvm)
copy(xc.u[:],hvmBytes)
case DomainTypePv:
-tmp, ok := x.TypeUnion.(DomainBuildInfoTypeUnionPv)
+tmp, ok := x.TypeUnion.(*DomainBuildInfoTypeUnionPv)
if !ok {
return errors.New("wrong type for union key type")
}
pvBytes := C.GoBytes(unsafe.Pointer(&pv),C.sizeof_libxl_domain_build_info_type_union_pv)
copy(xc.u[:],pvBytes)
case DomainTypePvh:
-tmp, ok := x.TypeUnion.(DomainBuildInfoTypeUnionPvh)
+tmp, ok := x.TypeUnion.(*DomainBuildInfoTypeUnionPvh)
if !ok {
return errors.New("wrong type for union key type")
}
if err := typeHostdev.fromC(xc);err != nil {
return fmt.Errorf("converting field typeHostdev: %v", err)
}
-x.TypeUnion = typeHostdev
+x.TypeUnion = &typeHostdev
default:
return fmt.Errorf("invalid union key '%v'", x.Type)}
xc._type = C.libxl_usbdev_type(x.Type)
switch x.Type{
case UsbdevTypeHostdev:
-tmp, ok := x.TypeUnion.(DeviceUsbdevTypeUnionHostdev)
+tmp, ok := x.TypeUnion.(*DeviceUsbdevTypeUnionHostdev)
if !ok {
return errors.New("wrong type for union key type")
}
if err := connectionSocket.fromC(xc);err != nil {
return fmt.Errorf("converting field connectionSocket: %v", err)
}
-x.ConnectionUnion = connectionSocket
+x.ConnectionUnion = &connectionSocket
case ChannelConnectionUnknown:
x.ConnectionUnion = nil
default:
case ChannelConnectionPty:
break
case ChannelConnectionSocket:
-tmp, ok := x.ConnectionUnion.(DeviceChannelConnectionUnionSocket)
+tmp, ok := x.ConnectionUnion.(*DeviceChannelConnectionUnionSocket)
if !ok {
return errors.New("wrong type for union key connection")
}
if err := typeDiskEject.fromC(xc);err != nil {
return fmt.Errorf("converting field typeDiskEject: %v", err)
}
-x.TypeUnion = typeDiskEject
+x.TypeUnion = &typeDiskEject
case EventTypeDomainCreateConsoleAvailable:
x.TypeUnion = nil
case EventTypeDomainDeath:
if err := typeDomainShutdown.fromC(xc);err != nil {
return fmt.Errorf("converting field typeDomainShutdown: %v", err)
}
-x.TypeUnion = typeDomainShutdown
+x.TypeUnion = &typeDomainShutdown
case EventTypeOperationComplete:
var typeOperationComplete EventTypeUnionOperationComplete
if err := typeOperationComplete.fromC(xc);err != nil {
return fmt.Errorf("converting field typeOperationComplete: %v", err)
}
-x.TypeUnion = typeOperationComplete
+x.TypeUnion = &typeOperationComplete
default:
return fmt.Errorf("invalid union key '%v'", x.Type)}
xc._type = C.libxl_event_type(x.Type)
switch x.Type{
case EventTypeDomainShutdown:
-tmp, ok := x.TypeUnion.(EventTypeUnionDomainShutdown)
+tmp, ok := x.TypeUnion.(*EventTypeUnionDomainShutdown)
if !ok {
return errors.New("wrong type for union key type")
}
case EventTypeDomainDeath:
break
case EventTypeDiskEject:
-tmp, ok := x.TypeUnion.(EventTypeUnionDiskEject)
+tmp, ok := x.TypeUnion.(*EventTypeUnionDiskEject)
if !ok {
return errors.New("wrong type for union key type")
}
disk_ejectBytes := C.GoBytes(unsafe.Pointer(&disk_eject),C.sizeof_libxl_event_type_union_disk_eject)
copy(xc.u[:],disk_ejectBytes)
case EventTypeOperationComplete:
-tmp, ok := x.TypeUnion.(EventTypeUnionOperationComplete)
+tmp, ok := x.TypeUnion.(*EventTypeUnionOperationComplete)
if !ok {
return errors.New("wrong type for union key type")
}
if err := typeCat.fromC(xc);err != nil {
return fmt.Errorf("converting field typeCat: %v", err)
}
-x.TypeUnion = typeCat
+x.TypeUnion = &typeCat
case PsrFeatTypeMba:
var typeMba PsrHwInfoTypeUnionMba
if err := typeMba.fromC(xc);err != nil {
return fmt.Errorf("converting field typeMba: %v", err)
}
-x.TypeUnion = typeMba
+x.TypeUnion = &typeMba
default:
return fmt.Errorf("invalid union key '%v'", x.Type)}
xc._type = C.libxl_psr_feat_type(x.Type)
switch x.Type{
case PsrFeatTypeCat:
-tmp, ok := x.TypeUnion.(PsrHwInfoTypeUnionCat)
+tmp, ok := x.TypeUnion.(*PsrHwInfoTypeUnionCat)
if !ok {
return errors.New("wrong type for union key type")
}
catBytes := C.GoBytes(unsafe.Pointer(&cat),C.sizeof_libxl_psr_hw_info_type_union_cat)
copy(xc.u[:],catBytes)
case PsrFeatTypeMba:
-tmp, ok := x.TypeUnion.(PsrHwInfoTypeUnionMba)
+tmp, ok := x.TypeUnion.(*PsrHwInfoTypeUnionMba)
if !ok {
return errors.New("wrong type for union key type")
}