mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-31 00:45:18 +00:00
virbuffer: use g_auto directly for virBuffer
Since commit 44e7f029159ed701b4a1739ac711507ee53790ed util: rewrite auto cleanup macros to use glib's equivalent VIR_AUTOCLEAN is just an alias for g_auto. Use the GLib macros directly instead of our custom aliases. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
3372c16aa5
commit
2b2c67b401
@ -7095,8 +7095,8 @@ virDomainDeviceInfoFormat(virBufferPtr buf,
|
|||||||
virDomainDeviceInfoPtr info,
|
virDomainDeviceInfoPtr info,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOCLEAN(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
if ((flags & VIR_DOMAIN_DEF_FORMAT_ALLOW_BOOT) && info->bootIndex) {
|
if ((flags & VIR_DOMAIN_DEF_FORMAT_ALLOW_BOOT) && info->bootIndex) {
|
||||||
@ -24139,7 +24139,7 @@ virDomainDiskSourceFormatPrivateData(virBufferPtr buf,
|
|||||||
unsigned int flags,
|
unsigned int flags,
|
||||||
virDomainXMLOptionPtr xmlopt)
|
virDomainXMLOptionPtr xmlopt)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
if (!(flags & VIR_DOMAIN_DEF_FORMAT_STATUS) ||
|
if (!(flags & VIR_DOMAIN_DEF_FORMAT_STATUS) ||
|
||||||
@ -24183,8 +24183,8 @@ virDomainDiskSourceFormat(virBufferPtr buf,
|
|||||||
unsigned int flags,
|
unsigned int flags,
|
||||||
virDomainXMLOptionPtr xmlopt)
|
virDomainXMLOptionPtr xmlopt)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOCLEAN(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
virBufferSetChildIndent(&childBuf, buf);
|
virBufferSetChildIndent(&childBuf, buf);
|
||||||
|
|
||||||
@ -24271,8 +24271,8 @@ virDomainDiskBackingStoreFormat(virBufferPtr buf,
|
|||||||
virDomainXMLOptionPtr xmlopt,
|
virDomainXMLOptionPtr xmlopt,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOCLEAN(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
||||||
bool inactive = flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE;
|
bool inactive = flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE;
|
||||||
virStorageSourcePtr backingStore = src->backingStore;
|
virStorageSourcePtr backingStore = src->backingStore;
|
||||||
|
|
||||||
@ -24435,8 +24435,8 @@ virDomainDiskDefFormatMirror(virBufferPtr buf,
|
|||||||
unsigned int flags,
|
unsigned int flags,
|
||||||
virDomainXMLOptionPtr xmlopt)
|
virDomainXMLOptionPtr xmlopt)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOCLEAN(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
||||||
const char *formatStr = NULL;
|
const char *formatStr = NULL;
|
||||||
|
|
||||||
virBufferSetChildIndent(&childBuf, buf);
|
virBufferSetChildIndent(&childBuf, buf);
|
||||||
@ -24488,7 +24488,7 @@ virDomainDiskDefFormatPrivateData(virBufferPtr buf,
|
|||||||
unsigned int flags,
|
unsigned int flags,
|
||||||
virDomainXMLOptionPtr xmlopt)
|
virDomainXMLOptionPtr xmlopt)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
if (!(flags & VIR_DOMAIN_DEF_FORMAT_STATUS) ||
|
if (!(flags & VIR_DOMAIN_DEF_FORMAT_STATUS) ||
|
||||||
!xmlopt ||
|
!xmlopt ||
|
||||||
@ -24637,7 +24637,7 @@ static int
|
|||||||
virDomainControllerDriverFormat(virBufferPtr buf,
|
virDomainControllerDriverFormat(virBufferPtr buf,
|
||||||
virDomainControllerDefPtr def)
|
virDomainControllerDefPtr def)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) driverBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) driverBuf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
if (def->queues)
|
if (def->queues)
|
||||||
virBufferAsprintf(&driverBuf, " queues='%u'", def->queues);
|
virBufferAsprintf(&driverBuf, " queues='%u'", def->queues);
|
||||||
@ -24670,8 +24670,8 @@ virDomainControllerDefFormat(virBufferPtr buf,
|
|||||||
const char *type = virDomainControllerTypeToString(def->type);
|
const char *type = virDomainControllerTypeToString(def->type);
|
||||||
const char *model = NULL;
|
const char *model = NULL;
|
||||||
const char *modelName = NULL;
|
const char *modelName = NULL;
|
||||||
VIR_AUTOCLEAN(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOCLEAN(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
virBufferSetChildIndent(&childBuf, buf);
|
virBufferSetChildIndent(&childBuf, buf);
|
||||||
|
|
||||||
@ -24839,7 +24839,7 @@ virDomainFSDefFormat(virBufferPtr buf,
|
|||||||
const char *fsdriver = virDomainFSDriverTypeToString(def->fsdriver);
|
const char *fsdriver = virDomainFSDriverTypeToString(def->fsdriver);
|
||||||
const char *wrpolicy = virDomainFSWrpolicyTypeToString(def->wrpolicy);
|
const char *wrpolicy = virDomainFSWrpolicyTypeToString(def->wrpolicy);
|
||||||
const char *src = def->src->path;
|
const char *src = def->src->path;
|
||||||
VIR_AUTOCLEAN(virBuffer) driverBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) driverBuf = VIR_BUFFER_INITIALIZER;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
if (!type) {
|
if (!type) {
|
||||||
@ -25442,7 +25442,7 @@ virDomainNetDefFormat(virBufferPtr buf,
|
|||||||
const char *typeStr;
|
const char *typeStr;
|
||||||
virDomainHostdevDefPtr hostdef = NULL;
|
virDomainHostdevDefPtr hostdef = NULL;
|
||||||
char macstr[VIR_MAC_STRING_BUFLEN];
|
char macstr[VIR_MAC_STRING_BUFLEN];
|
||||||
VIR_AUTOCLEAN(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
/* publicActual is true if we should report the current state in
|
/* publicActual is true if we should report the current state in
|
||||||
* def->data.network.actual *instead of* the config (*not* in
|
* def->data.network.actual *instead of* the config (*not* in
|
||||||
@ -25785,8 +25785,8 @@ virDomainChrSourceDefFormat(virBufferPtr buf,
|
|||||||
virDomainChrSourceDefPtr def,
|
virDomainChrSourceDefPtr def,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOCLEAN(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
virBufferSetChildIndent(&childBuf, buf);
|
virBufferSetChildIndent(&childBuf, buf);
|
||||||
|
|
||||||
@ -26070,7 +26070,7 @@ virDomainSmartcardDefFormat(virBufferPtr buf,
|
|||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
const char *mode = virDomainSmartcardTypeToString(def->type);
|
const char *mode = virDomainSmartcardTypeToString(def->type);
|
||||||
VIR_AUTOCLEAN(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
||||||
size_t i;
|
size_t i;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
@ -26203,7 +26203,7 @@ virDomainSoundDefFormat(virBufferPtr buf,
|
|||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
const char *model = virDomainSoundModelTypeToString(def->model);
|
const char *model = virDomainSoundModelTypeToString(def->model);
|
||||||
VIR_AUTOCLEAN(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
||||||
size_t i;
|
size_t i;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
@ -26246,9 +26246,9 @@ virDomainMemballoonDefFormat(virBufferPtr buf,
|
|||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
const char *model = virDomainMemballoonModelTypeToString(def->model);
|
const char *model = virDomainMemballoonModelTypeToString(def->model);
|
||||||
VIR_AUTOCLEAN(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOCLEAN(virBuffer) childrenBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) childrenBuf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOCLEAN(virBuffer) driverAttrBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) driverAttrBuf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
if (!model) {
|
if (!model) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
@ -26302,8 +26302,8 @@ virDomainWatchdogDefFormat(virBufferPtr buf,
|
|||||||
{
|
{
|
||||||
const char *model = virDomainWatchdogModelTypeToString(def->model);
|
const char *model = virDomainWatchdogModelTypeToString(def->model);
|
||||||
const char *action = virDomainWatchdogActionTypeToString(def->action);
|
const char *action = virDomainWatchdogActionTypeToString(def->action);
|
||||||
VIR_AUTOCLEAN(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOCLEAN(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
virBufferSetChildIndent(&childBuf, buf);
|
virBufferSetChildIndent(&childBuf, buf);
|
||||||
|
|
||||||
@ -26330,8 +26330,8 @@ virDomainWatchdogDefFormat(virBufferPtr buf,
|
|||||||
static int virDomainPanicDefFormat(virBufferPtr buf,
|
static int virDomainPanicDefFormat(virBufferPtr buf,
|
||||||
virDomainPanicDefPtr def)
|
virDomainPanicDefPtr def)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOCLEAN(virBuffer) childrenBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) childrenBuf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
if (def->model)
|
if (def->model)
|
||||||
virBufferAsprintf(&attrBuf, " model='%s'",
|
virBufferAsprintf(&attrBuf, " model='%s'",
|
||||||
@ -26391,7 +26391,7 @@ virDomainRNGDefFormat(virBufferPtr buf,
|
|||||||
{
|
{
|
||||||
const char *model = virDomainRNGModelTypeToString(def->model);
|
const char *model = virDomainRNGModelTypeToString(def->model);
|
||||||
const char *backend = virDomainRNGBackendTypeToString(def->backend);
|
const char *backend = virDomainRNGBackendTypeToString(def->backend);
|
||||||
VIR_AUTOCLEAN(virBuffer) driverAttrBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) driverAttrBuf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
virBufferAsprintf(buf, "<rng model='%s'>\n", model);
|
virBufferAsprintf(buf, "<rng model='%s'>\n", model);
|
||||||
virBufferAdjustIndent(buf, 2);
|
virBufferAdjustIndent(buf, 2);
|
||||||
@ -26585,7 +26585,7 @@ virDomainVideoDefFormat(virBufferPtr buf,
|
|||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
const char *model = virDomainVideoTypeToString(def->type);
|
const char *model = virDomainVideoTypeToString(def->type);
|
||||||
VIR_AUTOCLEAN(virBuffer) driverBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) driverBuf = VIR_BUFFER_INITIALIZER;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
if (!model) {
|
if (!model) {
|
||||||
@ -26656,9 +26656,9 @@ virDomainInputDefFormat(virBufferPtr buf,
|
|||||||
{
|
{
|
||||||
const char *type = virDomainInputTypeToString(def->type);
|
const char *type = virDomainInputTypeToString(def->type);
|
||||||
const char *bus = virDomainInputBusTypeToString(def->bus);
|
const char *bus = virDomainInputBusTypeToString(def->bus);
|
||||||
VIR_AUTOCLEAN(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOCLEAN(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOCLEAN(virBuffer) driverAttrBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) driverAttrBuf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
/* don't format keyboard into migratable XML for backward compatibility */
|
/* don't format keyboard into migratable XML for backward compatibility */
|
||||||
if (flags & VIR_DOMAIN_DEF_FORMAT_MIGRATABLE &&
|
if (flags & VIR_DOMAIN_DEF_FORMAT_MIGRATABLE &&
|
||||||
@ -27388,8 +27388,8 @@ virDomainHubDefFormat(virBufferPtr buf,
|
|||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
const char *type = virDomainHubTypeToString(def->type);
|
const char *type = virDomainHubTypeToString(def->type);
|
||||||
VIR_AUTOCLEAN(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOCLEAN(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
virBufferSetChildIndent(&childBuf, buf);
|
virBufferSetChildIndent(&childBuf, buf);
|
||||||
|
|
||||||
@ -27656,7 +27656,7 @@ virDomainCachetuneDefFormat(virBufferPtr buf,
|
|||||||
virDomainResctrlDefPtr resctrl,
|
virDomainResctrlDefPtr resctrl,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) childrenBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) childrenBuf = VIR_BUFFER_INITIALIZER;
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
VIR_AUTOFREE(char *) vcpus = NULL;
|
VIR_AUTOFREE(char *) vcpus = NULL;
|
||||||
@ -27725,7 +27725,7 @@ virDomainMemorytuneDefFormat(virBufferPtr buf,
|
|||||||
virDomainResctrlDefPtr resctrl,
|
virDomainResctrlDefPtr resctrl,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) childrenBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) childrenBuf = VIR_BUFFER_INITIALIZER;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
VIR_AUTOFREE(char *) vcpus = NULL;
|
VIR_AUTOFREE(char *) vcpus = NULL;
|
||||||
|
|
||||||
@ -27772,7 +27772,7 @@ virDomainCputuneDefFormat(virBufferPtr buf,
|
|||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
VIR_AUTOCLEAN(virBuffer) childrenBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) childrenBuf = VIR_BUFFER_INITIALIZER;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
virBufferSetChildIndent(&childrenBuf, buf);
|
virBufferSetChildIndent(&childrenBuf, buf);
|
||||||
@ -27960,9 +27960,9 @@ static int
|
|||||||
virDomainIOMMUDefFormat(virBufferPtr buf,
|
virDomainIOMMUDefFormat(virBufferPtr buf,
|
||||||
const virDomainIOMMUDef *iommu)
|
const virDomainIOMMUDef *iommu)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOCLEAN(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOCLEAN(virBuffer) driverAttrBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) driverAttrBuf = VIR_BUFFER_INITIALIZER;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
virBufferSetChildIndent(&childBuf, buf);
|
virBufferSetChildIndent(&childBuf, buf);
|
||||||
@ -28004,7 +28004,7 @@ static int
|
|||||||
virDomainMemtuneFormat(virBufferPtr buf,
|
virDomainMemtuneFormat(virBufferPtr buf,
|
||||||
const virDomainMemtune *mem)
|
const virDomainMemtune *mem)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
virBufferSetChildIndent(&childBuf, buf);
|
virBufferSetChildIndent(&childBuf, buf);
|
||||||
@ -28066,9 +28066,9 @@ static int
|
|||||||
virDomainVsockDefFormat(virBufferPtr buf,
|
virDomainVsockDefFormat(virBufferPtr buf,
|
||||||
virDomainVsockDefPtr vsock)
|
virDomainVsockDefPtr vsock)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOCLEAN(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOCLEAN(virBuffer) cidAttrBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) cidAttrBuf = VIR_BUFFER_INITIALIZER;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
if (vsock->model) {
|
if (vsock->model) {
|
||||||
@ -28104,7 +28104,7 @@ static int
|
|||||||
virDomainDefFormatBlkiotune(virBufferPtr buf,
|
virDomainDefFormatBlkiotune(virBufferPtr buf,
|
||||||
virDomainDefPtr def)
|
virDomainDefPtr def)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) childrenBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) childrenBuf = VIR_BUFFER_INITIALIZER;
|
||||||
ssize_t n;
|
ssize_t n;
|
||||||
|
|
||||||
virBufferSetChildIndent(&childrenBuf, buf);
|
virBufferSetChildIndent(&childrenBuf, buf);
|
||||||
@ -28149,9 +28149,9 @@ static int
|
|||||||
virDomainDefFormatFeatures(virBufferPtr buf,
|
virDomainDefFormatFeatures(virBufferPtr buf,
|
||||||
virDomainDefPtr def)
|
virDomainDefPtr def)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) tmpAttrBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) tmpAttrBuf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOCLEAN(virBuffer) tmpChildBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) tmpChildBuf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOCLEAN(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
virBufferSetChildIndent(&childBuf, buf);
|
virBufferSetChildIndent(&childBuf, buf);
|
||||||
@ -28998,7 +28998,7 @@ virDomainObjFormat(virDomainXMLOptionPtr xmlopt,
|
|||||||
virCapsPtr caps,
|
virCapsPtr caps,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
int state;
|
int state;
|
||||||
int reason;
|
int reason;
|
||||||
size_t i;
|
size_t i;
|
||||||
@ -29979,7 +29979,7 @@ virDomainDeviceDefCopy(virDomainDeviceDefPtr src,
|
|||||||
virDomainXMLOptionPtr xmlopt,
|
virDomainXMLOptionPtr xmlopt,
|
||||||
void *parseOpaque)
|
void *parseOpaque)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
int flags = VIR_DOMAIN_DEF_FORMAT_INACTIVE | VIR_DOMAIN_DEF_FORMAT_SECURE;
|
int flags = VIR_DOMAIN_DEF_FORMAT_INACTIVE | VIR_DOMAIN_DEF_FORMAT_SECURE;
|
||||||
int rc = -1;
|
int rc = -1;
|
||||||
char *netprefix;
|
char *netprefix;
|
||||||
@ -30454,7 +30454,7 @@ virDomainGetBlkioParametersAssignFromDef(virDomainDefPtr def,
|
|||||||
int *nparams,
|
int *nparams,
|
||||||
int maxparams)
|
int maxparams)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
char *data = NULL;
|
char *data = NULL;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
|
@ -2373,7 +2373,7 @@ xenFormatVfb(virConfPtr conf, virDomainDefPtr def)
|
|||||||
static int
|
static int
|
||||||
xenFormatSound(virConfPtr conf, virDomainDefPtr def)
|
xenFormatSound(virConfPtr conf, virDomainDefPtr def)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
const char * model;
|
const char * model;
|
||||||
VIR_AUTOFREE(char *) str = NULL;
|
VIR_AUTOFREE(char *) str = NULL;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
@ -209,7 +209,7 @@ qemuBuildMasterKeyCommandLine(virCommandPtr cmd,
|
|||||||
{
|
{
|
||||||
VIR_AUTOFREE(char *) alias = NULL;
|
VIR_AUTOFREE(char *) alias = NULL;
|
||||||
VIR_AUTOFREE(char *) path = NULL;
|
VIR_AUTOFREE(char *) path = NULL;
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
/* If the -object secret does not exist, then just return. This just
|
/* If the -object secret does not exist, then just return. This just
|
||||||
* means the domain won't be able to use a secret master key and is
|
* means the domain won't be able to use a secret master key and is
|
||||||
@ -730,7 +730,7 @@ static int
|
|||||||
qemuBuildObjectSecretCommandLine(virCommandPtr cmd,
|
qemuBuildObjectSecretCommandLine(virCommandPtr cmd,
|
||||||
qemuDomainSecretInfoPtr secinfo)
|
qemuDomainSecretInfoPtr secinfo)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOPTR(virJSONValue) props = NULL;
|
VIR_AUTOPTR(virJSONValue) props = NULL;
|
||||||
|
|
||||||
if (qemuBuildSecretInfoProps(secinfo, &props) < 0)
|
if (qemuBuildSecretInfoProps(secinfo, &props) < 0)
|
||||||
@ -921,7 +921,7 @@ qemuBuildTLSx509CommandLine(virCommandPtr cmd,
|
|||||||
const char *alias,
|
const char *alias,
|
||||||
virQEMUCapsPtr qemuCaps)
|
virQEMUCapsPtr qemuCaps)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOPTR(virJSONValue) props = NULL;
|
VIR_AUTOPTR(virJSONValue) props = NULL;
|
||||||
|
|
||||||
if (qemuBuildTLSx509BackendProps(tlspath, isListen, verifypeer, alias,
|
if (qemuBuildTLSx509BackendProps(tlspath, isListen, verifypeer, alias,
|
||||||
@ -962,7 +962,7 @@ static char *
|
|||||||
qemuBuildNetworkDriveStr(virStorageSourcePtr src,
|
qemuBuildNetworkDriveStr(virStorageSourcePtr src,
|
||||||
qemuDomainSecretInfoPtr secinfo)
|
qemuDomainSecretInfoPtr secinfo)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
size_t i;
|
size_t i;
|
||||||
char *ret = NULL;
|
char *ret = NULL;
|
||||||
|
|
||||||
@ -1786,7 +1786,7 @@ static char *
|
|||||||
qemuBuildDriveStr(virDomainDiskDefPtr disk,
|
qemuBuildDriveStr(virDomainDiskDefPtr disk,
|
||||||
virQEMUCapsPtr qemuCaps)
|
virQEMUCapsPtr qemuCaps)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) opt = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) opt = VIR_BUFFER_INITIALIZER;
|
||||||
int detect_zeroes = virDomainDiskGetDetectZeroesMode(disk->discard,
|
int detect_zeroes = virDomainDiskGetDetectZeroesMode(disk->discard,
|
||||||
disk->detect_zeroes);
|
disk->detect_zeroes);
|
||||||
|
|
||||||
@ -1951,7 +1951,7 @@ qemuBuildDiskDeviceStr(const virDomainDef *def,
|
|||||||
unsigned int bootindex,
|
unsigned int bootindex,
|
||||||
virQEMUCapsPtr qemuCaps)
|
virQEMUCapsPtr qemuCaps)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) opt = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) opt = VIR_BUFFER_INITIALIZER;
|
||||||
const char *bus = virDomainDiskQEMUBusTypeToString(disk->bus);
|
const char *bus = virDomainDiskQEMUBusTypeToString(disk->bus);
|
||||||
const char *contAlias;
|
const char *contAlias;
|
||||||
VIR_AUTOFREE(char *) backendAlias = NULL;
|
VIR_AUTOFREE(char *) backendAlias = NULL;
|
||||||
@ -2293,7 +2293,7 @@ qemuBuildDiskDeviceStr(const virDomainDef *def,
|
|||||||
char *
|
char *
|
||||||
qemuBuildZPCIDevStr(virDomainDeviceInfoPtr dev)
|
qemuBuildZPCIDevStr(virDomainDeviceInfoPtr dev)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
virBufferAsprintf(&buf,
|
virBufferAsprintf(&buf,
|
||||||
"zpci,uid=%u,fid=%u,target=%s,id=zpci%u",
|
"zpci,uid=%u,fid=%u,target=%s,id=zpci%u",
|
||||||
@ -2345,7 +2345,7 @@ qemuBuildFloppyCommandLineControllerOptions(virCommandPtr cmd,
|
|||||||
virQEMUCapsPtr qemuCaps,
|
virQEMUCapsPtr qemuCaps,
|
||||||
unsigned int bootFloppy)
|
unsigned int bootFloppy)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) fdc_opts = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) fdc_opts = VIR_BUFFER_INITIALIZER;
|
||||||
bool explicitfdc = qemuDomainNeedsFDC(def);
|
bool explicitfdc = qemuDomainNeedsFDC(def);
|
||||||
bool hasfloppy = false;
|
bool hasfloppy = false;
|
||||||
unsigned int bootindex;
|
unsigned int bootindex;
|
||||||
@ -2422,7 +2422,7 @@ static int
|
|||||||
qemuBuildObjectCommandline(virCommandPtr cmd,
|
qemuBuildObjectCommandline(virCommandPtr cmd,
|
||||||
virJSONValuePtr objProps)
|
virJSONValuePtr objProps)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
if (!objProps)
|
if (!objProps)
|
||||||
return 0;
|
return 0;
|
||||||
@ -2617,7 +2617,7 @@ qemuBuildDisksCommandLine(virCommandPtr cmd,
|
|||||||
static char *
|
static char *
|
||||||
qemuBuildFSStr(virDomainFSDefPtr fs)
|
qemuBuildFSStr(virDomainFSDefPtr fs)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) opt = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) opt = VIR_BUFFER_INITIALIZER;
|
||||||
const char *wrpolicy = virDomainFSWrpolicyTypeToString(fs->wrpolicy);
|
const char *wrpolicy = virDomainFSWrpolicyTypeToString(fs->wrpolicy);
|
||||||
|
|
||||||
if (fs->fsdriver == VIR_DOMAIN_FS_DRIVER_TYPE_PATH ||
|
if (fs->fsdriver == VIR_DOMAIN_FS_DRIVER_TYPE_PATH ||
|
||||||
@ -2657,7 +2657,7 @@ qemuBuildFSDevStr(const virDomainDef *def,
|
|||||||
virDomainFSDefPtr fs,
|
virDomainFSDefPtr fs,
|
||||||
virQEMUCapsPtr qemuCaps)
|
virQEMUCapsPtr qemuCaps)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) opt = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) opt = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
if (qemuBuildVirtioDevStr(&opt, "virtio-9p", qemuCaps,
|
if (qemuBuildVirtioDevStr(&opt, "virtio-9p", qemuCaps,
|
||||||
VIR_DOMAIN_DEVICE_FS, fs) < 0)
|
VIR_DOMAIN_DEVICE_FS, fs) < 0)
|
||||||
@ -2864,7 +2864,7 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
|
|||||||
virQEMUCapsPtr qemuCaps,
|
virQEMUCapsPtr qemuCaps,
|
||||||
char **devstr)
|
char **devstr)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
*devstr = NULL;
|
*devstr = NULL;
|
||||||
|
|
||||||
@ -3643,7 +3643,7 @@ char *
|
|||||||
qemuBuildMemoryDeviceStr(virDomainMemoryDefPtr mem,
|
qemuBuildMemoryDeviceStr(virDomainMemoryDefPtr mem,
|
||||||
qemuDomainObjPrivatePtr priv)
|
qemuDomainObjPrivatePtr priv)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
const char *device;
|
const char *device;
|
||||||
|
|
||||||
if (!mem->info.alias) {
|
if (!mem->info.alias) {
|
||||||
@ -3729,7 +3729,7 @@ qemuBuildNicDevStr(virDomainDefPtr def,
|
|||||||
size_t vhostfdSize,
|
size_t vhostfdSize,
|
||||||
virQEMUCapsPtr qemuCaps)
|
virQEMUCapsPtr qemuCaps)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
bool usingVirtio = false;
|
bool usingVirtio = false;
|
||||||
char macaddr[VIR_MAC_STRING_BUFLEN];
|
char macaddr[VIR_MAC_STRING_BUFLEN];
|
||||||
|
|
||||||
@ -3903,7 +3903,7 @@ qemuBuildHostNetStr(virDomainNetDefPtr net,
|
|||||||
const char *slirpfd)
|
const char *slirpfd)
|
||||||
{
|
{
|
||||||
bool is_tap = false;
|
bool is_tap = false;
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
virDomainNetType netType = virDomainNetGetActualType(net);
|
virDomainNetType netType = virDomainNetGetActualType(net);
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
@ -4046,7 +4046,7 @@ qemuBuildWatchdogDevStr(const virDomainDef *def,
|
|||||||
virDomainWatchdogDefPtr dev,
|
virDomainWatchdogDefPtr dev,
|
||||||
virQEMUCapsPtr qemuCaps)
|
virQEMUCapsPtr qemuCaps)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
const char *model = virDomainWatchdogModelTypeToString(dev->model);
|
const char *model = virDomainWatchdogModelTypeToString(dev->model);
|
||||||
if (!model) {
|
if (!model) {
|
||||||
@ -4114,7 +4114,7 @@ qemuBuildMemballoonCommandLine(virCommandPtr cmd,
|
|||||||
const virDomainDef *def,
|
const virDomainDef *def,
|
||||||
virQEMUCapsPtr qemuCaps)
|
virQEMUCapsPtr qemuCaps)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
if (!virDomainDefHasMemballoon(def))
|
if (!virDomainDefHasMemballoon(def))
|
||||||
return 0;
|
return 0;
|
||||||
@ -4149,7 +4149,7 @@ qemuBuildMemballoonCommandLine(virCommandPtr cmd,
|
|||||||
static char *
|
static char *
|
||||||
qemuBuildNVRAMDevStr(virDomainNVRAMDefPtr dev)
|
qemuBuildNVRAMDevStr(virDomainNVRAMDefPtr dev)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
if (dev->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO &&
|
if (dev->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO &&
|
||||||
dev->info.addr.spaprvio.has_reg) {
|
dev->info.addr.spaprvio.has_reg) {
|
||||||
@ -4205,7 +4205,7 @@ qemuBuildVirtioInputDevStr(const virDomainDef *def,
|
|||||||
virDomainInputDefPtr dev,
|
virDomainInputDefPtr dev,
|
||||||
virQEMUCapsPtr qemuCaps)
|
virQEMUCapsPtr qemuCaps)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
switch ((virDomainInputType)dev->type) {
|
switch ((virDomainInputType)dev->type) {
|
||||||
case VIR_DOMAIN_INPUT_TYPE_MOUSE:
|
case VIR_DOMAIN_INPUT_TYPE_MOUSE:
|
||||||
@ -4262,7 +4262,7 @@ qemuBuildUSBInputDevStr(const virDomainDef *def,
|
|||||||
virDomainInputDefPtr dev,
|
virDomainInputDefPtr dev,
|
||||||
virQEMUCapsPtr qemuCaps)
|
virQEMUCapsPtr qemuCaps)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
switch (dev->type) {
|
switch (dev->type) {
|
||||||
case VIR_DOMAIN_INPUT_TYPE_MOUSE:
|
case VIR_DOMAIN_INPUT_TYPE_MOUSE:
|
||||||
@ -4345,7 +4345,7 @@ qemuBuildSoundDevStr(const virDomainDef *def,
|
|||||||
virDomainSoundDefPtr sound,
|
virDomainSoundDefPtr sound,
|
||||||
virQEMUCapsPtr qemuCaps)
|
virQEMUCapsPtr qemuCaps)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
const char *model = NULL;
|
const char *model = NULL;
|
||||||
|
|
||||||
/* Hack for devices with different names in QEMU and libvirt */
|
/* Hack for devices with different names in QEMU and libvirt */
|
||||||
@ -4420,7 +4420,7 @@ qemuBuildSoundCodecStr(virDomainSoundDefPtr sound,
|
|||||||
virDomainSoundCodecDefPtr codec,
|
virDomainSoundCodecDefPtr codec,
|
||||||
virQEMUCapsPtr qemuCaps)
|
virQEMUCapsPtr qemuCaps)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
const char *stype;
|
const char *stype;
|
||||||
int type, flags;
|
int type, flags;
|
||||||
|
|
||||||
@ -4508,7 +4508,7 @@ qemuBuildDeviceVideoStr(const virDomainDef *def,
|
|||||||
virDomainVideoDefPtr video,
|
virDomainVideoDefPtr video,
|
||||||
virQEMUCapsPtr qemuCaps)
|
virQEMUCapsPtr qemuCaps)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
const char *model = NULL;
|
const char *model = NULL;
|
||||||
|
|
||||||
/* We try to chose the best model for primary video device by preferring
|
/* We try to chose the best model for primary video device by preferring
|
||||||
@ -4784,7 +4784,7 @@ qemuBuildPCIHostdevDevStr(const virDomainDef *def,
|
|||||||
unsigned int bootIndex, /* used iff dev->info->bootIndex == 0 */
|
unsigned int bootIndex, /* used iff dev->info->bootIndex == 0 */
|
||||||
virQEMUCapsPtr qemuCaps)
|
virQEMUCapsPtr qemuCaps)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
virDomainHostdevSubsysPCIPtr pcisrc = &dev->source.subsys.u.pci;
|
virDomainHostdevSubsysPCIPtr pcisrc = &dev->source.subsys.u.pci;
|
||||||
int backend = pcisrc->backend;
|
int backend = pcisrc->backend;
|
||||||
|
|
||||||
@ -4833,7 +4833,7 @@ qemuBuildUSBHostdevDevStr(const virDomainDef *def,
|
|||||||
virDomainHostdevDefPtr dev,
|
virDomainHostdevDefPtr dev,
|
||||||
virQEMUCapsPtr qemuCaps)
|
virQEMUCapsPtr qemuCaps)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
virDomainHostdevSubsysUSBPtr usbsrc = &dev->source.subsys.u.usb;
|
virDomainHostdevSubsysUSBPtr usbsrc = &dev->source.subsys.u.usb;
|
||||||
|
|
||||||
if (!dev->missing && !usbsrc->bus && !usbsrc->device) {
|
if (!dev->missing && !usbsrc->bus && !usbsrc->device) {
|
||||||
@ -4866,7 +4866,7 @@ qemuBuildHubDevStr(const virDomainDef *def,
|
|||||||
virDomainHubDefPtr dev,
|
virDomainHubDefPtr dev,
|
||||||
virQEMUCapsPtr qemuCaps)
|
virQEMUCapsPtr qemuCaps)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
if (dev->type != VIR_DOMAIN_HUB_TYPE_USB) {
|
if (dev->type != VIR_DOMAIN_HUB_TYPE_USB) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
@ -4931,7 +4931,7 @@ static char *
|
|||||||
qemuBuildSCSIiSCSIHostdevDrvStr(virDomainHostdevDefPtr dev,
|
qemuBuildSCSIiSCSIHostdevDrvStr(virDomainHostdevDefPtr dev,
|
||||||
virQEMUCapsPtr qemuCaps)
|
virQEMUCapsPtr qemuCaps)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOFREE(char *) netsource = NULL;
|
VIR_AUTOFREE(char *) netsource = NULL;
|
||||||
VIR_AUTOPTR(virJSONValue) srcprops = NULL;
|
VIR_AUTOPTR(virJSONValue) srcprops = NULL;
|
||||||
virDomainHostdevSubsysSCSIPtr scsisrc = &dev->source.subsys.u.scsi;
|
virDomainHostdevSubsysSCSIPtr scsisrc = &dev->source.subsys.u.scsi;
|
||||||
@ -4967,7 +4967,7 @@ qemuBuildSCSIVHostHostdevDevStr(const virDomainDef *def,
|
|||||||
virQEMUCapsPtr qemuCaps,
|
virQEMUCapsPtr qemuCaps,
|
||||||
char *vhostfdName)
|
char *vhostfdName)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
virDomainHostdevSubsysSCSIVHostPtr hostsrc = &dev->source.subsys.u.scsi_host;
|
virDomainHostdevSubsysSCSIVHostPtr hostsrc = &dev->source.subsys.u.scsi_host;
|
||||||
|
|
||||||
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VHOST_SCSI)) {
|
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VHOST_SCSI)) {
|
||||||
@ -4999,7 +4999,7 @@ char *
|
|||||||
qemuBuildSCSIHostdevDrvStr(virDomainHostdevDefPtr dev,
|
qemuBuildSCSIHostdevDrvStr(virDomainHostdevDefPtr dev,
|
||||||
virQEMUCapsPtr qemuCaps)
|
virQEMUCapsPtr qemuCaps)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOFREE(char *) source = NULL;
|
VIR_AUTOFREE(char *) source = NULL;
|
||||||
VIR_AUTOFREE(char *) drivealias = NULL;
|
VIR_AUTOFREE(char *) drivealias = NULL;
|
||||||
virDomainHostdevSubsysSCSIPtr scsisrc = &dev->source.subsys.u.scsi;
|
virDomainHostdevSubsysSCSIPtr scsisrc = &dev->source.subsys.u.scsi;
|
||||||
@ -5031,7 +5031,7 @@ char *
|
|||||||
qemuBuildSCSIHostdevDevStr(const virDomainDef *def,
|
qemuBuildSCSIHostdevDevStr(const virDomainDef *def,
|
||||||
virDomainHostdevDefPtr dev)
|
virDomainHostdevDefPtr dev)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
int model = -1;
|
int model = -1;
|
||||||
VIR_AUTOFREE(char *) driveAlias = NULL;
|
VIR_AUTOFREE(char *) driveAlias = NULL;
|
||||||
const char *contAlias;
|
const char *contAlias;
|
||||||
@ -5228,7 +5228,7 @@ qemuBuildChrChardevStr(virLogManagerPtr logManager,
|
|||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
qemuDomainChrSourcePrivatePtr chrSourcePriv = QEMU_DOMAIN_CHR_SOURCE_PRIVATE(dev);
|
qemuDomainChrSourcePrivatePtr chrSourcePriv = QEMU_DOMAIN_CHR_SOURCE_PRIVATE(dev);
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
bool telnet;
|
bool telnet;
|
||||||
VIR_AUTOFREE(char *) charAlias = NULL;
|
VIR_AUTOFREE(char *) charAlias = NULL;
|
||||||
|
|
||||||
@ -5422,7 +5422,7 @@ qemuBuildHostdevMediatedDevStr(const virDomainDef *def,
|
|||||||
virDomainHostdevDefPtr dev,
|
virDomainHostdevDefPtr dev,
|
||||||
virQEMUCapsPtr qemuCaps)
|
virQEMUCapsPtr qemuCaps)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
virDomainHostdevSubsysMediatedDevPtr mdevsrc = &dev->source.subsys.u.mdev;
|
virDomainHostdevSubsysMediatedDevPtr mdevsrc = &dev->source.subsys.u.mdev;
|
||||||
VIR_AUTOFREE(char *) mdevPath = NULL;
|
VIR_AUTOFREE(char *) mdevPath = NULL;
|
||||||
const char *dev_str = NULL;
|
const char *dev_str = NULL;
|
||||||
@ -5656,7 +5656,7 @@ static char *
|
|||||||
qemuBuildVirtioSerialPortDevStr(const virDomainDef *def,
|
qemuBuildVirtioSerialPortDevStr(const virDomainDef *def,
|
||||||
virDomainChrDefPtr dev)
|
virDomainChrDefPtr dev)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
const char *contAlias;
|
const char *contAlias;
|
||||||
|
|
||||||
switch (dev->deviceType) {
|
switch (dev->deviceType) {
|
||||||
@ -5719,7 +5719,7 @@ qemuBuildVirtioSerialPortDevStr(const virDomainDef *def,
|
|||||||
static char *
|
static char *
|
||||||
qemuBuildSclpDevStr(virDomainChrDefPtr dev)
|
qemuBuildSclpDevStr(virDomainChrDefPtr dev)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
if (dev->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE) {
|
if (dev->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE) {
|
||||||
switch (dev->targetType) {
|
switch (dev->targetType) {
|
||||||
case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLP:
|
case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLP:
|
||||||
@ -5841,7 +5841,7 @@ qemuBuildRNGDevStr(const virDomainDef *def,
|
|||||||
virDomainRNGDefPtr dev,
|
virDomainRNGDefPtr dev,
|
||||||
virQEMUCapsPtr qemuCaps)
|
virQEMUCapsPtr qemuCaps)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
if (!qemuDomainCheckCCWS390AddressSupport(def, &dev->info, qemuCaps,
|
if (!qemuDomainCheckCCWS390AddressSupport(def, &dev->info, qemuCaps,
|
||||||
dev->source.file))
|
dev->source.file))
|
||||||
@ -5936,7 +5936,7 @@ qemuBuildRNGCommandLine(virLogManagerPtr logManager,
|
|||||||
static char *
|
static char *
|
||||||
qemuBuildSmbiosBiosStr(virSysinfoBIOSDefPtr def)
|
qemuBuildSmbiosBiosStr(virSysinfoBIOSDefPtr def)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
if (!def)
|
if (!def)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -5972,7 +5972,7 @@ static char *
|
|||||||
qemuBuildSmbiosSystemStr(virSysinfoSystemDefPtr def,
|
qemuBuildSmbiosSystemStr(virSysinfoSystemDefPtr def,
|
||||||
bool skip_uuid)
|
bool skip_uuid)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
if (!def ||
|
if (!def ||
|
||||||
(!def->manufacturer && !def->product && !def->version &&
|
(!def->manufacturer && !def->product && !def->version &&
|
||||||
@ -6025,7 +6025,7 @@ qemuBuildSmbiosSystemStr(virSysinfoSystemDefPtr def,
|
|||||||
static char *
|
static char *
|
||||||
qemuBuildSmbiosBaseBoardStr(virSysinfoBaseBoardDefPtr def)
|
qemuBuildSmbiosBaseBoardStr(virSysinfoBaseBoardDefPtr def)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
if (!def)
|
if (!def)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -6071,7 +6071,7 @@ qemuBuildSmbiosBaseBoardStr(virSysinfoBaseBoardDefPtr def)
|
|||||||
static char *
|
static char *
|
||||||
qemuBuildSmbiosOEMStringsStr(virSysinfoOEMStringsDefPtr def)
|
qemuBuildSmbiosOEMStringsStr(virSysinfoOEMStringsDefPtr def)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
if (!def)
|
if (!def)
|
||||||
@ -6091,7 +6091,7 @@ qemuBuildSmbiosOEMStringsStr(virSysinfoOEMStringsDefPtr def)
|
|||||||
static char *
|
static char *
|
||||||
qemuBuildSmbiosChassisStr(virSysinfoChassisDefPtr def)
|
qemuBuildSmbiosChassisStr(virSysinfoChassisDefPtr def)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
if (!def)
|
if (!def)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -6216,7 +6216,7 @@ qemuBuildVMGenIDCommandLine(virCommandPtr cmd,
|
|||||||
const virDomainDef *def,
|
const virDomainDef *def,
|
||||||
virQEMUCapsPtr qemuCaps)
|
virQEMUCapsPtr qemuCaps)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) opts = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) opts = VIR_BUFFER_INITIALIZER;
|
||||||
char guid[VIR_UUID_STRING_BUFLEN];
|
char guid[VIR_UUID_STRING_BUFLEN];
|
||||||
|
|
||||||
if (!def->genidRequested)
|
if (!def->genidRequested)
|
||||||
@ -6266,7 +6266,7 @@ static char *
|
|||||||
qemuBuildClockArgStr(virDomainClockDefPtr def)
|
qemuBuildClockArgStr(virDomainClockDefPtr def)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
switch (def->offset) {
|
switch (def->offset) {
|
||||||
case VIR_DOMAIN_CLOCK_OFFSET_UTC:
|
case VIR_DOMAIN_CLOCK_OFFSET_UTC:
|
||||||
@ -6547,7 +6547,7 @@ qemuBuildBootCommandLine(virCommandPtr cmd,
|
|||||||
const virDomainDef *def,
|
const virDomainDef *def,
|
||||||
virQEMUCapsPtr qemuCaps)
|
virQEMUCapsPtr qemuCaps)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) boot_buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) boot_buf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOFREE(char *) boot_opts_str = NULL;
|
VIR_AUTOFREE(char *) boot_opts_str = NULL;
|
||||||
|
|
||||||
if (def->os.bootmenu) {
|
if (def->os.bootmenu) {
|
||||||
@ -6627,7 +6627,7 @@ qemuBuildIOMMUCommandLine(virCommandPtr cmd,
|
|||||||
|
|
||||||
switch (iommu->model) {
|
switch (iommu->model) {
|
||||||
case VIR_DOMAIN_IOMMU_MODEL_INTEL: {
|
case VIR_DOMAIN_IOMMU_MODEL_INTEL: {
|
||||||
VIR_AUTOCLEAN(virBuffer) opts = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) opts = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
/* qemuDomainDeviceDefValidateIOMMU() already made sure we have
|
/* qemuDomainDeviceDefValidateIOMMU() already made sure we have
|
||||||
* one of QEMU_CAPS_DEVICE_INTEL_IOMMU or QEMU_CAPS_MACHINE_IOMMU:
|
* one of QEMU_CAPS_DEVICE_INTEL_IOMMU or QEMU_CAPS_MACHINE_IOMMU:
|
||||||
@ -6841,8 +6841,8 @@ qemuBuildCpuCommandLine(virCommandPtr cmd,
|
|||||||
virArch hostarch = virArchFromHost();
|
virArch hostarch = virArchFromHost();
|
||||||
VIR_AUTOFREE(char *) cpu = NULL;
|
VIR_AUTOFREE(char *) cpu = NULL;
|
||||||
VIR_AUTOFREE(char *) cpu_flags = NULL;
|
VIR_AUTOFREE(char *) cpu_flags = NULL;
|
||||||
VIR_AUTOCLEAN(virBuffer) cpu_buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) cpu_buf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
if (def->cpu &&
|
if (def->cpu &&
|
||||||
@ -7119,7 +7119,7 @@ qemuBuildNameCommandLine(virCommandPtr cmd,
|
|||||||
const virDomainDef *def,
|
const virDomainDef *def,
|
||||||
virQEMUCapsPtr qemuCaps)
|
virQEMUCapsPtr qemuCaps)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
virCommandAddArg(cmd, "-name");
|
virCommandAddArg(cmd, "-name");
|
||||||
|
|
||||||
@ -7149,7 +7149,7 @@ qemuBuildMachineCommandLine(virCommandPtr cmd,
|
|||||||
virTristateSwitch vmport = def->features[VIR_DOMAIN_FEATURE_VMPORT];
|
virTristateSwitch vmport = def->features[VIR_DOMAIN_FEATURE_VMPORT];
|
||||||
virTristateSwitch smm = def->features[VIR_DOMAIN_FEATURE_SMM];
|
virTristateSwitch smm = def->features[VIR_DOMAIN_FEATURE_SMM];
|
||||||
virCPUDefPtr cpu = def->cpu;
|
virCPUDefPtr cpu = def->cpu;
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
/* This should *never* be NULL, since we always provide
|
/* This should *never* be NULL, since we always provide
|
||||||
@ -7469,7 +7469,7 @@ static int
|
|||||||
qemuBuildSmpCommandLine(virCommandPtr cmd,
|
qemuBuildSmpCommandLine(virCommandPtr cmd,
|
||||||
virDomainDefPtr def)
|
virDomainDefPtr def)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
unsigned int maxvcpus = virDomainDefGetVcpusMax(def);
|
unsigned int maxvcpus = virDomainDefGetVcpusMax(def);
|
||||||
unsigned int nvcpus = 0;
|
unsigned int nvcpus = 0;
|
||||||
virDomainVcpuDefPtr vcpu;
|
virDomainVcpuDefPtr vcpu;
|
||||||
@ -7630,7 +7630,7 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg,
|
|||||||
{
|
{
|
||||||
size_t i, j;
|
size_t i, j;
|
||||||
virQEMUCapsPtr qemuCaps = priv->qemuCaps;
|
virQEMUCapsPtr qemuCaps = priv->qemuCaps;
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
char *cpumask = NULL;
|
char *cpumask = NULL;
|
||||||
char *tmpmask = NULL;
|
char *tmpmask = NULL;
|
||||||
char *next = NULL;
|
char *next = NULL;
|
||||||
@ -7793,7 +7793,7 @@ qemuBuildMemoryDeviceCommandLine(virCommandPtr cmd,
|
|||||||
/* memory hotplug requires NUMA to be enabled - we already checked
|
/* memory hotplug requires NUMA to be enabled - we already checked
|
||||||
* that memory devices are present only when NUMA is */
|
* that memory devices are present only when NUMA is */
|
||||||
for (i = 0; i < def->nmems; i++) {
|
for (i = 0; i < def->nmems; i++) {
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
char *dimmStr;
|
char *dimmStr;
|
||||||
|
|
||||||
if (qemuBuildMemoryDimmBackendStr(&buf, def->mems[i], def, cfg, priv) < 0)
|
if (qemuBuildMemoryDimmBackendStr(&buf, def->mems[i], def, cfg, priv) < 0)
|
||||||
@ -7820,7 +7820,7 @@ qemuBuildGraphicsSDLCommandLine(virQEMUDriverConfigPtr cfg G_GNUC_UNUSED,
|
|||||||
virQEMUCapsPtr qemuCaps G_GNUC_UNUSED,
|
virQEMUCapsPtr qemuCaps G_GNUC_UNUSED,
|
||||||
virDomainGraphicsDefPtr graphics)
|
virDomainGraphicsDefPtr graphics)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) opt = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) opt = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
if (graphics->data.sdl.xauth)
|
if (graphics->data.sdl.xauth)
|
||||||
virCommandAddEnvPair(cmd, "XAUTHORITY", graphics->data.sdl.xauth);
|
virCommandAddEnvPair(cmd, "XAUTHORITY", graphics->data.sdl.xauth);
|
||||||
@ -7867,7 +7867,7 @@ qemuBuildGraphicsVNCCommandLine(virQEMUDriverConfigPtr cfg,
|
|||||||
virQEMUCapsPtr qemuCaps,
|
virQEMUCapsPtr qemuCaps,
|
||||||
virDomainGraphicsDefPtr graphics)
|
virDomainGraphicsDefPtr graphics)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) opt = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) opt = VIR_BUFFER_INITIALIZER;
|
||||||
virDomainGraphicsListenDefPtr glisten = NULL;
|
virDomainGraphicsListenDefPtr glisten = NULL;
|
||||||
bool escapeAddr;
|
bool escapeAddr;
|
||||||
|
|
||||||
@ -8000,7 +8000,7 @@ qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfigPtr cfg,
|
|||||||
virQEMUCapsPtr qemuCaps,
|
virQEMUCapsPtr qemuCaps,
|
||||||
virDomainGraphicsDefPtr graphics)
|
virDomainGraphicsDefPtr graphics)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) opt = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) opt = VIR_BUFFER_INITIALIZER;
|
||||||
virDomainGraphicsListenDefPtr glisten = NULL;
|
virDomainGraphicsListenDefPtr glisten = NULL;
|
||||||
int port = graphics->data.spice.port;
|
int port = graphics->data.spice.port;
|
||||||
int tlsPort = graphics->data.spice.tlsPort;
|
int tlsPort = graphics->data.spice.tlsPort;
|
||||||
@ -8248,7 +8248,7 @@ qemuBuildGraphicsEGLHeadlessCommandLine(virQEMUDriverConfigPtr cfg G_GNUC_UNUSED
|
|||||||
virQEMUCapsPtr qemuCaps,
|
virQEMUCapsPtr qemuCaps,
|
||||||
virDomainGraphicsDefPtr graphics)
|
virDomainGraphicsDefPtr graphics)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) opt = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) opt = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
virBufferAddLit(&opt, "egl-headless");
|
virBufferAddLit(&opt, "egl-headless");
|
||||||
|
|
||||||
@ -8777,7 +8777,7 @@ qemuBuildSmartcardCommandLine(virLogManagerPtr logManager,
|
|||||||
size_t i;
|
size_t i;
|
||||||
virDomainSmartcardDefPtr smartcard;
|
virDomainSmartcardDefPtr smartcard;
|
||||||
VIR_AUTOFREE(char *) devstr = NULL;
|
VIR_AUTOFREE(char *) devstr = NULL;
|
||||||
VIR_AUTOCLEAN(virBuffer) opt = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) opt = VIR_BUFFER_INITIALIZER;
|
||||||
const char *database;
|
const char *database;
|
||||||
const char *contAlias = NULL;
|
const char *contAlias = NULL;
|
||||||
unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT |
|
unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT |
|
||||||
@ -8886,7 +8886,7 @@ qemuBuildShmemDevLegacyStr(virDomainDefPtr def,
|
|||||||
virDomainShmemDefPtr shmem,
|
virDomainShmemDefPtr shmem,
|
||||||
virQEMUCapsPtr qemuCaps)
|
virQEMUCapsPtr qemuCaps)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_IVSHMEM)) {
|
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_IVSHMEM)) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
@ -8929,7 +8929,7 @@ qemuBuildShmemDevStr(virDomainDefPtr def,
|
|||||||
virDomainShmemDefPtr shmem,
|
virDomainShmemDefPtr shmem,
|
||||||
virQEMUCapsPtr qemuCaps)
|
virQEMUCapsPtr qemuCaps)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
if ((shmem->model == VIR_DOMAIN_SHMEM_MODEL_IVSHMEM_PLAIN &&
|
if ((shmem->model == VIR_DOMAIN_SHMEM_MODEL_IVSHMEM_PLAIN &&
|
||||||
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_IVSHMEM_PLAIN)) ||
|
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_IVSHMEM_PLAIN)) ||
|
||||||
@ -9001,7 +9001,7 @@ qemuBuildShmemCommandLine(virLogManagerPtr logManager,
|
|||||||
bool chardevStdioLogd)
|
bool chardevStdioLogd)
|
||||||
{
|
{
|
||||||
VIR_AUTOPTR(virJSONValue) memProps = NULL;
|
VIR_AUTOPTR(virJSONValue) memProps = NULL;
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOFREE(char *) devstr = NULL;
|
VIR_AUTOFREE(char *) devstr = NULL;
|
||||||
VIR_AUTOFREE(char *) chardev = NULL;
|
VIR_AUTOFREE(char *) chardev = NULL;
|
||||||
int rc;
|
int rc;
|
||||||
@ -9426,7 +9426,7 @@ qemuBuildRedirdevDevStr(const virDomainDef *def,
|
|||||||
virQEMUCapsPtr qemuCaps)
|
virQEMUCapsPtr qemuCaps)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
virDomainRedirFilterDefPtr redirfilter = def->redirfilter;
|
virDomainRedirFilterDefPtr redirfilter = def->redirfilter;
|
||||||
|
|
||||||
if (dev->bus != VIR_DOMAIN_REDIRDEV_BUS_USB) {
|
if (dev->bus != VIR_DOMAIN_REDIRDEV_BUS_USB) {
|
||||||
@ -9544,7 +9544,7 @@ qemuBuildDomainLoaderCommandLine(virCommandPtr cmd,
|
|||||||
virDomainDefPtr def)
|
virDomainDefPtr def)
|
||||||
{
|
{
|
||||||
virDomainLoaderDefPtr loader = def->os.loader;
|
virDomainLoaderDefPtr loader = def->os.loader;
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
int unit = 0;
|
int unit = 0;
|
||||||
|
|
||||||
if (!loader)
|
if (!loader)
|
||||||
@ -9601,7 +9601,7 @@ static char *
|
|||||||
qemuBuildTPMDevStr(const virDomainDef *def,
|
qemuBuildTPMDevStr(const virDomainDef *def,
|
||||||
virQEMUCapsPtr qemuCaps)
|
virQEMUCapsPtr qemuCaps)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
const virDomainTPMDef *tpm = def->tpm;
|
const virDomainTPMDef *tpm = def->tpm;
|
||||||
const char *model = virDomainTPMModelTypeToString(tpm->model);
|
const char *model = virDomainTPMModelTypeToString(tpm->model);
|
||||||
virQEMUCapsFlags flag;
|
virQEMUCapsFlags flag;
|
||||||
@ -9670,7 +9670,7 @@ qemuBuildTPMBackendStr(const virDomainDef *def,
|
|||||||
char **chardev)
|
char **chardev)
|
||||||
{
|
{
|
||||||
const virDomainTPMDef *tpm = def->tpm;
|
const virDomainTPMDef *tpm = def->tpm;
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOFREE(char *) cancel_path = NULL;
|
VIR_AUTOFREE(char *) cancel_path = NULL;
|
||||||
VIR_AUTOFREE(char *) devset = NULL;
|
VIR_AUTOFREE(char *) devset = NULL;
|
||||||
VIR_AUTOFREE(char *) cancelset = NULL;
|
VIR_AUTOFREE(char *) cancelset = NULL;
|
||||||
@ -9780,7 +9780,7 @@ static int
|
|||||||
qemuBuildSEVCommandLine(virDomainObjPtr vm, virCommandPtr cmd,
|
qemuBuildSEVCommandLine(virDomainObjPtr vm, virCommandPtr cmd,
|
||||||
virDomainSEVDefPtr sev)
|
virDomainSEVDefPtr sev)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
qemuDomainObjPrivatePtr priv = vm->privateData;
|
qemuDomainObjPrivatePtr priv = vm->privateData;
|
||||||
char *path = NULL;
|
char *path = NULL;
|
||||||
|
|
||||||
@ -9990,7 +9990,7 @@ qemuBuildManagedPRCommandLine(virCommandPtr cmd,
|
|||||||
const virDomainDef *def,
|
const virDomainDef *def,
|
||||||
qemuDomainObjPrivatePtr priv)
|
qemuDomainObjPrivatePtr priv)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOPTR(virJSONValue) props = NULL;
|
VIR_AUTOPTR(virJSONValue) props = NULL;
|
||||||
|
|
||||||
if (!virDomainDefHasManagedPR(def))
|
if (!virDomainDefHasManagedPR(def))
|
||||||
@ -10049,7 +10049,7 @@ qemuBuildDBusVMStateCommandLineEach(void *payload,
|
|||||||
{
|
{
|
||||||
qemuBuildDBusVMStateCommandLineData *data = user_data;
|
qemuBuildDBusVMStateCommandLineData *data = user_data;
|
||||||
qemuDBusVMStatePtr vms = payload;
|
qemuDBusVMStatePtr vms = payload;
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOPTR(virJSONValue) props = NULL;
|
VIR_AUTOPTR(virJSONValue) props = NULL;
|
||||||
|
|
||||||
if (!(props = qemuBuildDBusVMStateInfoProps(id, vms->addr)))
|
if (!(props = qemuBuildDBusVMStateInfoProps(id, vms->addr)))
|
||||||
@ -10213,7 +10213,7 @@ qemuBuildVsockDevStr(virDomainDefPtr def,
|
|||||||
const char *fdprefix)
|
const char *fdprefix)
|
||||||
{
|
{
|
||||||
qemuDomainVsockPrivatePtr priv = (qemuDomainVsockPrivatePtr)vsock->privateData;
|
qemuDomainVsockPrivatePtr priv = (qemuDomainVsockPrivatePtr)vsock->privateData;
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
if (qemuBuildVirtioDevStr(&buf, "vhost-vsock", qemuCaps,
|
if (qemuBuildVirtioDevStr(&buf, "vhost-vsock", qemuCaps,
|
||||||
VIR_DOMAIN_DEVICE_VSOCK, vsock) < 0) {
|
VIR_DOMAIN_DEVICE_VSOCK, vsock) < 0) {
|
||||||
@ -10548,7 +10548,7 @@ qemuBuildSerialChrDeviceStr(char **deviceStr,
|
|||||||
virDomainChrDefPtr serial,
|
virDomainChrDefPtr serial,
|
||||||
virQEMUCapsPtr qemuCaps)
|
virQEMUCapsPtr qemuCaps)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
virQEMUCapsFlags caps;
|
virQEMUCapsFlags caps;
|
||||||
|
|
||||||
switch ((virDomainChrSerialTargetModel) serial->targetModel) {
|
switch ((virDomainChrSerialTargetModel) serial->targetModel) {
|
||||||
|
@ -2301,7 +2301,7 @@ static int
|
|||||||
qemuStorageSourcePrivateDataFormat(virStorageSourcePtr src,
|
qemuStorageSourcePrivateDataFormat(virStorageSourcePtr src,
|
||||||
virBufferPtr buf)
|
virBufferPtr buf)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) tmp = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) tmp = VIR_BUFFER_INITIALIZER;
|
||||||
qemuDomainStorageSourcePrivatePtr srcPriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src);
|
qemuDomainStorageSourcePrivatePtr srcPriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src);
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
@ -2447,8 +2447,8 @@ qemuDomainObjPrivateXMLFormatBlockjobFormatSource(virBufferPtr buf,
|
|||||||
virDomainXMLOptionPtr xmlopt,
|
virDomainXMLOptionPtr xmlopt,
|
||||||
bool chain)
|
bool chain)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOCLEAN(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
||||||
unsigned int xmlflags = VIR_DOMAIN_DEF_FORMAT_STATUS;
|
unsigned int xmlflags = VIR_DOMAIN_DEF_FORMAT_STATUS;
|
||||||
|
|
||||||
virBufferSetChildIndent(&childBuf, buf);
|
virBufferSetChildIndent(&childBuf, buf);
|
||||||
@ -2476,9 +2476,9 @@ qemuDomainObjPrivateXMLFormatBlockjobIterator(void *payload,
|
|||||||
const void *name G_GNUC_UNUSED,
|
const void *name G_GNUC_UNUSED,
|
||||||
void *opaque)
|
void *opaque)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOCLEAN(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOCLEAN(virBuffer) chainsBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) chainsBuf = VIR_BUFFER_INITIALIZER;
|
||||||
qemuBlockJobDataPtr job = payload;
|
qemuBlockJobDataPtr job = payload;
|
||||||
const char *state = qemuBlockjobStateTypeToString(job->state);
|
const char *state = qemuBlockjobStateTypeToString(job->state);
|
||||||
const char *newstate = NULL;
|
const char *newstate = NULL;
|
||||||
@ -2571,8 +2571,8 @@ qemuDomainObjPrivateXMLFormatBlockjobs(virBufferPtr buf,
|
|||||||
virDomainObjPtr vm)
|
virDomainObjPtr vm)
|
||||||
{
|
{
|
||||||
qemuDomainObjPrivatePtr priv = vm->privateData;
|
qemuDomainObjPrivatePtr priv = vm->privateData;
|
||||||
VIR_AUTOCLEAN(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOCLEAN(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
||||||
bool bj = qemuDomainHasBlockjob(vm, false);
|
bool bj = qemuDomainHasBlockjob(vm, false);
|
||||||
struct qemuDomainPrivateBlockJobFormatData iterdata = { priv->driver->xmlopt,
|
struct qemuDomainPrivateBlockJobFormatData iterdata = { priv->driver->xmlopt,
|
||||||
&childBuf };
|
&childBuf };
|
||||||
@ -2616,8 +2616,8 @@ qemuDomainObjPrivateXMLFormatNBDMigrationSource(virBufferPtr buf,
|
|||||||
virStorageSourcePtr src,
|
virStorageSourcePtr src,
|
||||||
virDomainXMLOptionPtr xmlopt)
|
virDomainXMLOptionPtr xmlopt)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOCLEAN(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
virBufferSetChildIndent(&childBuf, buf);
|
virBufferSetChildIndent(&childBuf, buf);
|
||||||
@ -2645,8 +2645,8 @@ qemuDomainObjPrivateXMLFormatNBDMigration(virBufferPtr buf,
|
|||||||
virDomainObjPtr vm)
|
virDomainObjPtr vm)
|
||||||
{
|
{
|
||||||
qemuDomainObjPrivatePtr priv = vm->privateData;
|
qemuDomainObjPrivatePtr priv = vm->privateData;
|
||||||
VIR_AUTOCLEAN(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOCLEAN(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
||||||
size_t i;
|
size_t i;
|
||||||
virDomainDiskDefPtr disk;
|
virDomainDiskDefPtr disk;
|
||||||
qemuDomainDiskPrivatePtr diskPriv;
|
qemuDomainDiskPrivatePtr diskPriv;
|
||||||
@ -2683,8 +2683,8 @@ qemuDomainObjPrivateXMLFormatJob(virBufferPtr buf,
|
|||||||
virDomainObjPtr vm,
|
virDomainObjPtr vm,
|
||||||
qemuDomainObjPrivatePtr priv)
|
qemuDomainObjPrivatePtr priv)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOCLEAN(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
||||||
qemuDomainJob job = priv->job.active;
|
qemuDomainJob job = priv->job.active;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
|
@ -290,7 +290,7 @@ qemuFirmwareInterfaceParse(const char *path,
|
|||||||
{
|
{
|
||||||
virJSONValuePtr interfacesJSON;
|
virJSONValuePtr interfacesJSON;
|
||||||
VIR_AUTOPTR(qemuFirmwareOSInterface) interfaces = NULL;
|
VIR_AUTOPTR(qemuFirmwareOSInterface) interfaces = NULL;
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
size_t ninterfaces;
|
size_t ninterfaces;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
|
@ -302,7 +302,7 @@ qemuMonitorJSONCommandWithFd(qemuMonitorPtr mon,
|
|||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
qemuMonitorMessage msg;
|
qemuMonitorMessage msg;
|
||||||
VIR_AUTOCLEAN(virBuffer) cmdbuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) cmdbuf = VIR_BUFFER_INITIALIZER;
|
||||||
char *id = NULL;
|
char *id = NULL;
|
||||||
|
|
||||||
*reply = NULL;
|
*reply = NULL;
|
||||||
|
@ -55,7 +55,7 @@ int virBufferCheckErrorInternal(const virBuffer *buf,
|
|||||||
size_t linenr)
|
size_t linenr)
|
||||||
ATTRIBUTE_NONNULL(1);
|
ATTRIBUTE_NONNULL(1);
|
||||||
|
|
||||||
VIR_DEFINE_AUTOCLEAN_FUNC(virBuffer, virBufferFreeAndReset);
|
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(virBuffer, virBufferFreeAndReset);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* virBufferCheckError
|
* virBufferCheckError
|
||||||
|
@ -2025,7 +2025,7 @@ char *
|
|||||||
virJSONValueToString(virJSONValuePtr object,
|
virJSONValueToString(virJSONValuePtr object,
|
||||||
bool pretty)
|
bool pretty)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
if (virJSONValueToBuffer(object, &buf, pretty) < 0)
|
if (virJSONValueToBuffer(object, &buf, pretty) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -48,7 +48,7 @@ testBackingXMLjsonXML(const void *args)
|
|||||||
const struct testBackingXMLjsonXMLdata *data = args;
|
const struct testBackingXMLjsonXMLdata *data = args;
|
||||||
VIR_AUTOPTR(xmlDoc) xml = NULL;
|
VIR_AUTOPTR(xmlDoc) xml = NULL;
|
||||||
VIR_AUTOPTR(xmlXPathContext) ctxt = NULL;
|
VIR_AUTOPTR(xmlXPathContext) ctxt = NULL;
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOPTR(virJSONValue) backendprops = NULL;
|
VIR_AUTOPTR(virJSONValue) backendprops = NULL;
|
||||||
VIR_AUTOPTR(virJSONValue) wrapper = NULL;
|
VIR_AUTOPTR(virJSONValue) wrapper = NULL;
|
||||||
VIR_AUTOFREE(char *) propsstr = NULL;
|
VIR_AUTOFREE(char *) propsstr = NULL;
|
||||||
@ -401,8 +401,8 @@ testQemuImageCreate(const void *opaque)
|
|||||||
VIR_AUTOPTR(virJSONValue) protocolprops = NULL;
|
VIR_AUTOPTR(virJSONValue) protocolprops = NULL;
|
||||||
VIR_AUTOPTR(virJSONValue) formatprops = NULL;
|
VIR_AUTOPTR(virJSONValue) formatprops = NULL;
|
||||||
VIR_AUTOUNREF(virStorageSourcePtr) src = NULL;
|
VIR_AUTOUNREF(virStorageSourcePtr) src = NULL;
|
||||||
VIR_AUTOCLEAN(virBuffer) debug = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) debug = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOCLEAN(virBuffer) actualbuf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) actualbuf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOFREE(char *) jsonprotocol = NULL;
|
VIR_AUTOFREE(char *) jsonprotocol = NULL;
|
||||||
VIR_AUTOFREE(char *) jsonformat = NULL;
|
VIR_AUTOFREE(char *) jsonformat = NULL;
|
||||||
VIR_AUTOFREE(char *) actual = NULL;
|
VIR_AUTOFREE(char *) actual = NULL;
|
||||||
@ -482,7 +482,7 @@ static int
|
|||||||
testQemuDiskXMLToPropsValidateFileSrcOnly(const void *opaque)
|
testQemuDiskXMLToPropsValidateFileSrcOnly(const void *opaque)
|
||||||
{
|
{
|
||||||
struct testQemuDiskXMLToJSONData *data = (void *) opaque;
|
struct testQemuDiskXMLToJSONData *data = (void *) opaque;
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOFREE(char *) jsonpath = NULL;
|
VIR_AUTOFREE(char *) jsonpath = NULL;
|
||||||
VIR_AUTOFREE(char *) actual = NULL;
|
VIR_AUTOFREE(char *) actual = NULL;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
@ -511,7 +511,7 @@ qemuMonitorTestProcessCommandDefaultValidate(qemuMonitorTestPtr test,
|
|||||||
const char *cmdname,
|
const char *cmdname,
|
||||||
virJSONValuePtr args)
|
virJSONValuePtr args)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) debug = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) debug = VIR_BUFFER_INITIALIZER;
|
||||||
virJSONValuePtr schemaroot;
|
virJSONValuePtr schemaroot;
|
||||||
VIR_AUTOPTR(virJSONValue) emptyargs = NULL;
|
VIR_AUTOPTR(virJSONValue) emptyargs = NULL;
|
||||||
VIR_AUTOFREE(char *) schemapath = NULL;
|
VIR_AUTOFREE(char *) schemapath = NULL;
|
||||||
|
@ -306,8 +306,8 @@ static int testBufAddBuffer(const void *data G_GNUC_UNUSED)
|
|||||||
static int
|
static int
|
||||||
testBufAddBuffer2(const void *opaque G_GNUC_UNUSED)
|
testBufAddBuffer2(const void *opaque G_GNUC_UNUSED)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf1 = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf1 = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOCLEAN(virBuffer) buf2 = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf2 = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
/* Intent of this test is to demonstrate a memleak that happen with
|
/* Intent of this test is to demonstrate a memleak that happen with
|
||||||
* virBufferAddBuffer */
|
* virBufferAddBuffer */
|
||||||
@ -461,7 +461,7 @@ testBufSetIndent(const void *opaque G_GNUC_UNUSED)
|
|||||||
static int
|
static int
|
||||||
testBufferAutoclean(const void *opaque G_GNUC_UNUSED)
|
testBufferAutoclean(const void *opaque G_GNUC_UNUSED)
|
||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
virBufferAddLit(&buf, "test test test\n");
|
virBufferAddLit(&buf, "test test test\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -610,7 +610,7 @@ static int
|
|||||||
testBackingParse(const void *args)
|
testBackingParse(const void *args)
|
||||||
{
|
{
|
||||||
const struct testBackingParseData *data = args;
|
const struct testBackingParseData *data = args;
|
||||||
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOFREE(char *) xml = NULL;
|
VIR_AUTOFREE(char *) xml = NULL;
|
||||||
VIR_AUTOUNREF(virStorageSourcePtr) src = NULL;
|
VIR_AUTOUNREF(virStorageSourcePtr) src = NULL;
|
||||||
int rc;
|
int rc;
|
||||||
|
@ -554,7 +554,7 @@ testActivation(bool useNames)
|
|||||||
int *fds = NULL;
|
int *fds = NULL;
|
||||||
size_t nfds = 0;
|
size_t nfds = 0;
|
||||||
VIR_AUTOPTR(virSystemdActivation) act = NULL;
|
VIR_AUTOPTR(virSystemdActivation) act = NULL;
|
||||||
VIR_AUTOCLEAN(virBuffer) names = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) names = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
virBufferAddLit(&names, "demo-unix.socket");
|
virBufferAddLit(&names, "demo-unix.socket");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user