docs: Update documentation for spapr-vio addresses
[libvirt/ericb.git] / tools / virsh-util.h
blob55520302ff5be8bb08f005f55bc1bd46be569d95
1 /*
2 * virsh-util.h: helpers for virsh
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.1 of the License, or (at your option) any later version.
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.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library. If not, see
16 * <http://www.gnu.org/licenses/>.
19 #pragma once
21 #include "virsh.h"
23 #include <libxml/parser.h>
24 #include <libxml/xpath.h>
26 virDomainPtr
27 virshLookupDomainBy(vshControl *ctl,
28 const char *name,
29 unsigned int flags);
31 virDomainPtr
32 virshCommandOptDomainBy(vshControl *ctl,
33 const vshCmd *cmd,
34 const char **name,
35 unsigned int flags);
37 virDomainPtr
38 virshCommandOptDomain(vshControl *ctl,
39 const vshCmd *cmd,
40 const char **name);
42 void
43 virshDomainFree(virDomainPtr dom);
45 void
46 virshDomainSnapshotFree(virDomainSnapshotPtr snap);
48 int
49 virshDomainState(vshControl *ctl,
50 virDomainPtr dom,
51 int *reason);
53 int
54 virshStreamSink(virStreamPtr st,
55 const char *bytes,
56 size_t nbytes,
57 void *opaque);
59 typedef struct _virshStreamCallbackData virshStreamCallbackData;
60 typedef virshStreamCallbackData *virshStreamCallbackDataPtr;
61 struct _virshStreamCallbackData {
62 vshControl *ctl;
63 int fd;
66 int
67 virshStreamSource(virStreamPtr st,
68 char *bytes,
69 size_t nbytes,
70 void *opaque);
72 int
73 virshStreamSourceSkip(virStreamPtr st,
74 long long offset,
75 void *opaque);
77 int
78 virshStreamSkip(virStreamPtr st,
79 long long offset,
80 void *opaque);
82 int
83 virshStreamInData(virStreamPtr st,
84 int *inData,
85 long long *offset,
86 void *opaque);
88 int
89 virshDomainGetXMLFromDom(vshControl *ctl,
90 virDomainPtr dom,
91 unsigned int flags,
92 xmlDocPtr *xml,
93 xmlXPathContextPtr *ctxt)
94 ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4)
95 ATTRIBUTE_NONNULL(5) ATTRIBUTE_RETURN_CHECK;
97 int
98 virshDomainGetXML(vshControl *ctl,
99 const vshCmd *cmd,
100 unsigned int flags,
101 xmlDocPtr *xml,
102 xmlXPathContextPtr *ctxt)
103 ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4)
104 ATTRIBUTE_NONNULL(5) ATTRIBUTE_RETURN_CHECK;