Bug 1753873 - The API for creating a domain checkpoint is missing
Summary: The API for creating a domain checkpoint is missing
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: perl-Sys-Virt
Version: 8.1
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: 8.1
Assignee: Daniel Berrangé
QA Contact: Dan Zheng
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-09-20 06:30 UTC by Dan Zheng
Modified: 2020-05-05 09:50 UTC (History)
1 user (show)

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:
Clone Of:
Environment:
Last Closed: 2020-05-05 09:49:41 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:2017 0 None None None 2020-05-05 09:50:27 UTC

Description Dan Zheng 2019-09-20 06:30:28 UTC
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:

Comment 1 Daniel Berrangé 2019-12-11 10:48:23 UTC
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>

Comment 3 Dan Zheng 2020-03-09 09:57:02 UTC
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

Comment 4 Dan Zheng 2020-03-09 09:58:27 UTC
Package under test: perl-Sys-Virt-6.0.0-1.module+el8.2.0+5488+267def79.x86_64

Comment 6 errata-xmlrpc 2020-05-05 09:49:41 UTC
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


Note You need to log in before you can comment on or make changes to this bug.