mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-10-29 17:58:36 +08:00
fix set migrate capability, fix resize fs catch error
This commit is contained in:
@@ -558,7 +558,7 @@ func (m *QmpMonitor) MigrateSetCapability(capability, state string, callback Str
|
||||
}
|
||||
|
||||
cmd := &Command{
|
||||
Execute: "query-migrate-capabilities",
|
||||
Execute: "migrate-set-capabilities",
|
||||
Args: map[string]interface{}{
|
||||
"capabilities": []interface{}{
|
||||
map[string]interface{}{
|
||||
|
||||
@@ -118,6 +118,17 @@ func (d *SBaseDisk) DeployGuestFs(diskPath string, guestDesc *jsonutils.JSONDict
|
||||
return guestfs.DeployGuestFs(root, guestDesc, deployInfo)
|
||||
}
|
||||
|
||||
func (d *SBaseDisk) ResizeFs(diskPath string) error {
|
||||
disk := NewKVMGuestDisk(diskPath)
|
||||
if disk.Connect() {
|
||||
defer disk.Disconnect()
|
||||
if err := disk.ResizePartition(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (d *SBaseDisk) GetDiskSetupScripts(diskIndex int) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
@@ -132,24 +132,11 @@ func (d *SLocalDisk) Resize(ctx context.Context, params interface{}) (jsonutils.
|
||||
// d.Fallocate()
|
||||
}
|
||||
|
||||
if err = d.ResizeFs(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
d.ResizeFs(d.GetPath())
|
||||
|
||||
return d.GetDiskDesc(), nil
|
||||
}
|
||||
|
||||
func (d *SLocalDisk) ResizeFs() error {
|
||||
disk := NewKVMGuestDisk(d.GetPath())
|
||||
if disk.Connect() {
|
||||
defer disk.Disconnect()
|
||||
if err := disk.ResizePartition(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (d *SLocalDisk) CreateFromImageFuse(ctx context.Context, url string) error {
|
||||
log.Infof("Create from image fuse %s", url)
|
||||
|
||||
|
||||
@@ -111,24 +111,10 @@ func (d *SRBDDisk) Resize(ctx context.Context, params interface{}) (jsonutils.JS
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if err := d.ResizeFs(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
d.ResizeFs(d.GetPath())
|
||||
return d.GetDiskDesc(), nil
|
||||
}
|
||||
|
||||
func (d *SRBDDisk) ResizeFs() error {
|
||||
disk := NewKVMGuestDisk(d.GetPath())
|
||||
if disk.Connect() {
|
||||
defer disk.Disconnect()
|
||||
if err := disk.ResizePartition(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (d *SRBDDisk) PrepareSaveToGlance(ctx context.Context, params interface{}) (jsonutils.JSONObject, error) {
|
||||
if err := d.Probe(); err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user