From patchwork Tue Jun 22 09:29:28 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 107363 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o5M9TZO8006257 for ; Tue, 22 Jun 2010 09:29:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758982Ab0FVJ3d (ORCPT ); Tue, 22 Jun 2010 05:29:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:30127 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758962Ab0FVJ3c (ORCPT ); Tue, 22 Jun 2010 05:29:32 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5M9TVtJ031763 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 22 Jun 2010 05:29:31 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5M9TTgK025261; Tue, 22 Jun 2010 05:29:30 -0400 Received: from file.tlv.redhat.com (file.tlv.redhat.com [10.35.255.8]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id 3988E2500C5; Tue, 22 Jun 2010 12:29:29 +0300 (IDT) From: Avi Kivity To: autotest@test.kernel.org, kvm@vger.kernel.org Subject: [PATCH KVM-AUTOTEST] KVM test: generate netdev ids that newer qemu can consume Date: Tue, 22 Jun 2010 12:29:28 +0300 Message-Id: <1277198968-13362-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 22 Jun 2010 09:29:35 +0000 (UTC) diff --git a/client/tests/kvm/kvm_utils.py b/client/tests/kvm/kvm_utils.py index 12508b6..0372565 100644 --- a/client/tests/kvm/kvm_utils.py +++ b/client/tests/kvm/kvm_utils.py @@ -815,6 +815,12 @@ def generate_random_string(length): length -= 1 return str +def generate_random_id(): + """ + Return a random string suitable for use as a qemu id. + """ + return "id" + generate_random_string(6) + def generate_tmp_file_name(file, ext=None, dir='/tmp/'): """ diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index 0643bca..966fb3c 100755 --- a/client/tests/kvm/kvm_vm.py +++ b/client/tests/kvm/kvm_vm.py @@ -119,7 +119,7 @@ class VM: self.address_cache = address_cache self.netdev_id = [] for nic in params.get("nics").split(): - self.netdev_id.append(kvm_utils.generate_random_string(4)) + self.netdev_id.append(kvm_utils.generate_random_id()) # Find a unique identifier for this VM while True: