From 7e15830541de07c5d9329859895ab6fe271c5a2f Mon Sep 17 00:00:00 2001 From: Alice Frosi Date: Thu, 23 Nov 2023 15:04:25 +0100 Subject: [PATCH] virtwrap: add slices field The slices option enable to migrate to a volume with a larger size. See: https://issues.redhat.com/browse/RHEL-4607 Signed-off-by: Alice Frosi --- .../virtwrap/api/deepcopy_generated.go | 38 +++++++++++++++++++ pkg/virt-launcher/virtwrap/api/schema.go | 11 ++++++ 2 files changed, 49 insertions(+) diff --git a/pkg/virt-launcher/virtwrap/api/deepcopy_generated.go b/pkg/virt-launcher/virtwrap/api/deepcopy_generated.go index 6be26847ae88..8755c440ab55 100644 --- a/pkg/virt-launcher/virtwrap/api/deepcopy_generated.go +++ b/pkg/virt-launcher/virtwrap/api/deepcopy_generated.go @@ -960,6 +960,11 @@ func (in *DiskSource) DeepCopyInto(out *DiskSource) { *out = new(Reservations) (*in).DeepCopyInto(*out) } + if in.Slices != nil { + in, out := &in.Slices, &out.Slices + *out = make([]Slice, len(*in)) + copy(*out, *in) + } return } @@ -3161,6 +3166,39 @@ func (in *Shareable) DeepCopy() *Shareable { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Slice) DeepCopyInto(out *Slice) { + *out = *in + out.Slice = in.Slice + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Slice. +func (in *Slice) DeepCopy() *Slice { + if in == nil { + return nil + } + out := new(Slice) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SliceType) DeepCopyInto(out *SliceType) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SliceType. +func (in *SliceType) DeepCopy() *SliceType { + if in == nil { + return nil + } + out := new(SliceType) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SoundCard) DeepCopyInto(out *SoundCard) { *out = *in diff --git a/pkg/virt-launcher/virtwrap/api/schema.go b/pkg/virt-launcher/virtwrap/api/schema.go index 064fd9c051ff..ef136419d3e3 100644 --- a/pkg/virt-launcher/virtwrap/api/schema.go +++ b/pkg/virt-launcher/virtwrap/api/schema.go @@ -358,6 +358,16 @@ type FeatureEnabled struct { type Shareable struct{} +type Slice struct { + Slice SliceType `xml:"slice,omitempty"` +} + +type SliceType struct { + Type string `xml:"type,attr"` + Offset int64 `xml:"offset,attr"` + Size int64 `xml:"size,attr"` +} + type FeatureState struct { State string `xml:"state,attr,omitempty"` } @@ -688,6 +698,7 @@ type DiskSource struct { Name string `xml:"name,attr,omitempty"` Host *DiskSourceHost `xml:"host,omitempty"` Reservations *Reservations `xml:"reservations,omitempty"` + Slices []Slice `xml:"slices,omitempty"` } type DiskTarget struct {