[Kimchi-devel] [PATCH 1/2] Add persistent flag to VM info
Aline Manera
alinefm at linux.vnet.ibm.com
Thu Aug 21 20:05:31 UTC 2014
On 08/21/2014 04:32 PM, Christy Perez wrote:
>
> On 08/21/2014 12:34 PM, Christy Perez wrote:
>>
>> On 08/21/2014 12:15 PM, Crístian Viana wrote:
>>> On 20-08-2014 19:43, Christy Perez wrote:
>>>> Kimchi can manage guests not created by Kimchi. If a user creates a
>>>> non-persistent domain and uses the Power Off option, it will destroy
>>>> the user's domain. In order to warn users with non-persistent guests
>>>> on Power Off, this patch adds a 'persistent' field (like the one for
>>>> networks and storage pools) to a vm's JSON representation.
>>>>
>>>> Signed-off-by: Christy Perez <christy at linux.vnet.ibm.com>
>>> This patch breaks the tests. Please run "sudo make check" and fix the
>>> errors.
>>> Other than fixing the test errors, please add a few specific tests for
>>> this property as well.
>> ACK. Thanks.
>>>> - 'access': 'full'
>>>> + 'access': 'full',
>>>> + 'persistent': True if dom.isPersistent() else False
>>> "'persistent': dom.isPersistent()" should do the same thing in a clearer
>>> way.
>> I'm pretty sure I had that first, and just got back '1'. I'll
>> double-check, though.
> Just to follow up here, changing it did result in '1' being output
> instead of 'true.' Since everything else uses 'true' or 'false', I'm
> going to leave this as-is.
You can use bool(dom.isPersistent())
>
> Here's a snip with just the result from dom.isPersistent():
> {
> "users":[],
>
> "screenshot":"/data/screenshots/79b8fe8b-4697-445c-aee5-3a781f27b61d-f113f739-0249-4913-afdd-5d7e662660f1.png",
> "cpus":1,
> "persistent":1,
> "groups":[],
> "graphics":{
> "type":"vnc",
> "port":5900,
> "listen":"0.0.0.0"
> },
>
>
> Regards,
>
> - Christy
>> _______________________________________________
>> Kimchi-devel mailing list
>> Kimchi-devel at ovirt.org
>> http://lists.ovirt.org/mailman/listinfo/kimchi-devel
>>
> _______________________________________________
> Kimchi-devel mailing list
> Kimchi-devel at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/kimchi-devel
>
More information about the Kimchi-devel
mailing list