[{"id":1758611,"web_url":"http://patchwork.ozlabs.org/comment/1758611/","msgid":"<20170828142728.GC18194@lemon.lan>","list_archive_url":null,"date":"2017-08-28T14:27:28","subject":"Re: [Qemu-devel] [PATCH v3] qemu crashes when a negative number\n\tused for 'maxcpus'","submitter":{"id":24872,"url":"http://patchwork.ozlabs.org/api/people/24872/","name":"Fam Zheng","email":"famz@redhat.com"},"content":"Hi Seeteena, thanks for sending the patch and fixing the coding style!\n\nI suggest to change subject to \"vl: exit if maxcpus is negative\". The subject of\na patch email is going to be the summary of the commit message when applied,\ntherefore it should be worded to summarize the change. Commonly there is a\n\"subsystem prefix\" followed by a colon, like \"vl:\", \"net:\". While there is no\nhard rule, the most suitable prefix can be guessed by inspecting the log of the\nchanged files. In the case of this patch: \"git log vl.c\".\n\nA more detailed guide on submitting \"perfect\" QEMU patches can be found here,\nin case for your future reference:\n\nhttps://wiki.qemu.org/Contribute/SubmitAPatch\n\nOn Mon, 08/28 19:23, Seeteena Thoufeek wrote:\n> ---Steps to Reproduce---\n> \n> When passed a negative number to 'maxcpus' parameter, Qemu aborts\n> with a core dump.\n> \n> Run the following command with maxcpus argument as negative number\n> \n> ppc64-softmmu/qemu-system-ppc64 --nographic -vga none -machine\n> pseries,accel=kvm,kvm-type=HV -m size=200g -device virtio-blk-pci,\n> drive=rootdisk -drive file=/home/images/pegas-1.0-ppc64le.qcow2,\n> if=none,cache=none,id=rootdisk,format=qcow2 -monitor telnet\n> :127.0.0.1:1234,server,nowait -net nic,model=virtio -net\n> user -redir tcp:2000::22 -device nec-usb-xhci -smp 8,cores=1,\n> threads=1,maxcpus=-12\n> \n> (process:12149): GLib-ERROR **: gmem.c:130: failed to allocate\n>  18446744073709550568 bytes\n> \n> Trace/breakpoint trap\n> \n> Reported-by: R.Nageswara Sastry <rnsastry@linux.vnet.ibm.com>\n> Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>\n> Reviewed-by: Bharata B Rao <bharata@linux.vnet.ibm.com>\n> ---\n\nWould be good if there is a comment below a \"---\" line on how current revision\ndiffers from the previous one, like:\n\n---\n\nv3: Fix coding style pointed out by patchew.\n\n\n>  vl.c | 5 ++++-\n>  1 file changed, 4 insertions(+), 1 deletion(-)\n> \n> diff --git a/vl.c b/vl.c\n> index 8e247cc..fb45b6d 100644\n> --- a/vl.c\n> +++ b/vl.c\n> @@ -1244,7 +1244,10 @@ static void smp_parse(QemuOpts *opts)\n>          }\n>  \n>          max_cpus = qemu_opt_get_number(opts, \"maxcpus\", cpus);\n> -\n> +        if (max_cpus <= 0) {\n> +            error_report(\"Invalid max_cpus : %d\", max_cpus);\n\nThe space before \":\" can be dropped, I think.\n\n> +            exit(1);\n> +        }\n>          if (max_cpus < cpus) {\n>              error_report(\"maxcpus must be equal to or greater than smp\");\n>              exit(1);\n> -- \n> 1.8.3.1\n> \n\nFam","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=famz@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xgvJ92FGBz9s7m\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 29 Aug 2017 00:28:09 +1000 (AEST)","from localhost ([::1]:40056 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dmL1L-0004qR-6M\n\tfor incoming@patchwork.ozlabs.org; Mon, 28 Aug 2017 10:28:07 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:41795)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dmL0w-0004q8-Td\n\tfor qemu-devel@nongnu.org; Mon, 28 Aug 2017 10:27:43 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dmL0s-0004YX-0s\n\tfor qemu-devel@nongnu.org; Mon, 28 Aug 2017 10:27:42 -0400","from mx1.redhat.com ([209.132.183.28]:28361)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <famz@redhat.com>)\n\tid 1dmL0r-0004YG-NF; Mon, 28 Aug 2017 10:27:37 -0400","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 5B6EDC056794;\n\tMon, 28 Aug 2017 14:27:36 +0000 (UTC)","from localhost (ovpn-12-121.pek2.redhat.com [10.72.12.121])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 2DBC667CE4;\n\tMon, 28 Aug 2017 14:27:29 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 5B6EDC056794","Date":"Mon, 28 Aug 2017 22:27:28 +0800","From":"Fam Zheng <famz@redhat.com>","To":"Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>","Message-ID":"<20170828142728.GC18194@lemon.lan>","References":"<1503928405-19960-1-git-send-email-s1seetee@linux.vnet.ibm.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<1503928405-19960-1-git-send-email-s1seetee@linux.vnet.ibm.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.32]);\n\tMon, 28 Aug 2017 14:27:36 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v3] qemu crashes when a negative number\n\tused for 'maxcpus'","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"pbonzini@redhat.com, qemu-ppc@nongnu.org, qemu-devel@nongnu.org","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1758614,"web_url":"http://patchwork.ozlabs.org/comment/1758614/","msgid":"<CAGZKiBoMUtEiaPiLEdeAUaWaAadk1s=VF8kAwc_QGHbUSQxdvw@mail.gmail.com>","list_archive_url":null,"date":"2017-08-28T14:40:13","subject":"Re: [Qemu-devel] [PATCH v3] qemu crashes when a negative number\n\tused for 'maxcpus'","submitter":{"id":1551,"url":"http://patchwork.ozlabs.org/api/people/1551/","name":"Bharata B Rao","email":"bharata.rao@gmail.com"},"content":"Seeteena,\n\nOn Mon, Aug 28, 2017 at 7:23 PM, Seeteena Thoufeek <\ns1seetee@linux.vnet.ibm.com> wrote:\n\n> ---Steps to Reproduce---\n>\n> When passed a negative number to 'maxcpus' parameter, Qemu aborts\n> with a core dump.\n>\n> Run the following command with maxcpus argument as negative number\n>\n> ppc64-softmmu/qemu-system-ppc64 --nographic -vga none -machine\n> pseries,accel=kvm,kvm-type=HV -m size=200g -device virtio-blk-pci,\n> drive=rootdisk -drive file=/home/images/pegas-1.0-ppc64le.qcow2,\n> if=none,cache=none,id=rootdisk,format=qcow2 -monitor telnet\n> :127.0.0.1:1234,server,nowait -net nic,model=virtio -net\n> user -redir tcp:2000::22 -device nec-usb-xhci -smp 8,cores=1,\n> threads=1,maxcpus=-12\n>\n> (process:12149): GLib-ERROR **: gmem.c:130: failed to allocate\n>  18446744073709550568 bytes\n>\n> Trace/breakpoint trap\n>\n> Reported-by: R.Nageswara Sastry <rnsastry@linux.vnet.ibm.com>\n> Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>\n> Reviewed-by: Bharata B Rao <bharata@linux.vnet.ibm.com>\n>\n\nIn the bugzilla, I was only suggesting to post the fix upstream and it\ndoesn't mean a Reviewed-by.  You might want to remove this in your next\nversion.\n\nRegards,\nBharata.","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"AGlGuH7I\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xgvZp3gHdz9sMN\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 29 Aug 2017 00:40:48 +1000 (AEST)","from localhost ([::1]:40123 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dmLDa-00005Q-Pp\n\tfor incoming@patchwork.ozlabs.org; Mon, 28 Aug 2017 10:40:46 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:44736)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <bharata.rao@gmail.com>) id 1dmLD7-0008Vg-IC\n\tfor qemu-devel@nongnu.org; Mon, 28 Aug 2017 10:40:23 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <bharata.rao@gmail.com>) id 1dmLD6-0001DO-GZ\n\tfor qemu-devel@nongnu.org; Mon, 28 Aug 2017 10:40:17 -0400","from mail-yw0-x22d.google.com ([2607:f8b0:4002:c05::22d]:36402)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <bharata.rao@gmail.com>)\n\tid 1dmLD6-0001DA-Bn; Mon, 28 Aug 2017 10:40:16 -0400","by mail-yw0-x22d.google.com with SMTP id h127so3422230ywf.3;\n\tMon, 28 Aug 2017 07:40:15 -0700 (PDT)","by 10.37.17.134 with HTTP; Mon, 28 Aug 2017 07:40:13 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=Jb26bxMLE2Hh4HZYpSdoP8v0pCX2vWYhdHS3bwk78j4=;\n\tb=AGlGuH7IojdYm22wbVJytXNw47wkaze6f4LIXVNvdPLj+JiNVls0gsH8QD88yDv0t1\n\tf6R+PsaIH9trQsoj9ZYDrCeV7zVPUCqeqT8WYBT1zzsuSLvWRkcW1LHlHpAVtHz8cuQE\n\tr151U36nFdaUn+Yb70zc+M1LBfDXAGciKi+5tQAag0hy6J1xju7VOQtqCXZUFJx/ZLWA\n\tJFUnRMvRT3Lori/RfVz4ccX0YA5V9u7c1QBL04EyAtkAXkWZnCl60xg9lH6Wl7zfjMU2\n\ttUUoWJatvTs8TFEVLfAC1nW2Ah35JgfE3Df2GujUH5I51gv252o3DJCZxX4nfZd1D7Jc\n\tWxYA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=Jb26bxMLE2Hh4HZYpSdoP8v0pCX2vWYhdHS3bwk78j4=;\n\tb=ZFUVCPFoweznnD+QYw1T0cYS9zJTOTRErvxv5yiEpst3r8PJMgiYqR5jt6D686FZHy\n\tRT2JAkEjfybKA+3PNT71Mevk94i1eufIEhE6M1RR5v4VpjtrY3e8S0meYTjoT2KCK0s9\n\t84RBkSTQWkyugWAnHUMrl2b2KRtJ57/qBpgwUQBYn+37uHFJUCwd6w+yRGrxHkPGjcsL\n\twPQnjTKD2C22JSuKEYVXPj0scVouIYpHr5aRZDhyJwhoSsdeFfGE1Rrm+Gi4L6SzfIgy\n\tI9mZGUpjBqBLaAr1lk99TCpk+IwKTFnNILUjUT6EPp3u5BOM30ZaNdh/61lSSE4AZI3+\n\tKjTA==","X-Gm-Message-State":"AHYfb5jOYWKJTf5tv0M4rI2xONLS0KqUo4y7rf1RiYigSOwZ5/y2r7BZ\n\tSBMngXxL48Zo6JGXu5dCwASszJ+fdQ==","X-Received":"by 10.129.111.4 with SMTP id k4mr726116ywc.196.1503931214449;\n\tMon, 28 Aug 2017 07:40:14 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<1503928405-19960-1-git-send-email-s1seetee@linux.vnet.ibm.com>","References":"<1503928405-19960-1-git-send-email-s1seetee@linux.vnet.ibm.com>","From":"Bharata B Rao <bharata.rao@gmail.com>","Date":"Mon, 28 Aug 2017 20:10:13 +0530","Message-ID":"<CAGZKiBoMUtEiaPiLEdeAUaWaAadk1s=VF8kAwc_QGHbUSQxdvw@mail.gmail.com>","To":"Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2607:f8b0:4002:c05::22d","Content-Type":"text/plain; charset=\"UTF-8\"","X-Content-Filtered-By":"Mailman/MimeDel 2.1.21","Subject":"Re: [Qemu-devel] [PATCH v3] qemu crashes when a negative number\n\tused for 'maxcpus'","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Fam Zheng <famz@redhat.com>, \"qemu-ppc@nongnu.org\" <qemu-ppc@nongnu.org>,\n\t\"qemu-devel@nongnu.org\" <qemu-devel@nongnu.org>,\n\tPaolo Bonzini <pbonzini@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]