On 2013-3-29 15:45, whuang wrote:

On 29/03/13 15:35, Yu Mingfei wrote:
On 03/29/2013 02:32 PM, whuang wrote:
Sorry I did not consider old libvirt ,Should we need support the old libvirt ? it will need add a lot of check .... :<
maybe need another branch to support old version ?


Thanks I will check it
About option's check(--config, --persistent , etc.), you can use
virsh.has_command_help_match(command, option) function. If the option doesn't exist in current libvirt version , it will return false, and you can put this test case into negative_test...For example:
if not virsh.has_command_help_match("change-media", "--config"):
status_error = "yes"

Here I just want to share my poor experience with you, I will be glad if it's helpful I for you..
Not a big deal. :)
If you just want to focus on new libvirt, it is ok.
But raise a TestNAError will be good for tester, because we still have some tests on RHEL5. And even on RHEL6.3, the libvirt version is v0.9.10(do not support --config).


On 28/03/13 19:31, Yu Mingfei wrote:
On 03/28/2013 06:04 PM, Yu Mingfei wrote:
+ cmd_options = "--force "
+ if os.system(cmd):
+ logging.error("Create update_iso_xml failed!")
+
+ if options == "--config" or start_vm == "no":
+ cmd_options += " --config"
+
+ #give domain the ISO image file
+ virsh.update_device(domainarg=vm_name, \
+ filearg=update_iso_xml, flagstr=cmd_options)

Aha, I know the reason now...
It seemed that you did not consider older libvirt.
I ran failed on v0.9.10 because 'update-device' do not support '--config'. :-(

v0.9.10
NAME
update-device - update device from an XML file

SYNOPSIS
update-device <domain> <file> [--persistent] [--force]

DESCRIPTION
Update device from an XML <file>.

OPTIONS
[--domain] <string> domain name, id or uuid
[--file] <string> XML file
--persistent persist device update
--force force device update

v0.9.11
NAME
update-device - update device from an XML file

SYNOPSIS
update-device <domain> <file> [--config] [--force]

DESCRIPTION
Update device from an XML <file>.

OPTIONS
[--domain] <string> domain name, id or uuid
[--file] <string> XML file
--config affect next boot
--force force device update

Thansk~
Yu




--
Regards,
--------------------------------------------------
Li Yang
No. 6 Wenzhu Road, Nanjing, 210012, China
TEL:+86+25-86630566-8526
FUJITSU INTERNAL:7998-8526
FAX:+86+25-83317685
EMail:[email protected]
--------------------------------------------------
This communication is for use by the intended recipient(s) only and may contain 
information that is privileged, confidential and exempt from disclosure under 
applicable law. If you are not an intended recipient of this communication, you 
are hereby notified that any dissemination, distribution or copying hereof is 
strictly prohibited.  If you have received this communication in error, please 
notify me by reply e-mail, permanently delete this communication from your 
system, and destroy any hard copies you may have printed



_______________________________________________
Virt-test-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-test-devel

Reply via email to