From patchwork Wed Apr 20 22:19:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 66259 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp2704982qge; Wed, 20 Apr 2016 15:22:28 -0700 (PDT) X-Received: by 10.140.30.10 with SMTP id c10mr14239673qgc.87.1461190948241; Wed, 20 Apr 2016 15:22:28 -0700 (PDT) Return-Path: Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com. [209.132.183.37]) by mx.google.com with ESMTPS id w9si57177967qhc.10.2016.04.20.15.22.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Apr 2016 15:22:28 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.37 as permitted sender) client-ip=209.132.183.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.37 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3KMJckL055659; Wed, 20 Apr 2016 18:19:39 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u3KMJbK5006488 for ; Wed, 20 Apr 2016 18:19:37 -0400 Received: from colepc.redhat.com (ovpn-113-99.phx2.redhat.com [10.3.113.99]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3KMJaqt006417; Wed, 20 Apr 2016 18:19:36 -0400 From: Cole Robinson To: libvirt-list@redhat.com Date: Wed, 20 Apr 2016 18:19:25 -0400 Message-Id: <00a8955fd5a9503464f0e6122c413cf4f260cf3f.1461190765.git.crobinso@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] conf: Drop restrictions on rng backend path X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com Currently we only allow /dev/random and /dev/hwrng as host input for device. This was added after various upstream discussions in commit 4932ef45 However this restriction has generated quite a few complaints over the years, so a new discussion was initiated: http://www.redhat.com/archives/libvir-list/2016-April/msg00987.html Several people suggested removing the restriction, and nobody really spoke up to defend it. So this patch drops the path restriction entirely https://bugzilla.redhat.com/show_bug.cgi?id=1074464 --- docs/formatdomain.html.in | 9 ++++----- docs/schemas/domaincommon.rng | 3 +-- src/conf/domain_conf.c | 8 -------- tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.xml | 2 +- tests/qemuxml2xmloutdata/qemuxml2xmlout-virtio-rng-random.xml | 2 +- 6 files changed, 8 insertions(+), 18 deletions(-) -- 2.7.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 895114b..132b261 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -6231,8 +6231,7 @@ qemu-kvm -net nic,model=? /dev/null model attribute. Supported source models are:

    -
  • 'random' — /dev/random (default) or /dev/hwrng - device as source (for now, no other sources are permitted)
  • +
  • 'random' — a character device backend
  • 'egd' — a EGD protocol backend
@@ -6240,9 +6239,9 @@ qemu-kvm -net nic,model=? /dev/null

This backend type expects a non-blocking character device as input. - The only accepted paths are /dev/random and /dev/hwrng. The file - name is specified as contents of the backend element. - When no file name is specified the hypervisor default is used. + The file name is specified as contents of the + backend element. When no file name is specified the + this defaults to /dev/random.

backend model='egd'
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 3605afe..c91a3a9 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -4691,8 +4691,7 @@ random - /dev/random - /dev/hwrng + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 28248c8..f9cd69c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -11512,14 +11512,6 @@ virDomainRNGDefParseXML(xmlNodePtr node, switch ((virDomainRNGBackend) def->backend) { case VIR_DOMAIN_RNG_BACKEND_RANDOM: def->source.file = virXPathString("string(./backend)", ctxt); - if (def->source.file && - STRNEQ(def->source.file, "/dev/random") && - STRNEQ(def->source.file, "/dev/hwrng")) { - virReportError(VIR_ERR_XML_ERROR, - _("file '%s' is not a supported random source"), - def->source.file); - goto error; - } break; case VIR_DOMAIN_RNG_BACKEND_EGD: diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.args b/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.args index ba97c1e..5a4d47b 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.args @@ -18,6 +18,6 @@ QEMU_AUDIO_DRV=none \ -boot c \ -usb \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ --object rng-random,id=objrng0,filename=/dev/hwrng \ +-object rng-random,id=objrng0,filename=/dev/urandom \ -device virtio-rng-pci,rng=objrng0,id=rng0,max-bytes=123,period=1234,bus=pci.0,\ addr=0x4 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.xml b/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.xml index 71bd21a..a6e91ff 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.xml @@ -21,7 +21,7 @@ - /dev/hwrng + /dev/urandom diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-virtio-rng-random.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-virtio-rng-random.xml index e8a0478..0bdefde 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-virtio-rng-random.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-virtio-rng-random.xml @@ -25,7 +25,7 @@ - /dev/hwrng + /dev/urandom