Generated files for previous commands.
[libguestfs.git] / perl / Guestfs.xs
1 /* libguestfs generated file
2  * WARNING: THIS FILE IS GENERATED BY 'src/generator.ml'.
3  * ANY CHANGES YOU MAKE TO THIS FILE WILL BE LOST.
4  *
5  * Copyright (C) 2009 Red Hat Inc.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21
22 #include "EXTERN.h"
23 #include "perl.h"
24 #include "XSUB.h"
25
26 #include <guestfs.h>
27
28 #ifndef PRId64
29 #define PRId64 "lld"
30 #endif
31
32 static SV *
33 my_newSVll(long long val) {
34 #ifdef USE_64_BIT_ALL
35   return newSViv(val);
36 #else
37   char buf[100];
38   int len;
39   len = snprintf(buf, 100, "%" PRId64, val);
40   return newSVpv(buf, len);
41 #endif
42 }
43
44 #ifndef PRIu64
45 #define PRIu64 "llu"
46 #endif
47
48 static SV *
49 my_newSVull(unsigned long long val) {
50 #ifdef USE_64_BIT_ALL
51   return newSVuv(val);
52 #else
53   char buf[100];
54   int len;
55   len = snprintf(buf, 100, "%" PRIu64, val);
56   return newSVpv(buf, len);
57 #endif
58 }
59
60 /* XXX Not thread-safe, and in general not safe if the caller is
61  * issuing multiple requests in parallel (on different guestfs
62  * handles).  We should use the guestfs_h handle passed to the
63  * error handle to distinguish these cases.
64  */
65 static char *last_error = NULL;
66
67 static void
68 error_handler (guestfs_h *g,
69                void *data,
70                const char *msg)
71 {
72   if (last_error != NULL) free (last_error);
73   last_error = strdup (msg);
74 }
75
76 MODULE = Sys::Guestfs  PACKAGE = Sys::Guestfs
77
78 guestfs_h *
79 _create ()
80    CODE:
81       RETVAL = guestfs_create ();
82       if (!RETVAL)
83         croak ("could not create guestfs handle");
84       guestfs_set_error_handler (RETVAL, error_handler, NULL);
85  OUTPUT:
86       RETVAL
87
88 void
89 DESTROY (g)
90       guestfs_h *g;
91  PPCODE:
92       guestfs_close (g);
93
94 void
95 launch (g)
96       guestfs_h *g;
97  PPCODE:
98       if (guestfs_launch (g) == -1)
99         croak ("launch: %s", last_error);
100
101 void
102 wait_ready (g)
103       guestfs_h *g;
104  PPCODE:
105       if (guestfs_wait_ready (g) == -1)
106         croak ("wait_ready: %s", last_error);
107
108 void
109 kill_subprocess (g)
110       guestfs_h *g;
111  PPCODE:
112       if (guestfs_kill_subprocess (g) == -1)
113         croak ("kill_subprocess: %s", last_error);
114
115 void
116 add_drive (g, filename)
117       guestfs_h *g;
118       char *filename;
119  PPCODE:
120       if (guestfs_add_drive (g, filename) == -1)
121         croak ("add_drive: %s", last_error);
122
123 void
124 add_cdrom (g, filename)
125       guestfs_h *g;
126       char *filename;
127  PPCODE:
128       if (guestfs_add_cdrom (g, filename) == -1)
129         croak ("add_cdrom: %s", last_error);
130
131 void
132 config (g, qemuparam, qemuvalue)
133       guestfs_h *g;
134       char *qemuparam;
135       char *qemuvalue;
136  PPCODE:
137       if (guestfs_config (g, qemuparam, qemuvalue) == -1)
138         croak ("config: %s", last_error);
139
140 void
141 set_path (g, path)
142       guestfs_h *g;
143       char *path;
144  PPCODE:
145       if (guestfs_set_path (g, path) == -1)
146         croak ("set_path: %s", last_error);
147
148 SV *
149 get_path (g)
150       guestfs_h *g;
151 PREINIT:
152       const char *path;
153    CODE:
154       path = guestfs_get_path (g);
155       if (path == NULL)
156         croak ("get_path: %s", last_error);
157       RETVAL = newSVpv (path, 0);
158  OUTPUT:
159       RETVAL
160
161 void
162 set_autosync (g, autosync)
163       guestfs_h *g;
164       int autosync;
165  PPCODE:
166       if (guestfs_set_autosync (g, autosync) == -1)
167         croak ("set_autosync: %s", last_error);
168
169 SV *
170 get_autosync (g)
171       guestfs_h *g;
172 PREINIT:
173       int autosync;
174    CODE:
175       autosync = guestfs_get_autosync (g);
176       if (autosync == -1)
177         croak ("get_autosync: %s", last_error);
178       RETVAL = newSViv (autosync);
179  OUTPUT:
180       RETVAL
181
182 void
183 set_verbose (g, verbose)
184       guestfs_h *g;
185       int verbose;
186  PPCODE:
187       if (guestfs_set_verbose (g, verbose) == -1)
188         croak ("set_verbose: %s", last_error);
189
190 SV *
191 get_verbose (g)
192       guestfs_h *g;
193 PREINIT:
194       int verbose;
195    CODE:
196       verbose = guestfs_get_verbose (g);
197       if (verbose == -1)
198         croak ("get_verbose: %s", last_error);
199       RETVAL = newSViv (verbose);
200  OUTPUT:
201       RETVAL
202
203 void
204 mount (g, device, mountpoint)
205       guestfs_h *g;
206       char *device;
207       char *mountpoint;
208  PPCODE:
209       if (guestfs_mount (g, device, mountpoint) == -1)
210         croak ("mount: %s", last_error);
211
212 void
213 sync (g)
214       guestfs_h *g;
215  PPCODE:
216       if (guestfs_sync (g) == -1)
217         croak ("sync: %s", last_error);
218
219 void
220 touch (g, path)
221       guestfs_h *g;
222       char *path;
223  PPCODE:
224       if (guestfs_touch (g, path) == -1)
225         croak ("touch: %s", last_error);
226
227 SV *
228 cat (g, path)
229       guestfs_h *g;
230       char *path;
231 PREINIT:
232       char *content;
233    CODE:
234       content = guestfs_cat (g, path);
235       if (content == NULL)
236         croak ("cat: %s", last_error);
237       RETVAL = newSVpv (content, 0);
238       free (content);
239  OUTPUT:
240       RETVAL
241
242 SV *
243 ll (g, directory)
244       guestfs_h *g;
245       char *directory;
246 PREINIT:
247       char *listing;
248    CODE:
249       listing = guestfs_ll (g, directory);
250       if (listing == NULL)
251         croak ("ll: %s", last_error);
252       RETVAL = newSVpv (listing, 0);
253       free (listing);
254  OUTPUT:
255       RETVAL
256
257 void
258 ls (g, directory)
259       guestfs_h *g;
260       char *directory;
261 PREINIT:
262       char **listing;
263       int i, n;
264  PPCODE:
265       listing = guestfs_ls (g, directory);
266       if (listing == NULL)
267         croak ("ls: %s", last_error);
268       for (n = 0; listing[n] != NULL; ++n) /**/;
269       EXTEND (SP, n);
270       for (i = 0; i < n; ++i) {
271         PUSHs (sv_2mortal (newSVpv (listing[i], 0)));
272         free (listing[i]);
273       }
274       free (listing);
275
276 void
277 list_devices (g)
278       guestfs_h *g;
279 PREINIT:
280       char **devices;
281       int i, n;
282  PPCODE:
283       devices = guestfs_list_devices (g);
284       if (devices == NULL)
285         croak ("list_devices: %s", last_error);
286       for (n = 0; devices[n] != NULL; ++n) /**/;
287       EXTEND (SP, n);
288       for (i = 0; i < n; ++i) {
289         PUSHs (sv_2mortal (newSVpv (devices[i], 0)));
290         free (devices[i]);
291       }
292       free (devices);
293
294 void
295 list_partitions (g)
296       guestfs_h *g;
297 PREINIT:
298       char **partitions;
299       int i, n;
300  PPCODE:
301       partitions = guestfs_list_partitions (g);
302       if (partitions == NULL)
303         croak ("list_partitions: %s", last_error);
304       for (n = 0; partitions[n] != NULL; ++n) /**/;
305       EXTEND (SP, n);
306       for (i = 0; i < n; ++i) {
307         PUSHs (sv_2mortal (newSVpv (partitions[i], 0)));
308         free (partitions[i]);
309       }
310       free (partitions);
311
312 void
313 pvs (g)
314       guestfs_h *g;
315 PREINIT:
316       char **physvols;
317       int i, n;
318  PPCODE:
319       physvols = guestfs_pvs (g);
320       if (physvols == NULL)
321         croak ("pvs: %s", last_error);
322       for (n = 0; physvols[n] != NULL; ++n) /**/;
323       EXTEND (SP, n);
324       for (i = 0; i < n; ++i) {
325         PUSHs (sv_2mortal (newSVpv (physvols[i], 0)));
326         free (physvols[i]);
327       }
328       free (physvols);
329
330 void
331 vgs (g)
332       guestfs_h *g;
333 PREINIT:
334       char **volgroups;
335       int i, n;
336  PPCODE:
337       volgroups = guestfs_vgs (g);
338       if (volgroups == NULL)
339         croak ("vgs: %s", last_error);
340       for (n = 0; volgroups[n] != NULL; ++n) /**/;
341       EXTEND (SP, n);
342       for (i = 0; i < n; ++i) {
343         PUSHs (sv_2mortal (newSVpv (volgroups[i], 0)));
344         free (volgroups[i]);
345       }
346       free (volgroups);
347
348 void
349 lvs (g)
350       guestfs_h *g;
351 PREINIT:
352       char **logvols;
353       int i, n;
354  PPCODE:
355       logvols = guestfs_lvs (g);
356       if (logvols == NULL)
357         croak ("lvs: %s", last_error);
358       for (n = 0; logvols[n] != NULL; ++n) /**/;
359       EXTEND (SP, n);
360       for (i = 0; i < n; ++i) {
361         PUSHs (sv_2mortal (newSVpv (logvols[i], 0)));
362         free (logvols[i]);
363       }
364       free (logvols);
365
366 void
367 pvs_full (g)
368       guestfs_h *g;
369 PREINIT:
370       struct guestfs_lvm_pv_list *physvols;
371       int i;
372       HV *hv;
373  PPCODE:
374       physvols = guestfs_pvs_full (g);
375       if (physvols == NULL)
376         croak ("pvs_full: %s", last_error);
377       EXTEND (SP, physvols->len);
378       for (i = 0; i < physvols->len; ++i) {
379         hv = newHV ();
380         (void) hv_store (hv, "pv_name", 7, newSVpv (physvols->val[i].pv_name, 0), 0);
381         (void) hv_store (hv, "pv_uuid", 7, newSVpv (physvols->val[i].pv_uuid, 32), 0);
382         (void) hv_store (hv, "pv_fmt", 6, newSVpv (physvols->val[i].pv_fmt, 0), 0);
383         (void) hv_store (hv, "pv_size", 7, my_newSVull (physvols->val[i].pv_size), 0);
384         (void) hv_store (hv, "dev_size", 8, my_newSVull (physvols->val[i].dev_size), 0);
385         (void) hv_store (hv, "pv_free", 7, my_newSVull (physvols->val[i].pv_free), 0);
386         (void) hv_store (hv, "pv_used", 7, my_newSVull (physvols->val[i].pv_used), 0);
387         (void) hv_store (hv, "pv_attr", 7, newSVpv (physvols->val[i].pv_attr, 0), 0);
388         (void) hv_store (hv, "pv_pe_count", 11, my_newSVll (physvols->val[i].pv_pe_count), 0);
389         (void) hv_store (hv, "pv_pe_alloc_count", 17, my_newSVll (physvols->val[i].pv_pe_alloc_count), 0);
390         (void) hv_store (hv, "pv_tags", 7, newSVpv (physvols->val[i].pv_tags, 0), 0);
391         (void) hv_store (hv, "pe_start", 8, my_newSVull (physvols->val[i].pe_start), 0);
392         (void) hv_store (hv, "pv_mda_count", 12, my_newSVll (physvols->val[i].pv_mda_count), 0);
393         (void) hv_store (hv, "pv_mda_free", 11, my_newSVull (physvols->val[i].pv_mda_free), 0);
394         PUSHs (sv_2mortal ((SV *) hv));
395       }
396       guestfs_free_lvm_pv_list (physvols);
397
398 void
399 vgs_full (g)
400       guestfs_h *g;
401 PREINIT:
402       struct guestfs_lvm_vg_list *volgroups;
403       int i;
404       HV *hv;
405  PPCODE:
406       volgroups = guestfs_vgs_full (g);
407       if (volgroups == NULL)
408         croak ("vgs_full: %s", last_error);
409       EXTEND (SP, volgroups->len);
410       for (i = 0; i < volgroups->len; ++i) {
411         hv = newHV ();
412         (void) hv_store (hv, "vg_name", 7, newSVpv (volgroups->val[i].vg_name, 0), 0);
413         (void) hv_store (hv, "vg_uuid", 7, newSVpv (volgroups->val[i].vg_uuid, 32), 0);
414         (void) hv_store (hv, "vg_fmt", 6, newSVpv (volgroups->val[i].vg_fmt, 0), 0);
415         (void) hv_store (hv, "vg_attr", 7, newSVpv (volgroups->val[i].vg_attr, 0), 0);
416         (void) hv_store (hv, "vg_size", 7, my_newSVull (volgroups->val[i].vg_size), 0);
417         (void) hv_store (hv, "vg_free", 7, my_newSVull (volgroups->val[i].vg_free), 0);
418         (void) hv_store (hv, "vg_sysid", 8, newSVpv (volgroups->val[i].vg_sysid, 0), 0);
419         (void) hv_store (hv, "vg_extent_size", 14, my_newSVull (volgroups->val[i].vg_extent_size), 0);
420         (void) hv_store (hv, "vg_extent_count", 15, my_newSVll (volgroups->val[i].vg_extent_count), 0);
421         (void) hv_store (hv, "vg_free_count", 13, my_newSVll (volgroups->val[i].vg_free_count), 0);
422         (void) hv_store (hv, "max_lv", 6, my_newSVll (volgroups->val[i].max_lv), 0);
423         (void) hv_store (hv, "max_pv", 6, my_newSVll (volgroups->val[i].max_pv), 0);
424         (void) hv_store (hv, "pv_count", 8, my_newSVll (volgroups->val[i].pv_count), 0);
425         (void) hv_store (hv, "lv_count", 8, my_newSVll (volgroups->val[i].lv_count), 0);
426         (void) hv_store (hv, "snap_count", 10, my_newSVll (volgroups->val[i].snap_count), 0);
427         (void) hv_store (hv, "vg_seqno", 8, my_newSVll (volgroups->val[i].vg_seqno), 0);
428         (void) hv_store (hv, "vg_tags", 7, newSVpv (volgroups->val[i].vg_tags, 0), 0);
429         (void) hv_store (hv, "vg_mda_count", 12, my_newSVll (volgroups->val[i].vg_mda_count), 0);
430         (void) hv_store (hv, "vg_mda_free", 11, my_newSVull (volgroups->val[i].vg_mda_free), 0);
431         PUSHs (sv_2mortal ((SV *) hv));
432       }
433       guestfs_free_lvm_vg_list (volgroups);
434
435 void
436 lvs_full (g)
437       guestfs_h *g;
438 PREINIT:
439       struct guestfs_lvm_lv_list *logvols;
440       int i;
441       HV *hv;
442  PPCODE:
443       logvols = guestfs_lvs_full (g);
444       if (logvols == NULL)
445         croak ("lvs_full: %s", last_error);
446       EXTEND (SP, logvols->len);
447       for (i = 0; i < logvols->len; ++i) {
448         hv = newHV ();
449         (void) hv_store (hv, "lv_name", 7, newSVpv (logvols->val[i].lv_name, 0), 0);
450         (void) hv_store (hv, "lv_uuid", 7, newSVpv (logvols->val[i].lv_uuid, 32), 0);
451         (void) hv_store (hv, "lv_attr", 7, newSVpv (logvols->val[i].lv_attr, 0), 0);
452         (void) hv_store (hv, "lv_major", 8, my_newSVll (logvols->val[i].lv_major), 0);
453         (void) hv_store (hv, "lv_minor", 8, my_newSVll (logvols->val[i].lv_minor), 0);
454         (void) hv_store (hv, "lv_kernel_major", 15, my_newSVll (logvols->val[i].lv_kernel_major), 0);
455         (void) hv_store (hv, "lv_kernel_minor", 15, my_newSVll (logvols->val[i].lv_kernel_minor), 0);
456         (void) hv_store (hv, "lv_size", 7, my_newSVull (logvols->val[i].lv_size), 0);
457         (void) hv_store (hv, "seg_count", 9, my_newSVll (logvols->val[i].seg_count), 0);
458         (void) hv_store (hv, "origin", 6, newSVpv (logvols->val[i].origin, 0), 0);
459         (void) hv_store (hv, "snap_percent", 12, newSVnv (logvols->val[i].snap_percent), 0);
460         (void) hv_store (hv, "copy_percent", 12, newSVnv (logvols->val[i].copy_percent), 0);
461         (void) hv_store (hv, "move_pv", 7, newSVpv (logvols->val[i].move_pv, 0), 0);
462         (void) hv_store (hv, "lv_tags", 7, newSVpv (logvols->val[i].lv_tags, 0), 0);
463         (void) hv_store (hv, "mirror_log", 10, newSVpv (logvols->val[i].mirror_log, 0), 0);
464         (void) hv_store (hv, "modules", 7, newSVpv (logvols->val[i].modules, 0), 0);
465         PUSHs (sv_2mortal ((SV *) hv));
466       }
467       guestfs_free_lvm_lv_list (logvols);
468
469 void
470 read_lines (g, path)
471       guestfs_h *g;
472       char *path;
473 PREINIT:
474       char **lines;
475       int i, n;
476  PPCODE:
477       lines = guestfs_read_lines (g, path);
478       if (lines == NULL)
479         croak ("read_lines: %s", last_error);
480       for (n = 0; lines[n] != NULL; ++n) /**/;
481       EXTEND (SP, n);
482       for (i = 0; i < n; ++i) {
483         PUSHs (sv_2mortal (newSVpv (lines[i], 0)));
484         free (lines[i]);
485       }
486       free (lines);
487
488 void
489 aug_init (g, root, flags)
490       guestfs_h *g;
491       char *root;
492       int flags;
493  PPCODE:
494       if (guestfs_aug_init (g, root, flags) == -1)
495         croak ("aug_init: %s", last_error);
496
497 void
498 aug_close (g)
499       guestfs_h *g;
500  PPCODE:
501       if (guestfs_aug_close (g) == -1)
502         croak ("aug_close: %s", last_error);
503
504 SV *
505 aug_defvar (g, name, expr)
506       guestfs_h *g;
507       char *name;
508       char *expr;
509 PREINIT:
510       int nrnodes;
511    CODE:
512       nrnodes = guestfs_aug_defvar (g, name, expr);
513       if (nrnodes == -1)
514         croak ("aug_defvar: %s", last_error);
515       RETVAL = newSViv (nrnodes);
516  OUTPUT:
517       RETVAL
518
519 void
520 aug_defnode (g, name, expr, val)
521       guestfs_h *g;
522       char *name;
523       char *expr;
524       char *val;
525 PREINIT:
526       struct guestfs_int_bool *r;
527  PPCODE:
528       r = guestfs_aug_defnode (g, name, expr, val);
529       if (r == NULL)
530         croak ("aug_defnode: %s", last_error);
531       EXTEND (SP, 2);
532       PUSHs (sv_2mortal (newSViv (r->i)));
533       PUSHs (sv_2mortal (newSViv (r->b)));
534       guestfs_free_int_bool (r);
535
536 SV *
537 aug_get (g, path)
538       guestfs_h *g;
539       char *path;
540 PREINIT:
541       char *val;
542    CODE:
543       val = guestfs_aug_get (g, path);
544       if (val == NULL)
545         croak ("aug_get: %s", last_error);
546       RETVAL = newSVpv (val, 0);
547       free (val);
548  OUTPUT:
549       RETVAL
550
551 void
552 aug_set (g, path, val)
553       guestfs_h *g;
554       char *path;
555       char *val;
556  PPCODE:
557       if (guestfs_aug_set (g, path, val) == -1)
558         croak ("aug_set: %s", last_error);
559
560 void
561 aug_insert (g, path, label, before)
562       guestfs_h *g;
563       char *path;
564       char *label;
565       int before;
566  PPCODE:
567       if (guestfs_aug_insert (g, path, label, before) == -1)
568         croak ("aug_insert: %s", last_error);
569
570 SV *
571 aug_rm (g, path)
572       guestfs_h *g;
573       char *path;
574 PREINIT:
575       int nrnodes;
576    CODE:
577       nrnodes = guestfs_aug_rm (g, path);
578       if (nrnodes == -1)
579         croak ("aug_rm: %s", last_error);
580       RETVAL = newSViv (nrnodes);
581  OUTPUT:
582       RETVAL
583
584 void
585 aug_mv (g, src, dest)
586       guestfs_h *g;
587       char *src;
588       char *dest;
589  PPCODE:
590       if (guestfs_aug_mv (g, src, dest) == -1)
591         croak ("aug_mv: %s", last_error);
592
593 void
594 aug_match (g, path)
595       guestfs_h *g;
596       char *path;
597 PREINIT:
598       char **matches;
599       int i, n;
600  PPCODE:
601       matches = guestfs_aug_match (g, path);
602       if (matches == NULL)
603         croak ("aug_match: %s", last_error);
604       for (n = 0; matches[n] != NULL; ++n) /**/;
605       EXTEND (SP, n);
606       for (i = 0; i < n; ++i) {
607         PUSHs (sv_2mortal (newSVpv (matches[i], 0)));
608         free (matches[i]);
609       }
610       free (matches);
611
612 void
613 aug_save (g)
614       guestfs_h *g;
615  PPCODE:
616       if (guestfs_aug_save (g) == -1)
617         croak ("aug_save: %s", last_error);
618
619 void
620 aug_load (g)
621       guestfs_h *g;
622  PPCODE:
623       if (guestfs_aug_load (g) == -1)
624         croak ("aug_load: %s", last_error);
625
626 void
627 aug_ls (g, path)
628       guestfs_h *g;
629       char *path;
630 PREINIT:
631       char **matches;
632       int i, n;
633  PPCODE:
634       matches = guestfs_aug_ls (g, path);
635       if (matches == NULL)
636         croak ("aug_ls: %s", last_error);
637       for (n = 0; matches[n] != NULL; ++n) /**/;
638       EXTEND (SP, n);
639       for (i = 0; i < n; ++i) {
640         PUSHs (sv_2mortal (newSVpv (matches[i], 0)));
641         free (matches[i]);
642       }
643       free (matches);
644
645 void
646 rm (g, path)
647       guestfs_h *g;
648       char *path;
649  PPCODE:
650       if (guestfs_rm (g, path) == -1)
651         croak ("rm: %s", last_error);
652
653 void
654 rmdir (g, path)
655       guestfs_h *g;
656       char *path;
657  PPCODE:
658       if (guestfs_rmdir (g, path) == -1)
659         croak ("rmdir: %s", last_error);
660
661 void
662 rm_rf (g, path)
663       guestfs_h *g;
664       char *path;
665  PPCODE:
666       if (guestfs_rm_rf (g, path) == -1)
667         croak ("rm_rf: %s", last_error);
668
669 void
670 mkdir (g, path)
671       guestfs_h *g;
672       char *path;
673  PPCODE:
674       if (guestfs_mkdir (g, path) == -1)
675         croak ("mkdir: %s", last_error);
676
677 void
678 mkdir_p (g, path)
679       guestfs_h *g;
680       char *path;
681  PPCODE:
682       if (guestfs_mkdir_p (g, path) == -1)
683         croak ("mkdir_p: %s", last_error);
684
685 void
686 chmod (g, mode, path)
687       guestfs_h *g;
688       int mode;
689       char *path;
690  PPCODE:
691       if (guestfs_chmod (g, mode, path) == -1)
692         croak ("chmod: %s", last_error);
693
694 void
695 chown (g, owner, group, path)
696       guestfs_h *g;
697       int owner;
698       int group;
699       char *path;
700  PPCODE:
701       if (guestfs_chown (g, owner, group, path) == -1)
702         croak ("chown: %s", last_error);
703