-
Notifications
You must be signed in to change notification settings - Fork 4
Update for a docker driver #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15800,7 +15800,7 @@ type IAdditionsFacility struct { | |
| } | ||
|
|
||
| type IMediumAttachment struct { | ||
| XMLName xml.Name `xml:"http://www.virtualbox.org/ IMediumAttachment"` | ||
| // XMLName xml.Name `xml:"http://www.virtualbox.org/ IMediumAttachment"` | ||
|
|
||
| Medium string `xml:"medium,omitempty"` | ||
| Controller string `xml:"controller,omitempty"` | ||
|
|
@@ -20347,6 +20347,8 @@ func (service *VboxPortType) IMachinegetMedium(request *IMachinegetMedium) (*IMa | |
| // - InvalidObjectFault | ||
| // - RuntimeFault | ||
|
|
||
| type Returnval *IMediumAttachment | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you explain this? It seems unused.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remnant of troubleshooting. |
||
|
|
||
| func (service *VboxPortType) IMachinegetMediumAttachmentsOfController(request *IMachinegetMediumAttachmentsOfController) (*IMachinegetMediumAttachmentsOfControllerResponse, error) { | ||
| response := new(IMachinegetMediumAttachmentsOfControllerResponse) | ||
| err := service.client.Call("", request, response) | ||
|
|
@@ -33330,17 +33332,20 @@ func (s *SOAPClient) Call(soapAction string, request, response interface{}) erro | |
| encoder := xml.NewEncoder(buffer) | ||
| //encoder.Indent(" ", " ") | ||
|
|
||
| err := encoder.Encode(envelope) | ||
| if err == nil { | ||
| err = encoder.Flush() | ||
| if err := encoder.Encode(envelope); err != nil { | ||
| return err | ||
| } | ||
|
|
||
| log.Println(buffer.String()) | ||
| if err != nil { | ||
| if err := encoder.Flush(); err != nil { | ||
| return err | ||
| } | ||
|
|
||
| // log.Println(buffer.String()) | ||
|
|
||
| req, err := http.NewRequest("POST", s.url, buffer) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| if s.auth != nil { | ||
| req.SetBasicAuth(s.auth.Login, s.auth.Password) | ||
| } | ||
|
|
@@ -33368,12 +33373,16 @@ func (s *SOAPClient) Call(soapAction string, request, response interface{}) erro | |
| defer res.Body.Close() | ||
|
|
||
| rawbody, err := ioutil.ReadAll(res.Body) | ||
| if err != nil { | ||
| return err | ||
| } | ||
|
|
||
| if len(rawbody) == 0 { | ||
| log.Println("empty response") | ||
| return nil | ||
| } | ||
|
|
||
| log.Println(string(rawbody)) | ||
| // log.Println(string(rawbody)) | ||
| respEnvelope := new(SOAPEnvelope) | ||
| respEnvelope.Body = SOAPBody{Content: response} | ||
| err = xml.Unmarshal(rawbody, respEnvelope) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| package virtualboxclient | ||
|
|
||
| type HardDisk struct { | ||
| virtualbox *VirtualBox | ||
| managedObjectId string | ||
| } | ||
|
|
||
| type HardDisks struct { | ||
| disks []*HardDisk | ||
| } | ||
|
|
||
| func (h *HardDisk) getMedium() *Medium { | ||
| return &Medium{virtualbox: h.virtualbox, managedObjectId: h.managedObjectId} | ||
| } | ||
|
|
||
| func isSet(value string) bool { | ||
| return value != "" | ||
| } | ||
|
|
||
| func (hs *HardDisks) GetMedium(objectID, name string) ([]*Medium, error) { | ||
| var ms []*Medium | ||
| for _, hardDisk := range hs.disks { | ||
| om := hardDisk.getMedium() | ||
| var m *Medium | ||
| if isSet(name) || isSet(objectID) { | ||
| var err error | ||
| m, err = om.GetIDName() | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| } | ||
|
|
||
| if isSet(name) && m.Name != name { | ||
| continue | ||
| } | ||
|
|
||
| if isSet(objectID) && m.ID != objectID { | ||
| continue | ||
| } | ||
|
|
||
| medium, err := om.Get() | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| ms = append(ms, medium) | ||
| } | ||
|
|
||
| return ms, nil | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you recall why you commented this out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup agree with your comment above for loglevel. This is necessary due to an error that was being returned. It was throwing a returnval error which seemed aligned to not parsing the information correctly.