Newer qemu restricts identifiers to starting with a letter. Signed-off-by: Avi Kivity <avi@xxxxxxxxxx> --- client/tests/kvm/kvm_utils.py | 6 ++++++ client/tests/kvm/kvm_vm.py | 2 +- 2 files changed, 7 insertions(+), 1 deletions(-) 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: -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html