]> git.proxmox.com Git - mirror_qemu.git/blob - migration/postcopy-ram.c
Postcopy: Mark nohugepage before discard
[mirror_qemu.git] / migration / postcopy-ram.c
1 /*
2 * Postcopy migration for RAM
3 *
4 * Copyright 2013-2015 Red Hat, Inc. and/or its affiliates
5 *
6 * Authors:
7 * Dave Gilbert <dgilbert@redhat.com>
8 *
9 * This work is licensed under the terms of the GNU GPL, version 2 or later.
10 * See the COPYING file in the top-level directory.
11 *
12 */
13
14 /*
15 * Postcopy is a migration technique where the execution flips from the
16 * source to the destination before all the data has been copied.
17 */
18
19 #include <glib.h>
20 #include <stdio.h>
21 #include <unistd.h>
22
23 #include "qemu-common.h"
24 #include "migration/migration.h"
25 #include "migration/postcopy-ram.h"
26 #include "sysemu/sysemu.h"
27 #include "qemu/error-report.h"
28 #include "trace.h"
29
30 /* Arbitrary limit on size of each discard command,
31 * keeps them around ~200 bytes
32 */
33 #define MAX_DISCARDS_PER_COMMAND 12
34
35 struct PostcopyDiscardState {
36 const char *ramblock_name;
37 uint64_t offset; /* Bitmap entry for the 1st bit of this RAMBlock */
38 uint16_t cur_entry;
39 /*
40 * Start and length of a discard range (bytes)
41 */
42 uint64_t start_list[MAX_DISCARDS_PER_COMMAND];
43 uint64_t length_list[MAX_DISCARDS_PER_COMMAND];
44 unsigned int nsentwords;
45 unsigned int nsentcmds;
46 };
47
48 /* Postcopy needs to detect accesses to pages that haven't yet been copied
49 * across, and efficiently map new pages in, the techniques for doing this
50 * are target OS specific.
51 */
52 #if defined(__linux__)
53
54 #include <poll.h>
55 #include <sys/eventfd.h>
56 #include <sys/mman.h>
57 #include <sys/ioctl.h>
58 #include <sys/syscall.h>
59 #include <sys/types.h>
60 #include <asm/types.h> /* for __u64 */
61 #endif
62
63 #if defined(__linux__) && defined(__NR_userfaultfd)
64 #include <linux/userfaultfd.h>
65
66 static bool ufd_version_check(int ufd)
67 {
68 struct uffdio_api api_struct;
69 uint64_t ioctl_mask;
70
71 api_struct.api = UFFD_API;
72 api_struct.features = 0;
73 if (ioctl(ufd, UFFDIO_API, &api_struct)) {
74 error_report("postcopy_ram_supported_by_host: UFFDIO_API failed: %s",
75 strerror(errno));
76 return false;
77 }
78
79 ioctl_mask = (__u64)1 << _UFFDIO_REGISTER |
80 (__u64)1 << _UFFDIO_UNREGISTER;
81 if ((api_struct.ioctls & ioctl_mask) != ioctl_mask) {
82 error_report("Missing userfault features: %" PRIx64,
83 (uint64_t)(~api_struct.ioctls & ioctl_mask));
84 return false;
85 }
86
87 return true;
88 }
89
90 bool postcopy_ram_supported_by_host(void)
91 {
92 long pagesize = getpagesize();
93 int ufd = -1;
94 bool ret = false; /* Error unless we change it */
95 void *testarea = NULL;
96 struct uffdio_register reg_struct;
97 struct uffdio_range range_struct;
98 uint64_t feature_mask;
99
100 if ((1ul << qemu_target_page_bits()) > pagesize) {
101 error_report("Target page size bigger than host page size");
102 goto out;
103 }
104
105 ufd = syscall(__NR_userfaultfd, O_CLOEXEC);
106 if (ufd == -1) {
107 error_report("%s: userfaultfd not available: %s", __func__,
108 strerror(errno));
109 goto out;
110 }
111
112 /* Version and features check */
113 if (!ufd_version_check(ufd)) {
114 goto out;
115 }
116
117 /*
118 * We need to check that the ops we need are supported on anon memory
119 * To do that we need to register a chunk and see the flags that
120 * are returned.
121 */
122 testarea = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE |
123 MAP_ANONYMOUS, -1, 0);
124 if (testarea == MAP_FAILED) {
125 error_report("%s: Failed to map test area: %s", __func__,
126 strerror(errno));
127 goto out;
128 }
129 g_assert(((size_t)testarea & (pagesize-1)) == 0);
130
131 reg_struct.range.start = (uintptr_t)testarea;
132 reg_struct.range.len = pagesize;
133 reg_struct.mode = UFFDIO_REGISTER_MODE_MISSING;
134
135 if (ioctl(ufd, UFFDIO_REGISTER, &reg_struct)) {
136 error_report("%s userfault register: %s", __func__, strerror(errno));
137 goto out;
138 }
139
140 range_struct.start = (uintptr_t)testarea;
141 range_struct.len = pagesize;
142 if (ioctl(ufd, UFFDIO_UNREGISTER, &range_struct)) {
143 error_report("%s userfault unregister: %s", __func__, strerror(errno));
144 goto out;
145 }
146
147 feature_mask = (__u64)1 << _UFFDIO_WAKE |
148 (__u64)1 << _UFFDIO_COPY |
149 (__u64)1 << _UFFDIO_ZEROPAGE;
150 if ((reg_struct.ioctls & feature_mask) != feature_mask) {
151 error_report("Missing userfault map features: %" PRIx64,
152 (uint64_t)(~reg_struct.ioctls & feature_mask));
153 goto out;
154 }
155
156 /* Success! */
157 ret = true;
158 out:
159 if (testarea) {
160 munmap(testarea, pagesize);
161 }
162 if (ufd != -1) {
163 close(ufd);
164 }
165 return ret;
166 }
167
168 /**
169 * postcopy_ram_discard_range: Discard a range of memory.
170 * We can assume that if we've been called postcopy_ram_hosttest returned true.
171 *
172 * @mis: Current incoming migration state.
173 * @start, @length: range of memory to discard.
174 *
175 * returns: 0 on success.
176 */
177 int postcopy_ram_discard_range(MigrationIncomingState *mis, uint8_t *start,
178 size_t length)
179 {
180 trace_postcopy_ram_discard_range(start, length);
181 if (madvise(start, length, MADV_DONTNEED)) {
182 error_report("%s MADV_DONTNEED: %s", __func__, strerror(errno));
183 return -1;
184 }
185
186 return 0;
187 }
188
189 /*
190 * Setup an area of RAM so that it *can* be used for postcopy later; this
191 * must be done right at the start prior to pre-copy.
192 * opaque should be the MIS.
193 */
194 static int init_range(const char *block_name, void *host_addr,
195 ram_addr_t offset, ram_addr_t length, void *opaque)
196 {
197 MigrationIncomingState *mis = opaque;
198
199 trace_postcopy_init_range(block_name, host_addr, offset, length);
200
201 /*
202 * We need the whole of RAM to be truly empty for postcopy, so things
203 * like ROMs and any data tables built during init must be zero'd
204 * - we're going to get the copy from the source anyway.
205 * (Precopy will just overwrite this data, so doesn't need the discard)
206 */
207 if (postcopy_ram_discard_range(mis, host_addr, length)) {
208 return -1;
209 }
210
211 return 0;
212 }
213
214 /*
215 * At the end of migration, undo the effects of init_range
216 * opaque should be the MIS.
217 */
218 static int cleanup_range(const char *block_name, void *host_addr,
219 ram_addr_t offset, ram_addr_t length, void *opaque)
220 {
221 MigrationIncomingState *mis = opaque;
222 struct uffdio_range range_struct;
223 trace_postcopy_cleanup_range(block_name, host_addr, offset, length);
224
225 /*
226 * We turned off hugepage for the precopy stage with postcopy enabled
227 * we can turn it back on now.
228 */
229 if (qemu_madvise(host_addr, length, QEMU_MADV_HUGEPAGE)) {
230 error_report("%s HUGEPAGE: %s", __func__, strerror(errno));
231 return -1;
232 }
233
234 /*
235 * We can also turn off userfault now since we should have all the
236 * pages. It can be useful to leave it on to debug postcopy
237 * if you're not sure it's always getting every page.
238 */
239 range_struct.start = (uintptr_t)host_addr;
240 range_struct.len = length;
241
242 if (ioctl(mis->userfault_fd, UFFDIO_UNREGISTER, &range_struct)) {
243 error_report("%s: userfault unregister %s", __func__, strerror(errno));
244
245 return -1;
246 }
247
248 return 0;
249 }
250
251 /*
252 * Initialise postcopy-ram, setting the RAM to a state where we can go into
253 * postcopy later; must be called prior to any precopy.
254 * called from arch_init's similarly named ram_postcopy_incoming_init
255 */
256 int postcopy_ram_incoming_init(MigrationIncomingState *mis, size_t ram_pages)
257 {
258 if (qemu_ram_foreach_block(init_range, mis)) {
259 return -1;
260 }
261
262 return 0;
263 }
264
265 /*
266 * At the end of a migration where postcopy_ram_incoming_init was called.
267 */
268 int postcopy_ram_incoming_cleanup(MigrationIncomingState *mis)
269 {
270 trace_postcopy_ram_incoming_cleanup_entry();
271
272 if (mis->have_fault_thread) {
273 uint64_t tmp64;
274
275 if (qemu_ram_foreach_block(cleanup_range, mis)) {
276 return -1;
277 }
278 /*
279 * Tell the fault_thread to exit, it's an eventfd that should
280 * currently be at 0, we're going to increment it to 1
281 */
282 tmp64 = 1;
283 if (write(mis->userfault_quit_fd, &tmp64, 8) == 8) {
284 trace_postcopy_ram_incoming_cleanup_join();
285 qemu_thread_join(&mis->fault_thread);
286 } else {
287 /* Not much we can do here, but may as well report it */
288 error_report("%s: incrementing userfault_quit_fd: %s", __func__,
289 strerror(errno));
290 }
291 trace_postcopy_ram_incoming_cleanup_closeuf();
292 close(mis->userfault_fd);
293 close(mis->userfault_quit_fd);
294 mis->have_fault_thread = false;
295 }
296
297 postcopy_state_set(POSTCOPY_INCOMING_END);
298 migrate_send_rp_shut(mis, qemu_file_get_error(mis->from_src_file) != 0);
299
300 if (mis->postcopy_tmp_page) {
301 munmap(mis->postcopy_tmp_page, getpagesize());
302 mis->postcopy_tmp_page = NULL;
303 }
304 trace_postcopy_ram_incoming_cleanup_exit();
305 return 0;
306 }
307
308 /*
309 * Disable huge pages on an area
310 */
311 static int nhp_range(const char *block_name, void *host_addr,
312 ram_addr_t offset, ram_addr_t length, void *opaque)
313 {
314 trace_postcopy_nhp_range(block_name, host_addr, offset, length);
315
316 /*
317 * Before we do discards we need to ensure those discards really
318 * do delete areas of the page, even if THP thinks a hugepage would
319 * be a good idea, so force hugepages off.
320 */
321 if (qemu_madvise(host_addr, length, QEMU_MADV_NOHUGEPAGE)) {
322 error_report("%s: NOHUGEPAGE: %s", __func__, strerror(errno));
323 return -1;
324 }
325
326 return 0;
327 }
328
329 /*
330 * Userfault requires us to mark RAM as NOHUGEPAGE prior to discard
331 * however leaving it until after precopy means that most of the precopy
332 * data is still THPd
333 */
334 int postcopy_ram_prepare_discard(MigrationIncomingState *mis)
335 {
336 if (qemu_ram_foreach_block(nhp_range, mis)) {
337 return -1;
338 }
339
340 postcopy_state_set(POSTCOPY_INCOMING_DISCARD);
341
342 return 0;
343 }
344
345 /*
346 * Mark the given area of RAM as requiring notification to unwritten areas
347 * Used as a callback on qemu_ram_foreach_block.
348 * host_addr: Base of area to mark
349 * offset: Offset in the whole ram arena
350 * length: Length of the section
351 * opaque: MigrationIncomingState pointer
352 * Returns 0 on success
353 */
354 static int ram_block_enable_notify(const char *block_name, void *host_addr,
355 ram_addr_t offset, ram_addr_t length,
356 void *opaque)
357 {
358 MigrationIncomingState *mis = opaque;
359 struct uffdio_register reg_struct;
360
361 reg_struct.range.start = (uintptr_t)host_addr;
362 reg_struct.range.len = length;
363 reg_struct.mode = UFFDIO_REGISTER_MODE_MISSING;
364
365 /* Now tell our userfault_fd that it's responsible for this area */
366 if (ioctl(mis->userfault_fd, UFFDIO_REGISTER, &reg_struct)) {
367 error_report("%s userfault register: %s", __func__, strerror(errno));
368 return -1;
369 }
370
371 return 0;
372 }
373
374 /*
375 * Handle faults detected by the USERFAULT markings
376 */
377 static void *postcopy_ram_fault_thread(void *opaque)
378 {
379 MigrationIncomingState *mis = opaque;
380 struct uffd_msg msg;
381 int ret;
382 size_t hostpagesize = getpagesize();
383 RAMBlock *rb = NULL;
384 RAMBlock *last_rb = NULL; /* last RAMBlock we sent part of */
385
386 trace_postcopy_ram_fault_thread_entry();
387 qemu_sem_post(&mis->fault_thread_sem);
388
389 while (true) {
390 ram_addr_t rb_offset;
391 ram_addr_t in_raspace;
392 struct pollfd pfd[2];
393
394 /*
395 * We're mainly waiting for the kernel to give us a faulting HVA,
396 * however we can be told to quit via userfault_quit_fd which is
397 * an eventfd
398 */
399 pfd[0].fd = mis->userfault_fd;
400 pfd[0].events = POLLIN;
401 pfd[0].revents = 0;
402 pfd[1].fd = mis->userfault_quit_fd;
403 pfd[1].events = POLLIN; /* Waiting for eventfd to go positive */
404 pfd[1].revents = 0;
405
406 if (poll(pfd, 2, -1 /* Wait forever */) == -1) {
407 error_report("%s: userfault poll: %s", __func__, strerror(errno));
408 break;
409 }
410
411 if (pfd[1].revents) {
412 trace_postcopy_ram_fault_thread_quit();
413 break;
414 }
415
416 ret = read(mis->userfault_fd, &msg, sizeof(msg));
417 if (ret != sizeof(msg)) {
418 if (errno == EAGAIN) {
419 /*
420 * if a wake up happens on the other thread just after
421 * the poll, there is nothing to read.
422 */
423 continue;
424 }
425 if (ret < 0) {
426 error_report("%s: Failed to read full userfault message: %s",
427 __func__, strerror(errno));
428 break;
429 } else {
430 error_report("%s: Read %d bytes from userfaultfd expected %zd",
431 __func__, ret, sizeof(msg));
432 break; /* Lost alignment, don't know what we'd read next */
433 }
434 }
435 if (msg.event != UFFD_EVENT_PAGEFAULT) {
436 error_report("%s: Read unexpected event %ud from userfaultfd",
437 __func__, msg.event);
438 continue; /* It's not a page fault, shouldn't happen */
439 }
440
441 rb = qemu_ram_block_from_host(
442 (void *)(uintptr_t)msg.arg.pagefault.address,
443 true, &in_raspace, &rb_offset);
444 if (!rb) {
445 error_report("postcopy_ram_fault_thread: Fault outside guest: %"
446 PRIx64, (uint64_t)msg.arg.pagefault.address);
447 break;
448 }
449
450 rb_offset &= ~(hostpagesize - 1);
451 trace_postcopy_ram_fault_thread_request(msg.arg.pagefault.address,
452 qemu_ram_get_idstr(rb),
453 rb_offset);
454
455 /*
456 * Send the request to the source - we want to request one
457 * of our host page sizes (which is >= TPS)
458 */
459 if (rb != last_rb) {
460 last_rb = rb;
461 migrate_send_rp_req_pages(mis, qemu_ram_get_idstr(rb),
462 rb_offset, hostpagesize);
463 } else {
464 /* Save some space */
465 migrate_send_rp_req_pages(mis, NULL,
466 rb_offset, hostpagesize);
467 }
468 }
469 trace_postcopy_ram_fault_thread_exit();
470 return NULL;
471 }
472
473 int postcopy_ram_enable_notify(MigrationIncomingState *mis)
474 {
475 /* Open the fd for the kernel to give us userfaults */
476 mis->userfault_fd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
477 if (mis->userfault_fd == -1) {
478 error_report("%s: Failed to open userfault fd: %s", __func__,
479 strerror(errno));
480 return -1;
481 }
482
483 /*
484 * Although the host check already tested the API, we need to
485 * do the check again as an ABI handshake on the new fd.
486 */
487 if (!ufd_version_check(mis->userfault_fd)) {
488 return -1;
489 }
490
491 /* Now an eventfd we use to tell the fault-thread to quit */
492 mis->userfault_quit_fd = eventfd(0, EFD_CLOEXEC);
493 if (mis->userfault_quit_fd == -1) {
494 error_report("%s: Opening userfault_quit_fd: %s", __func__,
495 strerror(errno));
496 close(mis->userfault_fd);
497 return -1;
498 }
499
500 qemu_sem_init(&mis->fault_thread_sem, 0);
501 qemu_thread_create(&mis->fault_thread, "postcopy/fault",
502 postcopy_ram_fault_thread, mis, QEMU_THREAD_JOINABLE);
503 qemu_sem_wait(&mis->fault_thread_sem);
504 qemu_sem_destroy(&mis->fault_thread_sem);
505 mis->have_fault_thread = true;
506
507 /* Mark so that we get notified of accesses to unwritten areas */
508 if (qemu_ram_foreach_block(ram_block_enable_notify, mis)) {
509 return -1;
510 }
511
512 trace_postcopy_ram_enable_notify();
513
514 return 0;
515 }
516
517 /*
518 * Place a host page (from) at (host) atomically
519 * returns 0 on success
520 */
521 int postcopy_place_page(MigrationIncomingState *mis, void *host, void *from)
522 {
523 struct uffdio_copy copy_struct;
524
525 copy_struct.dst = (uint64_t)(uintptr_t)host;
526 copy_struct.src = (uint64_t)(uintptr_t)from;
527 copy_struct.len = getpagesize();
528 copy_struct.mode = 0;
529
530 /* copy also acks to the kernel waking the stalled thread up
531 * TODO: We can inhibit that ack and only do it if it was requested
532 * which would be slightly cheaper, but we'd have to be careful
533 * of the order of updating our page state.
534 */
535 if (ioctl(mis->userfault_fd, UFFDIO_COPY, &copy_struct)) {
536 int e = errno;
537 error_report("%s: %s copy host: %p from: %p",
538 __func__, strerror(e), host, from);
539
540 return -e;
541 }
542
543 trace_postcopy_place_page(host);
544 return 0;
545 }
546
547 /*
548 * Place a zero page at (host) atomically
549 * returns 0 on success
550 */
551 int postcopy_place_page_zero(MigrationIncomingState *mis, void *host)
552 {
553 struct uffdio_zeropage zero_struct;
554
555 zero_struct.range.start = (uint64_t)(uintptr_t)host;
556 zero_struct.range.len = getpagesize();
557 zero_struct.mode = 0;
558
559 if (ioctl(mis->userfault_fd, UFFDIO_ZEROPAGE, &zero_struct)) {
560 int e = errno;
561 error_report("%s: %s zero host: %p",
562 __func__, strerror(e), host);
563
564 return -e;
565 }
566
567 trace_postcopy_place_page_zero(host);
568 return 0;
569 }
570
571 /*
572 * Returns a target page of memory that can be mapped at a later point in time
573 * using postcopy_place_page
574 * The same address is used repeatedly, postcopy_place_page just takes the
575 * backing page away.
576 * Returns: Pointer to allocated page
577 *
578 */
579 void *postcopy_get_tmp_page(MigrationIncomingState *mis)
580 {
581 if (!mis->postcopy_tmp_page) {
582 mis->postcopy_tmp_page = mmap(NULL, getpagesize(),
583 PROT_READ | PROT_WRITE, MAP_PRIVATE |
584 MAP_ANONYMOUS, -1, 0);
585 if (!mis->postcopy_tmp_page) {
586 error_report("%s: %s", __func__, strerror(errno));
587 return NULL;
588 }
589 }
590
591 return mis->postcopy_tmp_page;
592 }
593
594 #else
595 /* No target OS support, stubs just fail */
596 bool postcopy_ram_supported_by_host(void)
597 {
598 error_report("%s: No OS support", __func__);
599 return false;
600 }
601
602 int postcopy_ram_incoming_init(MigrationIncomingState *mis, size_t ram_pages)
603 {
604 error_report("postcopy_ram_incoming_init: No OS support");
605 return -1;
606 }
607
608 int postcopy_ram_incoming_cleanup(MigrationIncomingState *mis)
609 {
610 assert(0);
611 return -1;
612 }
613
614 int postcopy_ram_discard_range(MigrationIncomingState *mis, uint8_t *start,
615 size_t length)
616 {
617 assert(0);
618 return -1;
619 }
620
621 int postcopy_ram_prepare_discard(MigrationIncomingState *mis)
622 {
623 assert(0);
624 return -1;
625 }
626
627 int postcopy_ram_enable_notify(MigrationIncomingState *mis)
628 {
629 assert(0);
630 return -1;
631 }
632
633 int postcopy_place_page(MigrationIncomingState *mis, void *host, void *from)
634 {
635 assert(0);
636 return -1;
637 }
638
639 int postcopy_place_page_zero(MigrationIncomingState *mis, void *host)
640 {
641 assert(0);
642 return -1;
643 }
644
645 void *postcopy_get_tmp_page(MigrationIncomingState *mis)
646 {
647 assert(0);
648 return NULL;
649 }
650
651 #endif
652
653 /* ------------------------------------------------------------------------- */
654
655 /**
656 * postcopy_discard_send_init: Called at the start of each RAMBlock before
657 * asking to discard individual ranges.
658 *
659 * @ms: The current migration state.
660 * @offset: the bitmap offset of the named RAMBlock in the migration
661 * bitmap.
662 * @name: RAMBlock that discards will operate on.
663 *
664 * returns: a new PDS.
665 */
666 PostcopyDiscardState *postcopy_discard_send_init(MigrationState *ms,
667 unsigned long offset,
668 const char *name)
669 {
670 PostcopyDiscardState *res = g_malloc0(sizeof(PostcopyDiscardState));
671
672 if (res) {
673 res->ramblock_name = name;
674 res->offset = offset;
675 }
676
677 return res;
678 }
679
680 /**
681 * postcopy_discard_send_range: Called by the bitmap code for each chunk to
682 * discard. May send a discard message, may just leave it queued to
683 * be sent later.
684 *
685 * @ms: Current migration state.
686 * @pds: Structure initialised by postcopy_discard_send_init().
687 * @start,@length: a range of pages in the migration bitmap in the
688 * RAM block passed to postcopy_discard_send_init() (length=1 is one page)
689 */
690 void postcopy_discard_send_range(MigrationState *ms, PostcopyDiscardState *pds,
691 unsigned long start, unsigned long length)
692 {
693 size_t tp_bits = qemu_target_page_bits();
694 /* Convert to byte offsets within the RAM block */
695 pds->start_list[pds->cur_entry] = (start - pds->offset) << tp_bits;
696 pds->length_list[pds->cur_entry] = length << tp_bits;
697 trace_postcopy_discard_send_range(pds->ramblock_name, start, length);
698 pds->cur_entry++;
699 pds->nsentwords++;
700
701 if (pds->cur_entry == MAX_DISCARDS_PER_COMMAND) {
702 /* Full set, ship it! */
703 qemu_savevm_send_postcopy_ram_discard(ms->file, pds->ramblock_name,
704 pds->cur_entry,
705 pds->start_list,
706 pds->length_list);
707 pds->nsentcmds++;
708 pds->cur_entry = 0;
709 }
710 }
711
712 /**
713 * postcopy_discard_send_finish: Called at the end of each RAMBlock by the
714 * bitmap code. Sends any outstanding discard messages, frees the PDS
715 *
716 * @ms: Current migration state.
717 * @pds: Structure initialised by postcopy_discard_send_init().
718 */
719 void postcopy_discard_send_finish(MigrationState *ms, PostcopyDiscardState *pds)
720 {
721 /* Anything unsent? */
722 if (pds->cur_entry) {
723 qemu_savevm_send_postcopy_ram_discard(ms->file, pds->ramblock_name,
724 pds->cur_entry,
725 pds->start_list,
726 pds->length_list);
727 pds->nsentcmds++;
728 }
729
730 trace_postcopy_discard_send_finish(pds->ramblock_name, pds->nsentwords,
731 pds->nsentcmds);
732
733 g_free(pds);
734 }