|  | // Copyright 2018 The Fuchsia Authors. All rights reserved. | 
|  | // Use of this source code is governed by a BSD-style license that can be | 
|  | // found in the LICENSE file. | 
|  |  | 
|  | library fuchsia.virtualization; | 
|  |  | 
|  | using zx; | 
|  |  | 
|  | /// Contains a memory statistic for the balloon device. | 
|  | struct MemStat { | 
|  | uint16 tag; | 
|  | uint64 val; | 
|  | }; | 
|  |  | 
|  | /// A `BalloonController` controls a guest instance's memory balloon. | 
|  | [Discoverable] | 
|  | protocol BalloonController { | 
|  | /// Get the number of pages in the memory balloon. | 
|  | GetNumPages() -> (uint32 num_pages); | 
|  |  | 
|  | /// Request a number of pages to be supplied to the memory balloon. | 
|  | /// | 
|  | /// If `num_pages` is greater than the current value, the guest instance will | 
|  | /// provide additional pages to the memory balloon. If `num_pages` is less | 
|  | /// than the current value, the guest instance is free to reclaim pages from | 
|  | /// the memory balloon. | 
|  | RequestNumPages(uint32 num_pages); | 
|  |  | 
|  | /// Get memory statistics of the guest instance. | 
|  | GetMemStats() -> (zx.status status, vector<MemStat>? mem_stats); | 
|  | }; |