From nobody Sun Nov 24 16:35:58 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1722508626; cv=none; d=zohomail.com; s=zohoarc; b=kYAZokjey6zITB4CYqFikcS0Zcd8gTJCRlhKhPNPwIDdm8S9oW7tXpVhtfPSc64ydPi6RRYkpHTseTbDv5MtuhY3dGPp/8M5B0PPlznWgl3DtKyuyQ3OewnDq+mYI3nmQozgD/2W1zmaQhlE7sjbbaw+M0jKZZbnOwg8OJEtAGY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722508626; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+Wj9jvYkwctqz/9QIPv8Y88E3joIG5eue0pkA+KNkvE=; b=jLN4DqDT/4jh8X57zh7JGMfmP+W/+DZcM/7OG9RcM2nLzuzqmLFCiNYnmSWUyGkFtryHXd9u8YjWJjOYE+xnOogCnEdG2S6coLcaE8eGl5MaSm53MjpJXBYHkUt6257+7jExDOU9FNIQUCcd6Q/JWwtUFLolWZy0qpYegB+cPvk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722508626243126.82264231456168; Thu, 1 Aug 2024 03:37:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZT9p-0001fS-7T; Thu, 01 Aug 2024 06:35:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZT9n-0001ej-Mu for qemu-devel@nongnu.org; Thu, 01 Aug 2024 06:35:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZT9m-0001Oj-9n for qemu-devel@nongnu.org; Thu, 01 Aug 2024 06:35:39 -0400 Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-468-Vq0s2RrZMf6defh1NbuEnA-1; Thu, 01 Aug 2024 06:35:36 -0400 Received: by mail-lf1-f69.google.com with SMTP id 2adb3069b0e04-52f00bde29dso8982687e87.3 for ; Thu, 01 Aug 2024 03:35:36 -0700 (PDT) Received: from redhat.com ([2.55.44.248]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7acad4a188sm880835066b.134.2024.08.01.03.35.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Aug 2024 03:35:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1722508537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+Wj9jvYkwctqz/9QIPv8Y88E3joIG5eue0pkA+KNkvE=; b=F1D6HVMIs0Bw6Bj6lOrSV0L8ooQgJ8IXZAwDrBYKdwNqjbd3eqvmTXnsXl2apRYahxABkv dOuVFHlmWEdO+E4Hxz6LXz53pwx4/0ln4DMwpj51O3PR8PhZhZyMIr2BYLnVOj91u2uh9U GobdXawFTidiD6N+5vP6RLB8zfZLgPc= X-MC-Unique: Vq0s2RrZMf6defh1NbuEnA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722508534; x=1723113334; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+Wj9jvYkwctqz/9QIPv8Y88E3joIG5eue0pkA+KNkvE=; b=ZDbhBSZ/Yx3kpdYQkZ8JZ0Pfzfg546rRe+D/00njTVFs+oYi+xcvwwVMTmw3Y9d03T +/GxK31lcn/LPTez0WiZeriOz5xEm44MfRKHhpjCGCstRZ16hlVVTd1EMx13W8N/mKy6 QGP7e3Q8FQrHZlhRe+KBGSM6uiXaSg46j4QT8x/g9xUE3or5hNLP1T92Zbhcbf+DMZw0 5lQ6hGjvO3PRJkapdCY5K91INj6QZSGzHkgcm95vs+Cyzq4rnMlv4JPxpHYiFYSGAItj GrTTSLZT9E9jzAycjT74BdgeR5bTNYzFstwjfLaZ9WN1ZfiypXghFLAptVq+CLW5yaHp Cg5A== X-Gm-Message-State: AOJu0YwTyCE27Pqeb27HlCBeLL+FpCMiHY3XFnFxR4+sc1zn5+223JWJ BCc4ITWJV/FVLrfhQ0gvcyPNnxG5Oi9PABrehLR6daApwICzIhaL0881ACUZOua+6dqdHod+hLK TJEaoFMVy2tLiHCFFnu35v2p+2n3IMZVraVd+TccxhIc+YhcLdVzrGRXOcNZebiXr/9TOQ1AcTw cHocMxtQnjoau0esDM5KriDOl1jUdO8g== X-Received: by 2002:a2e:9ad6:0:b0:2ef:29cd:3191 with SMTP id 38308e7fff4ca-2f1533999b0mr18871271fa.35.1722508534242; Thu, 01 Aug 2024 03:35:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHvxQzX0PQfR0fBq9sA8VK3QO61hJaW0B3vbhwcp+54qgAjq+YdGlBGK4cBBgnOQkksgMmXKA== X-Received: by 2002:a2e:9ad6:0:b0:2ef:29cd:3191 with SMTP id 38308e7fff4ca-2f1533999b0mr18868141fa.35.1722508525365; Thu, 01 Aug 2024 03:35:25 -0700 (PDT) Date: Thu, 1 Aug 2024 06:35:14 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Laurent Vivier , Amit Shah Subject: [PULL 01/19] virtio-rng: block max-bytes=0 Message-ID: <024d046bf41b5256adec671085bcee767a6da125.1722508478.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.126, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1722508627482116600 with max-bytes set to 0, quota is 0 and so device does not work. block this to avoid user confusion Message-Id: <73a89a42d82ec8b47358f25119b87063e4a6ea57.1721818306.git.mst@re= dhat.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/virtio/virtio-rng.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c index f74efffef7..7cf31da071 100644 --- a/hw/virtio/virtio-rng.c +++ b/hw/virtio/virtio-rng.c @@ -184,8 +184,9 @@ static void virtio_rng_device_realize(DeviceState *dev,= Error **errp) =20 /* Workaround: Property parsing does not enforce unsigned integers, * So this is a hack to reject such numbers. */ - if (vrng->conf.max_bytes > INT64_MAX) { - error_setg(errp, "'max-bytes' parameter must be non-negative, " + if (vrng->conf.max_bytes =3D=3D 0 || + vrng->conf.max_bytes > INT64_MAX) { + error_setg(errp, "'max-bytes' parameter must be positive, " "and less than 2^63"); return; } --=20 MST