qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v15 8/9] Implement new driver for block replicat


From: Changlong Xie
Subject: Re: [Qemu-devel] [PATCH v15 8/9] Implement new driver for block replication
Date: Wed, 9 Mar 2016 18:35:01 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

On 03/05/2016 01:53 AM, Stefan Hajnoczi wrote:
On Fri, Feb 05, 2016 at 12:18:07PM +0800, Changlong Xie wrote:
+static void secondary_do_checkpoint(BDRVReplicationState *s, Error **errp)
+{
+    Error *local_err = NULL;
+    int ret;
+
+    if (!s->secondary_disk->bs->job) {
+        error_setg(errp, "Backup job was cancelled unexpectedly");
+        return;
+    }

Do you have test cases for the replication driver?

This error code path seems like something that should be exercised to
make sure it works.

Basic start/checkpoint/stop and checks that the active/secondary/hidden
disks contain the expected data are also important.

Probably the easiest way to do this would be a file called
tests/test-replication.c that calls start/checkpoint/stop and read/write
functions directly instead of running a guest.


Hi Stefan

I'm working on the testcase now, and encount some issues.

Replication is different from other block drivers, we just use it for COLO live migration what means "primary" and "secondary" *MUST*
co-work with each other.

(1)
There are two test "prototype":
1 "COLO prototype":
simulate COLO environment, run two guests at the same time and setup nbd on both 'primary'/'secondary' side.

2 "Separate prototype"
    test relevant APIs in separate 'primary'/'secondary' mode, so we
don't need run two guests and setup nbd on both side

I prefer *"Separate prototype"*. Which one do you prefer?

(2)
Since we have replication_(start/stop/do_checkpoint/get_error)_all APIs, i know how to test start/checkpoint/stop/get_error callbacks.

But I'm confused about how to test read/write of replication, are there some ready-made APIs for qemu test system?

I know, for interpreted languages, we can use:
 $QEMU_IO -s -c "read 0 $size" "$TEST_IMG"
 $QEMU_IO -s -c "write -P 0xa 0 $size" "$TEST_IMG"

Also are some APIs to check disks contents(we need check active/secondary/hidden disk contents)?

Thanks
        -Xie





reply via email to

[Prev in Thread] Current Thread [Next in Thread]