2015-09-09 14:03:14 +00:00
|
|
|
/*
|
|
|
|
* qemu_capspriv.h: private declarations for QEMU capabilities generation
|
|
|
|
*
|
|
|
|
* Copyright (C) 2015 Samsung Electronics Co. Ltd
|
|
|
|
* Copyright (C) 2015 Pavel Fedin
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library. If not, see
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* Author: Pavel Fedin <p.fedin@samsung.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __QEMU_CAPSRIV_H_ALLOW__
|
|
|
|
# error "qemu_capspriv.h may only be included by qemu_capabilities.c or test suites"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __QEMU_CAPSPRIV_H__
|
|
|
|
# define __QEMU_CAPSPRIV_H__
|
|
|
|
|
|
|
|
struct _virQEMUCapsCache {
|
|
|
|
virMutex lock;
|
|
|
|
virHashTablePtr binaries;
|
|
|
|
char *libDir;
|
|
|
|
char *cacheDir;
|
|
|
|
uid_t runUid;
|
|
|
|
gid_t runGid;
|
|
|
|
};
|
|
|
|
|
2016-08-04 20:43:22 +00:00
|
|
|
virQEMUCapsPtr virQEMUCapsNewCopy(virQEMUCapsPtr qemuCaps);
|
|
|
|
|
2016-04-26 13:03:06 +00:00
|
|
|
virQEMUCapsPtr
|
2016-06-15 11:48:19 +00:00
|
|
|
virQEMUCapsNewForBinaryInternal(virCapsPtr caps,
|
|
|
|
const char *binary,
|
2016-04-26 13:03:06 +00:00
|
|
|
const char *libDir,
|
|
|
|
const char *cacheDir,
|
|
|
|
uid_t runUid,
|
|
|
|
gid_t runGid,
|
|
|
|
bool qmpOnly);
|
|
|
|
|
2016-06-15 12:35:18 +00:00
|
|
|
int virQEMUCapsLoadCache(virCapsPtr caps,
|
|
|
|
virQEMUCapsPtr qemuCaps,
|
2016-04-28 13:01:02 +00:00
|
|
|
const char *filename,
|
|
|
|
time_t *selfctime,
|
|
|
|
unsigned long *selfvers);
|
|
|
|
char *virQEMUCapsFormatCache(virQEMUCapsPtr qemuCaps,
|
|
|
|
time_t selfCTime,
|
|
|
|
unsigned long selfVersion);
|
|
|
|
|
2016-06-10 15:16:21 +00:00
|
|
|
int
|
|
|
|
virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps,
|
|
|
|
qemuMonitorPtr mon);
|
|
|
|
|
|
|
|
int
|
|
|
|
virQEMUCapsInitQMPMonitorTCG(virQEMUCapsPtr qemuCaps,
|
|
|
|
qemuMonitorPtr mon);
|
|
|
|
|
2016-08-03 10:26:41 +00:00
|
|
|
void
|
|
|
|
virQEMUCapsSetArch(virQEMUCapsPtr qemuCaps,
|
|
|
|
virArch arch);
|
2016-06-15 12:35:18 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps,
|
qemu: Fix crash in qemucapsprobe
The qemucapsprobe helper calls virQEMUCapsNewForBinaryInternal with
caps == NULL, causing the following crash:
Program received signal SIGSEGV, Segmentation fault.
#0 0x00007ffff788775f in virQEMUCapsInitHostCPUModel
(qemuCaps=qemuCaps@entry=0x649680, host=host@entry=0x10) at
src/qemu/qemu_capabilities.c:2969
#1 0x00007ffff7889dbf in virQEMUCapsNewForBinaryInternal
(caps=caps@entry=0x0, binary=<optimized out>,
libDir=libDir@entry=0x4033f6 "/tmp", cacheDir=cacheDir@entry=0x0,
runUid=runUid@entry=4294967295, runGid=runGid@entry=4294967295,
qmpOnly=true) at src/qemu/qemu_capabilities.c:4039
#2 0x0000000000401702 in main (argc=2, argv=0x7fffffffd968) at
tests/qemucapsprobe.c:73
Caused by v2.2.0-182-g68c7011.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-09-27 11:39:51 +00:00
|
|
|
virCapsPtr caps);
|
2015-09-09 14:03:14 +00:00
|
|
|
#endif
|