Bug 1753873
| Summary: | The API for creating a domain checkpoint is missing | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux Advanced Virtualization | Reporter: | Dan Zheng <dzheng> |
| Component: | perl-Sys-Virt | Assignee: | Daniel Berrangé <berrange> |
| Status: | CLOSED ERRATA | QA Contact: | Dan Zheng <dzheng> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 8.1 | CC: | xuzhang |
| Target Milestone: | rc | Keywords: | Automation |
| Target Release: | 8.1 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | perl-Sys-Virt-6.0.0-1.module+el8.2.0+5488+267def79 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2020-05-05 09:49:41 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
commit efbab8fe0275528ab1652476f7be1b86952f5edb
Author: Daniel P. Berrangé <berrange>
Date: Tue Dec 10 13:02:30 2019 +0000
Add missing create_checkpoint method
Reviewed-by: Michal Privoznik <mprivozn>
Signed-off-by: Daniel P. Berrangé <berrange>
Package:
1. Check codes and the API exists.
# cat lib/Sys/Virt/Domain.pm
...
=item $checkpoint = $dom->create_checkpoint($xml[, $flags])
Create a new checkpoint from the C<$xml>. The C<$flags> parameter accepts
the B<CHECKPOINT CREATION> constants listed in C<Sys::Virt::DomainCheckpoints>.
=cut
sub create_checkpoint {
my $self = shift;
my $xml = shift;
my $flags = shift;
my $checkpoint = Sys::Virt::DomainCheckpoint->_new(domain => $self, xml => $xml, flags => $flags);
return $checkpoint;
}
2. Test in libvirt-tck
Guest xml is with below setting which is a workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1799015#c2
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
...
<qemu:capabilities>
<qemu:add capability='incremental-backup'/>
</qemu:capabilities>
</domain>
my @namelist = ("checkpoint1", "checkpoint2", "checkpoint3");
my $cp_xml;
foreach my $chpname (@namelist) {
$cp_xml = <<EOF;
<domaincheckpoint>
<name>$chpname</name>
<description>Test checkpoint creation for tck domain</description>
<disks>
<disk name='vda' checkpoint='bitmap'/>
</disks>
</domaincheckpoint>
EOF
ok_domain_checkpoint(sub {$dom->create_checkpoint($cp_xml, 0) }, "Domain checkpoint '$chpname' created");
}
Test result:
ok 1 - Domain checkpoint 'checkpoint1' created
ok 2 - Domain checkpoint 'checkpoint2' created
ok 3 - Domain checkpoint 'checkpoint3' created
Package under test: perl-Sys-Virt-6.0.0-1.module+el8.2.0+5488+267def79.x86_64 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:2017 |
Description of problem: The API for creating a domain checkpoint is missing Version-Release number of selected component (if applicable): perl-Sys-Virt-5.6.0-2.module+el8.1.0+4140+e3893fe6.x86_64 How reproducible: 100% Steps to Reproduce: 1. By inspecting codes in lib/Sys/Virt/Domain.pm, it seems the API to create checkpoint is missing. There should be a similar API like $dom_>create_checkpoint($xml[, $flags]) provided. The implementation in lib/Sys/Virt/DomainCheckpoint.pm has already be ready. =item $snapshot = $dom->create_snapshot($xml[, $flags]) Create a new snapshot ... =cut sub create_snapshot { my $self = shift; ... my $snapshot = Sys::Virt::DomainSnapshot->_new(domain => $self, xml => $xml, flags => $flags); return $snapshot; } =item my @checkpoints = $dom->list_all_checkpoints($flags) Return a list of all domain checkpoints associated with this domain. The elements in the returned list are instances of the L<Sys::Virt::DomainCheckpoint> class. The C<$flags> parameter can be used to filter the list of return domain checkpoints. =item my $checkpoint = $dom->get_checkpoint_by_name($name) Return the domain checkpoint with a name of C<$name>. The returned object is an instance of the L<Sys::Virt::DomainCheckpoint> class. 2. 3. Actual results: See above Expected results: Similar API is provided. $dom_>create_checkpoint($xml[, $flags]) Additional info: