On 01/04/2013 10:25 PM, Guannan Ren wrote:
On 01/05/2013 04:24 AM, Eric Blake wrote:
> Overall it looks reasonable, but depending on the answer to whether we
> should just always output type='isa-serial', you may have a v2 to submit.
>
As attribute 'type' is optional, my initial thoughts is that If
type='value' is given
explicitly on input, then we print it out on output too, if no type
is given on input,
we don't print it out on output either. Backward compatibility and
being more flexible.
Backward compatibility says that we must never fail to parse an older
XML that used to be valid (therefore, the new attribute must be optional
on input, and have a sane default when omitted). But it does not
require that we cannot output more information than was provided on
input (for example, we compute and output <address> elements for many
devices, even when not present on input). Older code already has to be
prepared to ignore attributes and elements that get output by newer
libvirt. If having that information makes the output more legible, then
I think it is worth always outputting the information by default.
There are indeed a number of testcases we need to modify if we
always output
type='isa-serial', but not a big workload.
Then I think it's better to always output type='isa-serial' even when
the input omitted it. Anyone else with an opinion?
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org