State is a gateway to the two main stateful components of LXD, the database and the operating system. It's typically used by model entities such as containers, volumes, etc. in order to perform changes.
NewState returns a new State object with the given database and operating system components.
NewTestState returns a State object initialized with testable instances of the node/cluster databases and of the OS facade.
Return the newly created State object, along with a function that can be used for cleaning it up.