From owner-freebsd-virtualization@FreeBSD.ORG Fri Jun 5 17:23:41 2015 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F7A795A for ; Fri, 5 Jun 2015 17:23:41 +0000 (UTC) (envelope-from stefan.andritoiu@gmail.com) Received: from mail-ob0-x229.google.com (mail-ob0-x229.google.com [IPv6:2607:f8b0:4003:c01::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 485591AA1 for ; Fri, 5 Jun 2015 17:23:41 +0000 (UTC) (envelope-from stefan.andritoiu@gmail.com) Received: by obbgp2 with SMTP id gp2so36928561obb.2 for ; Fri, 05 Jun 2015 10:23:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=pixQyo/b5Y3Yp/hhACU2Gbe72zur/pIUkEX2uQ80/b0=; b=x4V5cID0EOYw21C677bN+2BeFNWZpuDkigEwYIi+w3dV+XbjHdbu3ki7HdWc5Jj3pu tePp4UA3qaiwWgfL1uhtzwZfiiln3eiwqqh8iKmrbgHztiIimGY/mupyVcpVgXuwAmCA 9suMSI4p3whhPMFkN4ZKWmIphG4952tA5rx37xakFMKxvnLG2Pcxmz76zbqiie78BiMq P99yihUu5JgICuqOhOwiifVsMt9jgWFy6o7gvcUiAt/hNnO0gQ6BBsnTn5cOMPFLuf9B mbfhgTi71CGxI/7oZRcYkG3ox0r54JtiEc5NhK6+S9YM4AEuv9XHB6ele/iq9wdGAasq OIWw== MIME-Version: 1.0 X-Received: by 10.202.50.198 with SMTP id y189mr3662410oiy.21.1433525020457; Fri, 05 Jun 2015 10:23:40 -0700 (PDT) Received: by 10.60.82.168 with HTTP; Fri, 5 Jun 2015 10:23:40 -0700 (PDT) Date: Fri, 5 Jun 2015 20:23:40 +0300 Message-ID: Subject: Setting custom field in struct thread from bhyverun code From: Stefan Andritoiu To: freebsd-virtualization@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2015 17:23:41 -0000 I've added a new field to struct thread and want to set it's value when the VCPU thread is created. I need this new field in the ULE scheduler. My plan was this: in the fbsdrun_start_thread() function make a custom-ioctl call {ioctl(ctx->fd, VM_SET_CUSTOM, ..)} to set it. But I have no idea how to get the thread I need, to set it's value. How can I get the thread? Or is there a better way of setting, a VCPU-thread's field, at the moment the thread is created, to use it in the scheduler?