Skip to content

Conversation

gaborigloi
Copy link
Contributor

@gaborigloi gaborigloi commented May 22, 2017

  • Deprecate the crashdump XenAPI class
  • Remove dead code and duplicated functions. (We don't really use this XenAPI class anyway.)

There is no crashdump.create API call, so it's fine to remove this
function.

Signed-off-by: Gabor Igloi <gabor.igloi@citrix.com>
Use an equivalent one from Helpers instead.

Signed-off-by: Gabor Igloi <gabor.igloi@citrix.com>
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.001%) to 13.989% when pulling 7c46f1b on gaborigloi:xapi_crashdump_cleanup into d5b7b6b on xapi-project:master.


let nothrow f () = try f() with _ -> ()

let create ~__context ~vM ~vDI =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we leave the create function here in case it's needed in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They can still find it in the git history though, and @jonludlam said that this API class isn't really used anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed it because I would have to add a check to it, but realized it's unused, removing these function saves use time I think, because we don't have to consider them when we make changes.

Db.Crashdump.create ~__context ~ref:cdumpref ~uuid ~vM ~vDI ~other_config:[];
cdumpref

let destroy ~__context ~self =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do we use this? Can't we just move the function in an helper module and get rid of this module altogether?

Copy link
Contributor Author

@gaborigloi gaborigloi May 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a XenAPI call, crashdump.destroy: https://xapi-project.github.io/xen-api/classes/crashdump.html,
so I think it's best to stick to the existing conventions and keep this file.

Copy link
Contributor

@mseri mseri May 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then let's deprecate the whole class! 🗑️
Also have a look at the use of host_crashdump but I think that cannot be deprecated yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, but I think we can still merge this PR, as we can't just delete the whole class and its associated code right away, but this is still a useful cleanup in the meantime?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the deprecation of the Crashdump class to this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, I'll add that!:)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mseri I think we first need to add the next release (inverness?) to the datamodel, before we can deprecate this class?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robhoes knows

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

@gaborigloi gaborigloi changed the title Xapi_crashdump.ml cleanup "crashdump" cleanup May 25, 2017
@gaborigloi gaborigloi changed the title "crashdump" cleanup Clean up & deprecate crashdump May 25, 2017
@gaborigloi gaborigloi force-pushed the xapi_crashdump_cleanup branch from 6ca1f43 to 3c23886 Compare May 25, 2017 17:12
@coveralls
Copy link

Coverage Status

Coverage increased (+0.008%) to 14.129% when pulling 3c23886 on gaborigloi:xapi_crashdump_cleanup into ab5bca8 on xapi-project:master.

version_minor = 7;
branding = "XenServer 7.2";
}; {
code_name = Some rel_inverness;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if you put None here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think None here is for things that do not have a codename, but Inverness does.

Copy link
Contributor Author

@gaborigloi gaborigloi May 26, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another option is to simply not add Inverness to release_order_full yet, and add it later. But maybe that would confuse the SDK or something.

Copy link
Contributor

@mseri mseri May 26, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's worth trying

Copy link

@kc284 kc284 May 26, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please leave the same version numbers as falcon and use Unreleased for the branding. We'll bump it when we know the actual number.
This is basically the same we were doing before, it's just that now all these variables are in one place.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it's probably worth adding a comment at the beginning of this list with this tip for future reference.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kc284 How about a comment like this:
(* For future XenServer versions, use the version number of the latest release, and "Unreleased" for the branding. *)

Copy link

@kc284 kc284 May 26, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather make it more explicit and less xenserver-centric: "When you add a new release, use .... until the actual values are finalised".

Signed-off-by: Gabor Igloi <gabor.igloi@citrix.com>
Signed-off-by: Gabor Igloi <gabor.igloi@citrix.com>
Signed-off-by: Gabor Igloi <gabor.igloi@citrix.com>
@gaborigloi gaborigloi force-pushed the xapi_crashdump_cleanup branch from 3c23886 to caa15cd Compare May 26, 2017 11:17
@coveralls
Copy link

Coverage Status

Coverage increased (+0.008%) to 14.129% when pulling caa15cd on gaborigloi:xapi_crashdump_cleanup into ab5bca8 on xapi-project:master.

@robhoes robhoes merged commit bef7f64 into xapi-project:master May 30, 2017
@gaborigloi gaborigloi deleted the xapi_crashdump_cleanup branch June 8, 2017 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants