#define error guestfs_error
#define perrorf guestfs_perrorf
#define safe_malloc guestfs_safe_malloc
#define error guestfs_error
#define perrorf guestfs_perrorf
#define safe_malloc guestfs_safe_malloc
- const char *path;
- const char *qemu;
-
- const char *append; /* Append to kernel command line. */
+ char *path; /* Path to kernel, initrd. */
+ char *qemu; /* Qemu binary. */
+ char *append; /* Append to kernel command line. */
g->verbose = str != NULL && strcmp (str, "1") == 0;
str = getenv ("LIBGUESTFS_PATH");
g->verbose = str != NULL && strcmp (str, "1") == 0;
str = getenv ("LIBGUESTFS_PATH");
if (g->state == NO_HANDLE) {
/* Not safe to call 'error' here, so ... */
if (g->state == NO_HANDLE) {
/* Not safe to call 'error' here, so ... */
add_cmdline (guestfs_h *g, const char *str)
{
if (g->state != CONFIG) {
add_cmdline (guestfs_h *g, const char *str)
{
if (g->state != CONFIG) {
const char *qemu_param, const char *qemu_value)
{
if (qemu_param[0] != '-') {
const char *qemu_param, const char *qemu_value)
{
if (qemu_param[0] != '-') {
strcmp (qemu_param, "-full-screen") == 0 ||
strcmp (qemu_param, "-std-vga") == 0 ||
strcmp (qemu_param, "-vnc") == 0) {
strcmp (qemu_param, "-full-screen") == 0 ||
strcmp (qemu_param, "-std-vga") == 0 ||
strcmp (qemu_param, "-vnc") == 0) {
guestfs_add_cdrom (guestfs_h *g, const char *filename)
{
if (strchr (filename, ',') != NULL) {
guestfs_add_cdrom (guestfs_h *g, const char *filename)
{
if (strchr (filename, ',') != NULL) {
if (!g->tmpdir) {
g->tmpdir = safe_strdup (g, dir_template);
if (mkdtemp (g->tmpdir) == NULL) {
if (!g->tmpdir) {
g->tmpdir = safe_strdup (g, dir_template);
if (mkdtemp (g->tmpdir) == NULL) {
/* Set up the full command line. Do this in the subprocess so we
* don't need to worry about cleaning up.
*/
/* Set up the full command line. Do this in the subprocess so we
* don't need to worry about cleaning up.
*/
/* Construct the -net channel parameter for qemu. */
snprintf (vmchannel, sizeof vmchannel,
/* Construct the -net channel parameter for qemu. */
snprintf (vmchannel, sizeof vmchannel,
- error (g, "stdout_event: internal error: %d != %d", g->fd[1], fd);
+ error (g, _("stdout_event: internal error: %d != %d"), g->fd[1], fd);
g, g->state, fd, events);
if (g->sock != fd) {
g, g->state, fd, events);
if (g->sock != fd) {
- error (g, "sock_read_event: internal error: %d != %d", g->sock, fd);
+ error (g, _("sock_read_event: internal error: %d != %d"), g->sock, fd);
xdrmem_create (&xdr, g->msg_in, g->msg_in_size, XDR_DECODE);
if (!xdr_uint32_t (&xdr, &len)) {
xdrmem_create (&xdr, g->msg_in, g->msg_in_size, XDR_DECODE);
if (!xdr_uint32_t (&xdr, &len)) {
- error (g, "received magic signature from guestfsd, but in state %d",
+ error (g, _("received magic signature from guestfsd, but in state %d"),
- error (g, "received magic signature from guestfsd, but msg size is %d",
+ error (g, _("received magic signature from guestfsd, but msg size is %d"),
g, g->state, fd, events);
if (g->sock != fd) {
g, g->state, fd, events);
if (g->sock != fd) {
- error (g, "sock_write_event: internal error: %d != %d", g->sock, fd);
+ error (g, _("sock_write_event: internal error: %d != %d"), g->sock, fd);
{
if (g->sock_watch >= 0) {
if (g->main_loop->remove_handle (g->main_loop, g, g->sock_watch) == -1) {
{
if (g->sock_watch >= 0) {
if (g->main_loop->remove_handle (g->main_loop, g, g->sock_watch) == -1) {
{
if (g->sock_watch >= 0) {
if (g->main_loop->remove_handle (g->main_loop, g, g->sock_watch) == -1) {
{
if (g->sock_watch >= 0) {
if (g->main_loop->remove_handle (g->main_loop, g, g->sock_watch) == -1) {
hdr.status = GUESTFS_STATUS_OK;
if (!xdr_guestfs_message_header (&xdr, &hdr)) {
hdr.status = GUESTFS_STATUS_OK;
if (!xdr_guestfs_message_header (&xdr, &hdr)) {
chunk.data.data_val = (char *) buf;
if (!xdr_guestfs_chunk (&xdr, &chunk)) {
chunk.data.data_val = (char *) buf;
if (!xdr_guestfs_chunk (&xdr, &chunk)) {
- error (g, "xdr_guestfs_chunk failed (buf = %p, buflen = %zu)",
+ error (g, _("xdr_guestfs_chunk failed (buf = %p, buflen = %zu)"),
- error (g, "check_for_daemon_cancellation: read 0x%x from daemon, expected 0x%x\n",
+ error (g, _("check_for_daemon_cancellation: read 0x%x from daemon, expected 0x%x\n"),
memset (&chunk, 0, sizeof chunk);
if (!xdr_guestfs_chunk (xdr, &chunk)) {
memset (&chunk, 0, sizeof chunk);
if (!xdr_guestfs_chunk (xdr, &chunk)) {
return -1;
}
if (FD_ISSET (fd, &ml->rset) ||
FD_ISSET (fd, &ml->wset) ||
FD_ISSET (fd, &ml->xset)) {
return -1;
}
if (FD_ISSET (fd, &ml->rset) ||
FD_ISSET (fd, &ml->wset) ||
FD_ISSET (fd, &ml->xset)) {
return -1;
}
if (!FD_ISSET (fd, &ml->rset) &&
!FD_ISSET (fd, &ml->wset) &&
!FD_ISSET (fd, &ml->xset)) {
return -1;
}
if (!FD_ISSET (fd, &ml->rset) &&
!FD_ISSET (fd, &ml->wset) &&
!FD_ISSET (fd, &ml->xset)) {