qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: qemu-devel@nongnu.org
Cc: Juan Quintela <quintela@redhat.com>,
	"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
	peterx@redhat.com
Subject: [Qemu-devel] [PATCH for-3.0 4/4] tests: torture release-ram in postcopy test
Date: Mon, 23 Jul 2018 20:33:05 +0800	[thread overview]
Message-ID: <20180723123305.24792-5-peterx@redhat.com> (raw)
In-Reply-To: <20180723123305.24792-1-peterx@redhat.com>

The release-ram capability will run some extra code for postcopy to
release used ram right away, let's just turn that on for the postcopy
unix test always to torture that code path too to make sure release-ram
feature won't break again.  The recovery test needs to turn that off
since release-ram cannot coop with that.

Signed-off-by: Peter Xu <peterx@redhat.com>
---
 tests/migration-test.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/tests/migration-test.c b/tests/migration-test.c
index e079e0bdb6..deaec431fe 100644
--- a/tests/migration-test.c
+++ b/tests/migration-test.c
@@ -572,8 +572,9 @@ static void test_deprecated(void)
 }
 
 static int migrate_postcopy_prepare(QTestState **from_ptr,
-                                     QTestState **to_ptr,
-                                     bool hide_error)
+                                    QTestState **to_ptr,
+                                    bool hide_error,
+                                    bool release_ram)
 {
     char *uri = g_strdup_printf("unix:%s/migsocket", tmpfs);
     QTestState *from, *to;
@@ -582,6 +583,10 @@ static int migrate_postcopy_prepare(QTestState **from_ptr,
         return -1;
     }
 
+    if (release_ram) {
+        migrate_set_capability(from, "release-ram", "true");
+    }
+
     migrate_set_capability(from, "postcopy-ram", "true");
     migrate_set_capability(to, "postcopy-ram", "true");
     migrate_set_capability(to, "postcopy-blocktime", "true");
@@ -625,7 +630,7 @@ static void test_postcopy(void)
 {
     QTestState *from, *to;
 
-    if (migrate_postcopy_prepare(&from, &to, false)) {
+    if (migrate_postcopy_prepare(&from, &to, false, true)) {
         return;
     }
     migrate_postcopy_start(from, to);
@@ -637,7 +642,8 @@ static void test_postcopy_recovery(void)
     QTestState *from, *to;
     char *uri;
 
-    if (migrate_postcopy_prepare(&from, &to, true)) {
+    /* The release-ram feature cannot work with postcopy recovery. */
+    if (migrate_postcopy_prepare(&from, &to, true, false)) {
         return;
     }
 
-- 
2.17.1

  parent reply	other threads:[~2018-07-23 12:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-23 12:33 [Qemu-devel] [PATCH for-3.0 0/4] migration: some fixes for release-ram Peter Xu
2018-07-23 12:33 ` [Qemu-devel] [PATCH for-3.0 1/4] migration: update recv bitmap only on dest vm Peter Xu
2018-07-24  9:20   ` Juan Quintela
2018-07-23 12:33 ` [Qemu-devel] [PATCH for-3.0 2/4] migration: disallow recovery for release-ram Peter Xu
2018-07-24  9:21   ` Juan Quintela
2018-07-24 11:39     ` Peter Xu
2018-07-23 12:33 ` [Qemu-devel] [PATCH for-3.0 3/4] tests: only update last_byte when at the edge Peter Xu
2018-07-24  9:23   ` Juan Quintela
2018-07-23 12:33 ` Peter Xu [this message]
2018-07-24  9:25   ` [Qemu-devel] [PATCH for-3.0 4/4] tests: torture release-ram in postcopy test Juan Quintela
2018-07-24 11:36     ` Peter Xu
2018-07-24 11:42       ` Dr. David Alan Gilbert
2018-07-24 11:52         ` Peter Xu
2018-07-24 16:22 ` [Qemu-devel] [PATCH for-3.0 0/4] migration: some fixes for release-ram Dr. David Alan Gilbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180723123305.24792-5-peterx@redhat.com \
    --to=peterx@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).