1 /*
2  * qemu_alias.h: QEMU alias manipulation
3  *
4  * Copyright (C) 2006-2016 Red Hat, Inc.
5  * Copyright (C) 2006 Daniel P. Berrange
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.1 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, see
19  * <http://www.gnu.org/licenses/>.
20  */
21 
22 #pragma once
23 
24 #include "domain_conf.h"
25 
26 #include "qemu_capabilities.h"
27 #include "qemu_domain.h"
28 #include "qemu_domain_address.h"
29 
30 int qemuAssignDeviceChrAlias(virDomainDef *def,
31                              virDomainChrDef *chr,
32                              ssize_t idx);
33 
34 void qemuAssignDeviceControllerAlias(virDomainDef *domainDef,
35                                      virDomainControllerDef *controller);
36 
37 int qemuAssignDeviceDiskAlias(virDomainDef *def,
38                               virDomainDiskDef *disk,
39                               virQEMUCaps *qemuCaps);
40 
41 void qemuAssignDeviceHostdevAlias(virDomainDef *def,
42                                   char **alias,
43                                   int idx);
44 
45 void qemuAssignDeviceNetAlias(virDomainDef *def,
46                               virDomainNetDef *net,
47                               int idx);
48 
49 void
50 qemuAssignDeviceFSAlias(virDomainDef *def,
51                         virDomainFSDef *fss);
52 
53 void qemuAssignDeviceRedirdevAlias(virDomainDef *def,
54                                    virDomainRedirdevDef *redirdev,
55                                    int idx);
56 
57 void qemuAssignDeviceRNGAlias(virDomainDef *def,
58                               virDomainRNGDef *rng);
59 
60 int qemuAssignDeviceMemoryAlias(virDomainDef *def,
61                                 virDomainMemoryDef *mems,
62                                 bool oldAlias);
63 
64 void qemuAssignDeviceShmemAlias(virDomainDef *def,
65                                 virDomainShmemDef *shmem,
66                                 int idx);
67 
68 void qemuAssignDeviceWatchdogAlias(virDomainWatchdogDef *watchdog);
69 
70 void qemuAssignDeviceInputAlias(virDomainDef *def,
71                                 virDomainInputDef *input,
72                                 int idx);
73 
74 void qemuAssignDeviceVsockAlias(virDomainVsockDef *vsock);
75 
76 int qemuAssignDeviceAliases(virDomainDef *def, virQEMUCaps *qemuCaps);
77 
78 int qemuDomainDeviceAliasIndex(const virDomainDeviceInfo *info,
79                                const char *prefix);
80 
81 char *qemuAliasDiskDriveFromDisk(const virDomainDiskDef *disk);
82 
83 const char *qemuAliasDiskDriveSkipPrefix(const char *dev_name);
84 
85 char *qemuAliasFromHostdev(const virDomainHostdevDef *hostdev);
86 
87 char *qemuDomainGetMasterKeyAlias(void);
88 
89 char *qemuAliasForSecret(const char *parentalias,
90                          const char *obj);
91 
92 char *qemuAliasTLSObjFromSrcAlias(const char *srcAlias)
93     ATTRIBUTE_NONNULL(1);
94 
95 char *qemuAliasChardevFromDevAlias(const char *devAlias)
96     ATTRIBUTE_NONNULL(1);
97 
98 const char *qemuDomainGetManagedPRAlias(void);
99 
100 char *qemuDomainGetUnmanagedPRAlias(const char *parentalias);
101 
102 const char *qemuDomainGetDBusVMStateAlias(void);
103 
104 char *qemuDomainGetVhostUserChrAlias(const char *devalias);
105