daemon: debug segv correct use of dereferencing NULL.
[libguestfs.git] / java / t / GuestFS080OptArgs.java
1 /* libguestfs Java bindings
2  * Copyright (C) 2011 Red Hat Inc.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18
19 import java.io.*;
20 import java.util.HashMap;
21 import com.redhat.et.libguestfs.*;
22
23 public class GuestFS080OptArgs
24 {
25     public static void main (String[] argv)
26     {
27         try {
28             GuestFS g = new GuestFS ();
29
30             g.add_drive_opts ("/dev/null", null);
31
32             HashMap<String,Object> optargs;
33
34             optargs = new HashMap<String,Object>() {
35                 {
36                     put ("readonly", Boolean.TRUE);
37                 }
38             };
39             g.add_drive_opts ("/dev/null", optargs);
40
41             optargs = new HashMap<String,Object>() {
42                 {
43                     put ("readonly", Boolean.TRUE);
44                     put ("format", "raw");
45                 }
46             };
47             g.add_drive_opts ("/dev/null", optargs);
48
49             optargs = new HashMap<String,Object>() {
50                 {
51                     put ("readonly", Boolean.TRUE);
52                     put ("format", "raw");
53                     put ("iface", "virtio");
54                 }
55             };
56             g.add_drive_opts ("/dev/null", optargs);
57         }
58         catch (Exception exn) {
59             System.err.println (exn);
60             System.exit (1);
61         }
62     }
63 }