From patchwork Tue Nov 12 03:59:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Clark Laughlin X-Patchwork-Id: 21452 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f200.google.com (mail-pd0-f200.google.com [209.85.192.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6B9D0202DA for ; Tue, 12 Nov 2013 03:59:23 +0000 (UTC) Received: by mail-pd0-f200.google.com with SMTP id w10sf11431794pde.7 for ; Mon, 11 Nov 2013 19:59:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=WdLEzZk15YZnvS0nfRPrJqWWxU22HQAD0sZ+ph4GXDs=; b=bnni3latUhNVN48tpg58qF29DenTsBFCc/bJ/xCHmBWZPkrOh0h1Or/9cfvEDxpgRP ukW00mEV9Ztx4cGmNmBfS+I7tvtZBD1B9WmDCgRMJPz8h5JrCuxwy7MvM3ibfWc+CkO2 8rbjybgXzswiKj7eMlNgHr67wjgaMe/xpvU8pRsYHcSePue4PFm/JHjzcZ7OYDL5wLK6 vgQ4Qq9wq+2JKaas2IGTqVUNFAb9ScmdfBMNIhMxB+PFgkORyodpZTRr/mZbTwHEzpUD iyFC03V2lKAJox5/G+qZHjGmz7PRgv+Cys6UtrfdkT6cUH16fEkN2+qxKQJ7yTnHtfaW LdLQ== X-Gm-Message-State: ALoCoQkXVX1jvdMSLf53smLarvb55Unv9LTPT7eHm/T5o98gH0TKr5gTH/2KhrBB8/tYO5kI4DN6 X-Received: by 10.66.161.40 with SMTP id xp8mr4856725pab.39.1384228762286; Mon, 11 Nov 2013 19:59:22 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.40.200 with SMTP id z8ls630139qek.47.gmail; Mon, 11 Nov 2013 19:59:22 -0800 (PST) X-Received: by 10.220.17.131 with SMTP id s3mr8129737vca.20.1384228762170; Mon, 11 Nov 2013 19:59:22 -0800 (PST) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id hr2si11061211vdb.115.2013.11.11.19.59.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 11 Nov 2013 19:59:21 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id lc6so265267vcb.30 for ; Mon, 11 Nov 2013 19:59:21 -0800 (PST) X-Received: by 10.58.210.66 with SMTP id ms2mr27317595vec.10.1384228761732; Mon, 11 Nov 2013 19:59:21 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp134804vcz; Mon, 11 Nov 2013 19:59:21 -0800 (PST) X-Received: by 10.180.12.179 with SMTP id z19mr14548089wib.24.1384228760752; Mon, 11 Nov 2013 19:59:20 -0800 (PST) Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) by mx.google.com with ESMTPS id t6si10945710wjq.89.2013.11.11.19.59.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 11 Nov 2013 19:59:20 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.169 is neither permitted nor denied by best guess record for domain of clark.laughlin@linaro.org) client-ip=209.85.212.169; Received: by mail-wi0-f169.google.com with SMTP id cb5so3193301wib.2 for ; Mon, 11 Nov 2013 19:59:20 -0800 (PST) X-Received: by 10.194.11.38 with SMTP id n6mr25599537wjb.25.1384228759962; Mon, 11 Nov 2013 19:59:19 -0800 (PST) Received: from localhost.localdomain (validation.linaro.org. [88.98.47.97]) by mx.google.com with ESMTPSA id qc10sm40244224wic.9.2013.11.11.19.59.18 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 11 Nov 2013 19:59:19 -0800 (PST) From: Clark Laughlin To: libvir-list@redhat.com Cc: patches@linaro.org, Clark Laughlin Subject: [PATCH] Add support for virt machine with virtio-mmio devices Date: Tue, 12 Nov 2013 03:59:02 +0000 Message-Id: <1384228742-18061-1-git-send-email-clark.laughlin@linaro.org> X-Mailer: git-send-email 1.8.3.2 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: clark.laughlin@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , These changes allow the correct virtio-blk-device and virtio-net-device devices to be used for the 'virt' machine type rather than the PCI virtio devices. --- src/qemu/qemu_command.c | 4 +++- src/qemu/qemu_domain.c | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 63e235d..901120e 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1335,12 +1335,14 @@ cleanup: return ret; } + static int qemuDomainAssignARMVirtioMMIOAddresses(virDomainDefPtr def, virQEMUCapsPtr qemuCaps) { if (def->os.arch == VIR_ARCH_ARMV7L && - STRPREFIX(def->os.machine, "vexpress-") && + (STRPREFIX(def->os.machine, "vexpress-") || + STREQ(def->os.machine, "virt")) && virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_MMIO)) { qemuDomainPrimeVirtioDeviceAddresses( def, VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO); diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 81d0ba9..346fec3 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -797,6 +797,9 @@ qemuDomainDefaultNetModel(const virDomainDef *def) if (STREQ(def->os.machine, "versatilepb")) return "smc91c111"; + if (STREQ(def->os.machine, "virt")) + return "virtio"; + /* Incomplete. vexpress (and a few others) use this, but not all * arm boards */ return "lan9118";