You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Warnf("Unsupported image format %q. The image may not boot, or may have an extra privilege to access the host filesystem. Use with caution.", info.Format)
121
+
}
122
+
ifinfo.BackingFilename!="" {
123
+
returnfmt.Errorf("base disk (%q) must not have a backing file (%q)", info.Filename, info.BackingFilename)
52
124
}
53
-
imgInfo, err:=GetInfo(f)
54
-
iferr!=nil {
55
-
return"", err
125
+
ifinfo.FullBackingFilename!="" {
126
+
returnfmt.Errorf("base disk (%q) must not have a backing file (%q)", info.Filename, info.FullBackingFilename)
56
127
}
57
-
ifimgInfo.Format=="" {
58
-
return"", fmt.Errorf("failed to detect format of %q", f)
128
+
ifinfo.FormatSpecific!=nil {
129
+
ifvmdk:=info.FormatSpecific.Vmdk(); vmdk!=nil {
130
+
for_, e:=rangevmdk.Extents {
131
+
ife.Filename!=info.Filename {
132
+
returnfmt.Errorf("base disk (%q) must not have an extent file (%q)", info.Filename, e.Filename)
133
+
}
134
+
}
135
+
}
59
136
}
60
-
returnimgInfo.Format, nil
137
+
// info.Children is set since QEMU 8.0
138
+
switchlen(info.Children) {
139
+
case0:
140
+
// NOP
141
+
case1:
142
+
ifinfo.Filename!=info.Children[0].Info.Filename {
143
+
returnfmt.Errorf("base disk (%q) child must not have a different filename (%q)", info.Filename, info.Children[0].Info.Filename)
144
+
}
145
+
iflen(info.Children[0].Info.Children) >0 {
146
+
returnfmt.Errorf("base disk (%q) child must not have children of its own", info.Filename)
147
+
}
148
+
default:
149
+
returnfmt.Errorf("base disk (%q) must not have multiple children: %+v", info.Filename, info.Children)
0 commit comments